diff --git a/.hgtags b/.hgtags index a9925795d56..f0dd95d1127 100644 --- a/.hgtags +++ b/.hgtags @@ -2,3 +2,7 @@ bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25 5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26 67052ac87fc927d048e62ec54ff42adb230d3f7c jdk7-b27 +18dc4ba4739a537fd146f77da51db16efce28da2 jdk7-b28 +bfe4572fd301a6fcd120373cdb2eff5d2da0c72c jdk7-b29 +bee4731164a06ddece1297ae58db24aca6a1c626 jdk7-b30 +cd8b8f500face60d1566d850857a7fccadbd383a jdk7-b31 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 2d38b379a00..ce58a609d1b 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -2,3 +2,7 @@ cfeea66a3fa8ca3686a7cfa2d0ce8ab0169f168d jdk7-b24 cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25 9410f77cc30c604d1caf7c9fe3a57fa19e1acbe8 jdk7-b26 11b4dc9f2be3523ef989a0db8459eb56b3045c3a jdk7-b27 +56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28 +31e08f70e88d77c2053f91c21b49a04296bdc59a jdk7-b29 +2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30 +3300a35a0bd56d695b92fe0b34f03ebbfc939064 jdk7-b31 diff --git a/Makefile b/Makefile index d5b3ebac73a..24cd12282e2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 diff --git a/README-builds.html b/README-builds.html index a2cf768e122..37998f9c1f6 100644 --- a/README-builds.html +++ b/README-builds.html @@ -5,15 +5,12 @@ - + +
@@ -54,6 +51,7 @@
  • Bootstrap JDK
  • Binary Plugs
  • Optional Import JDK
  • +
  • Ant
  • Certificate Authority File (cacert)
  • Compilers

    @@ -507,6 +518,11 @@ Install or upgrade the FreeType development package.

  • +
  • + Install + Ant, set + ANT_HOME. +
  • @@ -567,6 +583,11 @@ CUPS Include files, set ALT_CUPS_HEADERS_PATH. +
  • + Install + Ant, set + ANT_HOME. +
  • @@ -654,6 +675,11 @@ Install Microsoft DirectX SDK. +
  • + Install + Ant, set + ANT_HOME. +
  • @@ -736,6 +762,22 @@ and the build will copy the needed files from this import area. +

    Ant

    +
    + All OpenJDK builds require access to least Ant 1.6.5. + The Ant tool is available from the + + Ant download site. + You should always set + ANT_HOME + to point to the location of + the Ant installation, this is the directory pathname + that contains a bin and lib. + It's also a good idea to also place its bin directory + in the PATH environment variable, although it's + not absolutely required. +
    +

    Certificate Authority File (cacert)

    See @@ -915,6 +957,21 @@ and ALT_FREETYPE_HEADERS_PATH to refer to place where library and header files are installed. +

    + Building the freetype 2 libraries from scratch is also possible, + however on Windows refer to the + + Windows FreeType DLL build instructions. +

    + Note that by default FreeType is built with byte code hinting + support disabled due to licensing restrictions. + In this case, text appearance and metrics are expected to + differ from Sun's official JDK build. + See + + the SourceForge FreeType2 Home Page + + for more information.

    Advanced Linux Sound Architecture (ALSA) (Linux only)

    @@ -1036,7 +1093,8 @@ - + @@ -1050,7 +1108,7 @@ - + @@ -1061,17 +1119,17 @@ - + - + - + @@ -1224,46 +1282,6 @@ document) that can impact the build are:
    -
    PATH
    -
    Typically you want to set the PATH to include: -
      -
    • The location of the GNU make binary
    • -
    • The location of the Bootstrap JDK java - (see Bootstrap JDK)
    • -
    • The location of the C/C++ compilers - (see compilers)
    • -
    • The location or locations for the Unix command utilities - (e.g. /usr/bin)
    • -
    -
    -
    MILESTONE
    -
    - The milestone name for the build (e.g."beta"). - The default value is "internal". -
    -
    BUILD_NUMBER
    -
    - The build number for the build (e.g. "b27"). - The default value is "b00". -
    -
    ARCH_DATA_MODEL
    -
    The ARCH_DATA_MODEL variable - is used to specify whether the build is to generate 32-bit or 64-bit - binaries. - The Solaris build supports either 32-bit or 64-bit builds, but - Windows and Linux will support only one, depending on the specific - OS being used. - Normally, setting this variable is only necessary on Solaris. - Set ARCH_DATA_MODEL to 32 for generating 32-bit binaries, - or to 64 for generating 64-bit binaries. -
    -
    ALT_BOOTDIR
    -
    - The location of the bootstrap JDK installation. - See Bootstrap JDK for more information. - You should always install your own local Bootstrap JDK and - always set ALT_BOOTDIR explicitly. -
    ALT_BINARY_PLUGS_PATH
    The location of the binary plugs installation. @@ -1272,118 +1290,12 @@ recent Binary Plugs install image and set this variable to that location.
    -
    ALT_JDK_IMPORT_PATH
    +
    ALT_BOOTDIR
    - The location of a previously built JDK installation. - See Optional Import JDK for more information. -
    -
    ALT_OUTPUTDIR
    -
    - An override for specifying the (absolute) path of where the - build output is to go. - The default output directory will be build/platform. -
    -
    ALT_COMPILER_PATH
    -
    - The location of the C/C++ compiler. - The default varies depending on the platform. -
    -
    ALT_CACERTS_FILE
    -
    - The location of the cacerts file. - The default will refer to - jdk/src/share/lib/security/cacerts. -
    -
    ALT_CUPS_HEADERS_PATH
    -
    - The location of the CUPS header files. - See CUPS information for more information. - If this path does not exist the fallback path is - /usr/include. -
    -
    ALT_FREETYPE_LIB_PATH
    -
    - The location of the FreeType shared library. - See FreeType information for details. -
    -
    ALT_FREETYPE_HEADERS_PATH
    -
    - The location of the FreeType header files. - See FreeType information for details. -
    -
    ALT_JDK_DEVTOOLS_PATH
    -
    - The default root location of the devtools. - The default value is - $(ALT_SLASH_JAVA)/devtools. -
    -
    ALT_DEVTOOLS_PATH
    -
    - The location of tools like the - zip and unzip - binaries, but might also contain the GNU make utility - (gmake). - So this area is a bit of a grab bag, especially on Windows. - The default value depends on the platform and - Unix Commands being used. - On Linux the default will be - $(ALT_JDK_DEVTOOLS_PATH)/linux/bin, - on Solaris - $(ALT_JDK_DEVTOOLS_PATH)/{sparc,i386}/bin, - on Windows with MKS - %SYSTEMDRIVE%/UTILS, - and on Windows with CYGWIN - /usr/bin. -
    -
    ALT_UNIXCOMMAND_PATH
    -
    - An override for specifying where the - Unix command set are located. - The default location varies depending on the platform, - "%SYSTEMDRIVE%/MKSNT" or - $(ROOTDIR) on Windows with MKS, otherwise it's - "/bin" or /usr/bin. -
    -
    ALT_UNIXCCS_PATH
    -
    - Solaris only: - An override for specifying where the Unix CCS - command set are located. - The default location is /usr/ccs/bin -
    -
    ALT_USRBIN_PATH
    -
    - An override for specifying where the - Unix /usr/bin commands are located. You usually do not need - to set this variable: the default location is /usr/bin) -
    -
    ALT_SLASHJAVA
    -
    - The default root location for many of the ALT path locations - of the following ALT variables. - The default value is - "/java" on Solaris and Linux, - "J:" on Windows. -
    -
    ALT_BUILD_JDK_IMPORT_PATH
    -
    - These are useful in managing builds on multiple platforms. - The default network location for all of the import JDK images - for all platforms. - If ALT_JDK_IMPORT_PATH - is not set, this directory will be used and should contain - the following directories: - solaris-sparc, - solaris-i586, - solaris-sparcv9, - solaris-amd64, - linux-i586, - linux-amd64, - windows-i586, - and - windows-amd64. - Where each of these directories contain the import JDK image - for that platform. + The location of the bootstrap JDK installation. + See Bootstrap JDK for more information. + You should always install your own local Bootstrap JDK and + always set ALT_BOOTDIR explicitly.
    ALT_BUILD_BINARY_PLUGS_PATH
    @@ -1405,36 +1317,186 @@ Where each of these directories contain the binary plugs image for that platform.
    -
    Windows specific:
    +
    ALT_BUILD_JDK_IMPORT_PATH
    -
    -
    ALT_MSDEVTOOLS_PATH
    -
    - The location of the Microsoft Visual Studio .NET 2003 - tools 'bin' directory. - The default is usually derived from - ALT_COMPILER_PATH. -
    -
    ALT_DXSDK_PATH
    -
    - The location of the - Microsoft DirectX 9 SDK. - The default will be to try and use the DirectX environment - variable DXSDK_DIR, - failing that, look in C:/DXSDK. -
    -
    ALT_MSVCRT_DLL_PATH
    -
    - The location of the - MSVCRT.DLL. -
    -
    ALT_MSVCR71_DLL_PATH
    -
    - i586 only: - The location of the - MSVCR71.DLL. -
    -
    + These are useful in managing builds on multiple platforms. + The default network location for all of the import JDK images + for all platforms. + If ALT_JDK_IMPORT_PATH + is not set, this directory will be used and should contain + the following directories: + solaris-sparc, + solaris-i586, + solaris-sparcv9, + solaris-amd64, + linux-i586, + linux-amd64, + windows-i586, + and + windows-amd64. + Where each of these directories contain the import JDK image + for that platform. +
    +
    ALT_CACERTS_FILE
    +
    + The location of the cacerts file. + The default will refer to + jdk/src/share/lib/security/cacerts. +
    +
    ALT_COMPILER_PATH
    +
    + The location of the C/C++ compiler. + The default varies depending on the platform. +
    +
    ALT_CUPS_HEADERS_PATH
    +
    + The location of the CUPS header files. + See CUPS information for more information. + If this path does not exist the fallback path is + /usr/include. +
    +
    ALT_DEVTOOLS_PATH
    +
    + The location of tools like the + zip and unzip + binaries, but might also contain the GNU make utility + (gmake). + So this area is a bit of a grab bag, especially on Windows. + The default value depends on the platform and + Unix Commands being used. + On Linux the default will be + $(ALT_JDK_DEVTOOLS_PATH)/linux/bin, + on Solaris + $(ALT_JDK_DEVTOOLS_PATH)/{sparc,i386}/bin, + on Windows with MKS + %SYSTEMDRIVE%/UTILS, + and on Windows with CYGWIN + /usr/bin. +
    +
    ALT_DXSDK_PATH
    +
    + Windows Only: + The location of the + Microsoft DirectX 9 SDK. + The default will be to try and use the DirectX environment + variable DXSDK_DIR, + failing that, look in C:/DXSDK. +
    +
    ALT_FREETYPE_HEADERS_PATH
    +
    + The location of the FreeType header files. + See FreeType information for details. +
    +
    ALT_FREETYPE_LIB_PATH
    +
    + The location of the FreeType shared library. + See FreeType information for details. +
    +
    ALT_JDK_DEVTOOLS_PATH
    +
    + The default root location of the devtools. + The default value is + $(ALT_SLASH_JAVA)/devtools. +
    +
    ALT_JDK_IMPORT_PATH
    +
    + The location of a previously built JDK installation. + See Optional Import JDK for more information. +
    +
    ALT_MSDEVTOOLS_PATH
    +
    + Windows Only: + The location of the Microsoft Visual Studio .NET 2003 + tools 'bin' directory. + The default is usually derived from + ALT_COMPILER_PATH. +
    +
    ALT_MSVCR71_DLL_PATH
    +
    + Windows i586 only: + The location of the + MSVCR71.DLL. +
    +
    ALT_MSVCRT_DLL_PATH
    +
    + Windows Only: + The location of the + MSVCRT.DLL. +
    +
    ALT_OUTPUTDIR
    +
    + An override for specifying the (absolute) path of where the + build output is to go. + The default output directory will be build/platform. +
    +
    ALT_SLASHJAVA
    +
    + The default root location for many of the ALT path locations + of the following ALT variables. + The default value is + "/java" on Solaris and Linux, + "J:" on Windows. +
    +
    ALT_UNIXCCS_PATH
    +
    + Solaris only: + An override for specifying where the Unix CCS + command set are located. + The default location is /usr/ccs/bin +
    +
    ALT_UNIXCOMMAND_PATH
    +
    + An override for specifying where the + Unix command set are located. + The default location varies depending on the platform, + "%SYSTEMDRIVE%/MKSNT" or + $(ROOTDIR) on Windows with MKS, otherwise it's + "/bin" or /usr/bin. +
    +
    ALT_USRBIN_PATH
    +
    + An override for specifying where the + Unix /usr/bin commands are located. You usually do not need + to set this variable: the default location is /usr/bin) +
    +
    ANT_HOME
    +
    + The location of the Ant installation. + See Ant for more information. + You should always set ANT_HOME explicitly. +
    +
    ARCH_DATA_MODEL
    +
    The ARCH_DATA_MODEL variable + is used to specify whether the build is to generate 32-bit or 64-bit + binaries. + The Solaris build supports either 32-bit or 64-bit builds, but + Windows and Linux will support only one, depending on the specific + OS being used. + Normally, setting this variable is only necessary on Solaris. + Set ARCH_DATA_MODEL to 32 for generating 32-bit binaries, + or to 64 for generating 64-bit binaries. +
    +
    BUILD_NUMBER
    +
    + The build number for the build (e.g. "b27"). + The default value is "b00". +
    +
    MILESTONE
    +
    + The milestone name for the build (e.g."beta"). + The default value is "internal". +
    +
    PATH
    +
    Typically you want to set the PATH to include: +
      +
    • The location of the GNU make binary
    • +
    • The location of the Bootstrap JDK java + (see Bootstrap JDK)
    • +
    • The location of the C/C++ compilers + (see compilers)
    • +
    • The location or locations for the Unix command utilities + (e.g. /usr/bin)
    • +
    diff --git a/corba/.hgtags b/corba/.hgtags index 1c9eb9a6072..6792e20a86a 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -2,3 +2,7 @@ 5e61d5df62586474414d1058e9186441aa908f51 jdk7-b25 0043eb3d4e628f049ff80a8c223b5657136085e7 jdk7-b26 e84e9018bebbf3e5bafc5706e7882a15cb1c7d99 jdk7-b27 +27509b7d21ed783b3f6eb7b7612781c675a30c2f jdk7-b28 +8b71960f79ce0a6fb8ddfeec03f03d400a361747 jdk7-b29 +c0252adbb2abbfdd6c35595429ac6fbdd98e20ac jdk7-b30 +ef6af34d75a7b44e77083f1d4ee47631fa09d3b4 jdk7-b31 diff --git a/corba/make/common/shared/Compiler-sun.gmk b/corba/make/common/shared/Compiler-sun.gmk index 8ce54825b7c..730310201c6 100644 --- a/corba/make/common/shared/Compiler-sun.gmk +++ b/corba/make/common/shared/Compiler-sun.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -31,6 +31,9 @@ COMPILER_NAME=Sun Studio # Sun Studio Compiler settings specific to Solaris ifeq ($(PLATFORM), solaris) + # FIXUP: Change to SS12 when validated + #COMPILER_VERSION=SS12 + #REQUIRED_CC_VER=5.9 COMPILER_VERSION=SS11 REQUIRED_CC_VER=5.8 CC = $(COMPILER_PATH)cc @@ -51,8 +54,8 @@ endif # Sun Studio Compiler settings specific to Linux ifeq ($(PLATFORM), linux) # This has not been tested - COMPILER_VERSION=SS11 - REQUIRED_CC_VER=5.8 + COMPILER_VERSION=SS12 + REQUIRED_CC_VER=5.9 CC = $(COMPILER_PATH)cc CPP = $(COMPILER_PATH)cc -E CXX = $(COMPILER_PATH)CC diff --git a/corba/make/common/shared/Defs.gmk b/corba/make/common/shared/Defs.gmk index c7832863e34..5af64523ff7 100644 --- a/corba/make/common/shared/Defs.gmk +++ b/corba/make/common/shared/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/corba/make/jprt.config b/corba/make/jprt.config index e511068ef88..86e6499a156 100644 --- a/corba/make/jprt.config +++ b/corba/make/jprt.config @@ -1,7 +1,7 @@ #!echo "This is not a shell script" ############################################################################# # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -123,9 +123,15 @@ if [ "${osname}" = SunOS ] ; then solaris_arch=i386 fi - # Get the SS11 compilers into path (make sure it matches ALT setting) - compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/SS11/bin - compiler_name=SS11 + # Get the compilers into path (make sure it matches ALT setting) + if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then + compiler_name=${JPRT_SOLARIS_COMPILER_NAME} + else + # FIXUP: Change to SS12 when validated + #compiler_name=SS12 + compiler_name=SS11 + fi + compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin ALT_COMPILER_PATH="${compiler_path}" export ALT_COMPILER_PATH dirMustExist "${compiler_path}" ALT_COMPILER_PATH diff --git a/corba/src/share/classes/org/omg/CORBA/ir.idl b/corba/src/share/classes/org/omg/CORBA/ir.idl index 5ea8a1979dd..d7312f993a1 100644 --- a/corba/src/share/classes/org/omg/CORBA/ir.idl +++ b/corba/src/share/classes/org/omg/CORBA/ir.idl @@ -1,5 +1,5 @@ /* - * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl b/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl index b0149c3e256..2d21393963e 100644 --- a/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl +++ b/corba/src/share/classes/org/omg/DynamicAny/DynamicAny.idl @@ -1,5 +1,5 @@ /* - * Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/.hgignore b/hotspot/.hgignore index 24a19191195..2c5fe5bc135 100644 --- a/hotspot/.hgignore +++ b/hotspot/.hgignore @@ -2,3 +2,6 @@ ^dist/ ^nbproject/private/ ^src/share/tools/hsdis/bin/ +^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/ +^src/share/tools/IdealGraphVisualizer/build/ +^src/share/tools/IdealGraphVisualizer/dist/ diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 5d8c9da580d..b23c6ac9012 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -2,3 +2,7 @@ a61af66fc99eb5ec9d50c05b0c599757b1289ceb jdk7-b24 7836be3e92d0a4f9ee7566f602c91f5609534e66 jdk7-b25 ad0b851458ff9d1d490ed2d79bb84f75a9fdb753 jdk7-b26 e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27 +c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28 +4f91c08b3e4498213a9c5a24898f7d9c38cf86fb jdk7-b29 +d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30 +9c2ecc2ffb125f14fab3857fe7689598956348a0 jdk7-b31 diff --git a/hotspot/agent/make/Makefile b/hotspot/agent/make/Makefile index 0cde8d5754b..ae10cb3cb97 100644 --- a/hotspot/agent/make/Makefile +++ b/hotspot/agent/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -246,16 +246,16 @@ SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties all: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - @javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - @rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer + @${JDK_HOME}/bin/javac -source 1.4 -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + @${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql allprof: filelist @mkdir -p $(OUTPUT_DIR) @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - @javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - @rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer + @${JDK_HOME}/bin/javac -source 1.4 -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist + @${JDK_HOME}/bin/rmic -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/agent/src/os/linux/ps_core.c index 0693ffce4bb..3562f2d31f6 100644 --- a/hotspot/agent/src/os/linux/ps_core.c +++ b/hotspot/agent/src/os/linux/ps_core.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index 9b226eaf00b..d9c297e5fa3 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java index 50e81f34789..bb3dba9ea33 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java index fb583936574..8a2ef3c84c2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -398,7 +398,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { frame.getContentPane().add(desktop); GraphicsUtilities.reshapeToAspectRatio(frame, 4.0f/3.0f, 0.75f, Toolkit.getDefaultToolkit().getScreenSize()); GraphicsUtilities.centerInContainer(frame, Toolkit.getDefaultToolkit().getScreenSize()); - frame.show(); + frame.setVisible(true); Runtime.getRuntime().addShutdownHook(new java.lang.Thread() { public void run() { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java index 21bc43d77bf..5e56a0e3f36 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java index 9c8dce59600..9f462c67455 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -148,7 +148,7 @@ public class SALauncherLoader extends URLClassLoader { } try { - return file.toURL(); + return file.toURI().toURL(); } catch (MalformedURLException mue) { throw new InternalError(mue.getMessage()); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java index f86c8225f55..e34c975f775 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -47,6 +47,6 @@ public class Main { 4.0f/3.0f, 0.85f, Toolkit.getDefaultToolkit().getScreenSize()); GraphicsUtilities.centerInContainer(frame, Toolkit.getDefaultToolkit().getScreenSize()); - frame.show(); + frame.setVisible(true); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapSet.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapSet.java index 3d9c6bbe5d8..aa99e9a444e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapSet.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java index 3b7e66b1777..ee382979626 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java index 612223667e4..98227008c58 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java index 66996c4f9a7..1800dafc25c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java index 3e85bb7635d..acbb90d4b66 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java index 4bef7b0daae..7b4ca75f431 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java index c478d33d088..679036cdac0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java index 9498c2e25fb..87641775ac5 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java index 3dd6e513ead..3f16b1bb5d8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java index 4099844799b..4f4322a1c6c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java index e333b139fcd..25d786ab8f9 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java index 5e70d16d975..ab615fe7c7c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java index 289f9ca8f2b..2eae1e0e77a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxAddress.java index d0c039e41ba..e91e9240a96 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebugger.java index f73700c8e16..e34c1c12aa0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebuggerLocal.java index 1501f2b07c5..13cda991a73 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java index 5a3b4170859..0004b99d5d2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java index 64577da7acd..34da90a4df2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java index b3a062e82a8..f69c582db19 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java index 7f4159f4a47..fadd9ef1de4 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java index 17c75774dfe..843693a4822 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java index e17d2b422be..a792e9c6bc5 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java index 5b89e610595..662bbe35b41 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java index 287f7cbbc2a..6575c2faf6d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java index 6850195d4eb..179fc1e9d64 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java index 4be718ef6e2..c1464f3d98c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java index 922890fb9ea..cdc5c713619 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Address.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Address.java index 0afbcacfd63..d6400ebae7a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Address.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Address.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Debugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Debugger.java index 3c2558200bc..0b5d72c0709 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Debugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32Debugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32DebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32DebuggerLocal.java index 0380eb3b529..757ad00b350 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32DebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/Win32DebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java index 4a0d7f21cdb..89be5232e2f 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java index 03654377c6a..1ed40d26982 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java index 687f45a4ebd..09a3685b382 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java index 4483cf1b38b..02c1cff9a0e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -78,7 +78,7 @@ class SAJDIClassLoader extends URLClassLoader { this(parent); this.classPathSet = true; try { - addURL(new File(classPath).toURL()); + addURL(new File(classPath).toURI().toURL()); } catch(MalformedURLException mue) { throw new RuntimeException(mue); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java new file mode 100644 index 00000000000..72f3006ea67 --- /dev/null +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/BinaryTreeDictionary.java @@ -0,0 +1,59 @@ +/* + * @(#)BinaryTreeDictionary.java + * Copyright 2000-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. + * + * 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.jvm.hotspot.memory; + +import java.util.*; +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.types.*; +import sun.jvm.hotspot.runtime.*; + +public class BinaryTreeDictionary extends VMObject { + static { + VM.registerVMInitializedObserver(new Observer() { + public void update(Observable o, Object data) { + initialize(VM.getVM().getTypeDataBase()); + } + }); + } + + private static synchronized void initialize(TypeDataBase db) { + Type type = db.lookupType("BinaryTreeDictionary"); + totalSizeField = type.getCIntegerField("_totalSize"); + } + + // Fields + private static CIntegerField totalSizeField; + + // Accessors + public long size() { + return totalSizeField.getValue(addr); + } + + // Constructor + public BinaryTreeDictionary(Address addr) { + super(addr); + } +} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java index c1c701f223f..97ec593e187 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -35,6 +35,20 @@ import sun.jvm.hotspot.utilities.*; public class CompactibleFreeListSpace extends CompactibleSpace { private static AddressField collectorField; + // for free size, three fields + // FreeBlockDictionary* _dictionary; // ptr to dictionary for large size blocks + // FreeList _indexedFreeList[IndexSetSize]; // indexed array for small size blocks + // LinearAllocBlock _smallLinearAllocBlock; // small linear alloc in TLAB + private static AddressField indexedFreeListField; + private static AddressField dictionaryField; + private static long smallLinearAllocBlockFieldOffset; + private static long indexedFreeListSizeOf; + + private int heapWordSize; // 4 for 32bit, 8 for 64 bits + private int IndexSetStart; // for small indexed list + private int IndexSetSize; + private int IndexSetStride; + static { VM.registerVMInitializedObserver(new Observer() { public void update(Observable o, Object data) { @@ -51,10 +65,26 @@ public class CompactibleFreeListSpace extends CompactibleSpace { Type type = db.lookupType("CompactibleFreeListSpace"); collectorField = type.getAddressField("_collector"); + collectorField = type.getAddressField("_collector"); + dictionaryField = type.getAddressField("_dictionary"); + indexedFreeListField = type.getAddressField("_indexedFreeList[0]"); + smallLinearAllocBlockFieldOffset = type.getField("_smallLinearAllocBlock").getOffset(); } public CompactibleFreeListSpace(Address addr) { super(addr); + if ( VM.getVM().isLP64() ) { + heapWordSize = 8; + IndexSetStart = 1; + IndexSetStride = 1; + } + else { + heapWordSize = 4; + IndexSetStart = 2; + IndexSetStride = 2; + } + + IndexSetSize = 257; } // Accessing block offset table @@ -62,9 +92,17 @@ public class CompactibleFreeListSpace extends CompactibleSpace { return (CMSCollector) VMObjectFactory.newObject( CMSCollector.class, collectorField.getValue(addr)); - } + } + + public long free0() { + return capacity() - used0(); + } public long used() { + return capacity() - free(); + } + + public long used0() { List regions = getLiveRegions(); long usedSize = 0L; for (Iterator itr = regions.iterator(); itr.hasNext();) { @@ -75,11 +113,41 @@ public class CompactibleFreeListSpace extends CompactibleSpace { } public long free() { - return capacity() - used(); - } + // small chunks + long size = 0; + Address cur = addr.addOffsetTo( indexedFreeListField.getOffset() ); + cur = cur.addOffsetTo(IndexSetStart*FreeList.sizeOf()); + for (int i=IndexSetStart; i> cmsShift, cmsMask) & 0x1L) == 0x1L; + } + public long getSize() { return (long)(value() >> sizeShift); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java index 7ef6d8d820c..027c57ea5fe 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java index 0aae96fcf42..23e533348c3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -316,6 +316,14 @@ public class ObjectHeap { iterateLiveRegions(liveRegions, visitor, null); } + public boolean isValidMethod(OopHandle handle) { + OopHandle klass = Oop.getKlassForOopHandle(handle); + if (klass != null && klass.equals(methodKlassHandle)) { + return true; + } + return false; + } + // Creates an instance from the Oop hierarchy based based on the handle public Oop newOop(OopHandle handle) { // The only known way to detect the right type of an oop is @@ -375,8 +383,10 @@ public class ObjectHeap { } } - System.err.println("Unknown oop at " + handle); - System.err.println("Oop's klass is " + klass); + if (DEBUG) { + System.err.println("Unknown oop at " + handle); + System.err.println("Oop's klass is " + klass); + } throw new UnknownOopException(); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java index f263d49ffc3..58312c9c58e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java index 65117314f7e..d9518a3e788 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java index 2bdf7eab706..cfaed93567e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java index 0574343d207..d46c4dfe75e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java index 1613da85bb8..276753f7067 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -274,10 +274,10 @@ public class OopUtilities implements /* imports */ JVMTIThreadState { // hc_klass is a HotSpot magic field and hence we can't // find it from InstanceKlass for java.lang.Class. TypeDataBase db = VM.getVM().getTypeDataBase(); - int hcKlassOffset = (int) Oop.getHeaderSize(); + int hcKlassOffset = (int) Instance.getHeaderSize(); try { hcKlassOffset += (db.lookupIntConstant("java_lang_Class::hc_klass_offset").intValue() * - db.getAddressSize()); + VM.getVM().getHeapOopSize()); } catch (RuntimeException re) { // ignore, currently java_lang_Class::hc_klass_offset is zero } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java index 9bb12a45701..7dc622b2d2b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java index f9c55318fb9..b8076837473 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java index ad07426313b..ec3077ae02d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java index 43ad81d44e5..204156c3ff8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java @@ -215,11 +215,11 @@ public class JavaThread extends Thread { if (f == null) return null; boolean imprecise = true; if (f.isInterpretedFrame() && !f.isInterpretedFrameValid()) { - if (DEBUG) { - System.out.println("Correcting for invalid interpreter frame"); - } - f = f.sender(regMap); - imprecise = false; + if (DEBUG) { + System.out.println("Correcting for invalid interpreter frame"); + } + f = f.sender(regMap); + imprecise = false; } VFrame vf = VFrame.newVFrame(f, regMap, this, true, imprecise); if (vf == null) { @@ -228,10 +228,7 @@ public class JavaThread extends Thread { } return null; } - if (vf.isJavaFrame()) { - return (JavaVFrame) vf; - } - return (JavaVFrame) vf.javaSender(); + return vf.isJavaFrame() ? (JavaVFrame)vf : vf.javaSender(); } /** In this system, a JavaThread is the top-level factory for a diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index c6ab99073e7..e1ed4b97f2b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java index 7d42c211d15..93b5acf067d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java @@ -121,6 +121,13 @@ public class SolarisSPARCJavaThreadPDAccess implements JavaThreadPDAccess { } public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { + + // If java stack is walkable then both last_Java_sp and last_Java_pc are + // non null and we can start stack walk from this frame. + if (thread.getLastJavaSP() != null && thread.getLastJavaPC() != null) { + return new SPARCFrame(SPARCFrame.biasSP(thread.getLastJavaSP()), thread.getLastJavaPC()); + } + ThreadProxy t = getThreadProxy(addr); SPARCThreadContext context = (SPARCThreadContext) t.getContext(); // For now, let's see what happens if we do a similar thing to diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java index 015329117dc..b9c07b6bc4e 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java @@ -422,6 +422,13 @@ public class SPARCFrame extends Frame { if (getFP().addOffsetTo(INTERPRETER_FRAME_VM_LOCAL_WORDS * VM.getVM().getAddressSize()).lessThan(getSP())) { return false; } + + OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0); + + if (VM.getVM().getObjectHeap().isValidMethod(methodHandle) == false) { + return false; + } + // These are hacks to keep us out of trouble. // The problem with these is that they mask other problems if (getFP().lessThanOrEqual(getSP())) { // this attempts to deal with unsigned comparison above @@ -433,9 +440,18 @@ public class SPARCFrame extends Frame { // FIXME: this is not atomic with respect to GC and is unsuitable // for use in a non-debugging, or reflective, system. Need to // figure out how to express this. - if (addressOfInterpreterFrameBCX().getAddressAt(0) == null) { - return false; // BCP not yet set up + Address bcx = addressOfInterpreterFrameBCX().getAddressAt(0); + + Method method; + try { + method = (Method) VM.getVM().getObjectHeap().newOop(methodHandle); + } catch (UnknownOopException ex) { + return false; } + int bci = bcpToBci(bcx, method); + //validate bci + if (bci < 0) return false; + return true; } @@ -471,7 +487,7 @@ public class SPARCFrame extends Frame { // will update it accordingly map.setIncludeArgumentOops(false); - if (cb == null && isEntryFrame()) { + if (isEntryFrame()) { return senderForEntryFrame(map); } @@ -539,7 +555,6 @@ public class SPARCFrame extends Frame { int SP_OFFSET_IN_GREGSET = 17; raw_sp = fp.getAddressAt(VM.getVM().getAddressSize() * SP_OFFSET_IN_GREGSET); Address pc = fp.getAddressAt(VM.getVM().getAddressSize() * PC_OFFSET_IN_GREGSET); - // System.out.println(" next frame's SP: " + sp + " PC: " + pc); return new SPARCFrame(raw_sp, pc); } } @@ -562,10 +577,8 @@ public class SPARCFrame extends Frame { // sender's _interpreter_sp_adjustment field. if (VM.getVM().getInterpreter().contains(pc)) { isInterpreted = true; - if (VM.getVM().isClientCompiler()) { - map.makeIntegerRegsUnsaved(); - map.shiftWindow(sp, youngerSP); - } + map.makeIntegerRegsUnsaved(); + map.shiftWindow(sp, youngerSP); } else { // Find a CodeBlob containing this frame's pc or elide the lookup and use the // supplied blob which is already known to be associated with this frame. diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java index 9bab664f274..a928d56905a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java @@ -87,12 +87,13 @@ public class PStack extends Tool { while (f != null) { ClosestSymbol sym = f.closestSymbolToPC(); Address pc = f.pc(); + out.print(pc + "\t"); if (sym != null) { String name = sym.getName(); if (cdbgCanDemangle) { name = cdbg.demangle(name); } - out.print(pc + "\t" + name); + out.print(name); long diff = sym.getOffset(); if (diff != 0L) { out.print(" + 0x" + Long.toHexString(diff)); @@ -120,7 +121,6 @@ public class PStack extends Tool { // look for known code blobs CodeCache c = VM.getVM().getCodeCache(); if (c.contains(pc)) { - out.print(pc + "\t"); CodeBlob cb = c.findBlobUnsafe(pc); if (cb.isNMethod()) { names = getJavaNames(th, f.localVariableBase()); @@ -144,18 +144,18 @@ public class PStack extends Tool { out.println(""); } } else { - printUnknown(out,pc); + printUnknown(out); } } // print java frames, if any if (names != null && names.length != 0) { // print java frame(s) for (int i = 0; i < names.length; i++) { - out.println(pc + "\t" + names[i]); + out.println(names[i]); } } } else { - printUnknown(out,pc); + printUnknown(out); } } f = f.sender(); @@ -220,8 +220,8 @@ public class PStack extends Tool { } } - private void printUnknown(PrintStream out, Address pc) { - out.println(pc + "\t????????"); + private void printUnknown(PrintStream out) { + out.println("\t????????"); } private String[] getJavaNames(ThreadProxy th, Address fp) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java index bfda1f18640..a4b98adaae2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java index b565d326d94..1e463987672 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java index 10e2b7aa0aa..ecc46f1d3ff 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java index 77717bedcda..c4388c94297 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java index 1886a4c5324..3b85996b472 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java index 112ff722cb2..f72bb7ba635 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java index 5db97d60177..f50fb03c16f 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java index 02bb9543842..c76fa142e93 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -648,6 +648,6 @@ public class AnnotatedMemoryPanel extends JPanel { System.exit(0); } }); - frame.show(); + frame.setVisible(true); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java index e340a78a94f..26167e67f9d 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -220,7 +220,7 @@ public class CommandProcessorPanel extends JPanel { } }); frame.setSize(500, 500); - frame.show(); + frame.setVisible(true); panel.requestFocus(); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java index 7317fa0955c..c037fc1bf38 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -226,7 +226,7 @@ public class DebuggerConsolePanel extends JPanel { } }); frame.setSize(500, 500); - frame.show(); + frame.setVisible(true); panel.requestFocus(); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java index a3eae3bca8d..5dec6019ab0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java index 073afd6e6a7..7a8cfb6876b 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -424,7 +424,7 @@ public class HighPrecisionJScrollBar extends JScrollBar { } }); frame.getContentPane().add(hpsb); - frame.show(); + frame.setVisible(true); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java index 70cece15b4f..81d02573149 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -43,7 +43,7 @@ public class JFrameWrapper implements FrameWrapper { public void setVisible(boolean visible) { frame.setVisible(visible); } public void setSize(int x, int y) { frame.setSize(x, y); } public void pack() { frame.pack(); } - public void show() { frame.show(); } + public void show() { frame.setVisible(true); } public void dispose() { frame.dispose(); } public void setBackground(Color color) { frame.setBackground(color); } public void setResizable(boolean resizable) { frame.setResizable(resizable); } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java index 6d66bb77d84..d9b8f5bbced 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java index 42b0c94da9e..1d3fff4abb2 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -477,9 +477,9 @@ public class JTreeTable extends JTable { static class TreeTableTextField extends JTextField { public int offset; - public void reshape(int x, int y, int w, int h) { + public void setBounds(int x, int y, int w, int h) { int newX = Math.max(x, offset); - super.reshape(newX, y, w - (newX - x), h); + super.setBounds(newX, y, w - (newX - x), h); } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java index 0da5005f604..31880e8eab7 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 16226721865..bcd4f42ff94 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java index f5ca60a8e5c..3fde2fd3560 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java index 2d6957f5812..255a98f6f08 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index 2fc73534b4e..bd2744180ce 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index 056d90c4846..5e94726b3f3 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -228,6 +228,7 @@ endif # Required make macro settings for all platforms MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR) +MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR) MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR) MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE) MAKE_ARGS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) diff --git a/hotspot/make/hotspot_distro b/hotspot/make/hotspot_distro index 9b111a2b3ec..bae47300e58 100644 --- a/hotspot/make/hotspot_distro +++ b/hotspot/make/hotspot_distro @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006-2008 Sun Microsystems, Inc. All rights reserved. # SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. # diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index c4478727175..b30abbb8928 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -33,7 +33,7 @@ # Don't put quotes (fail windows build). HOTSPOT_VM_COPYRIGHT=Copyright 2008 -HS_MAJOR_VER=13 +HS_MAJOR_VER=14 HS_MINOR_VER=0 HS_BUILD_NUMBER=01 diff --git a/hotspot/make/jprt.config b/hotspot/make/jprt.config index 2c1f0dce2f4..dd9940763c2 100644 --- a/hotspot/make/jprt.config +++ b/hotspot/make/jprt.config @@ -1,6 +1,6 @@ #!echo "This is not a shell script" # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -68,8 +68,23 @@ if [ "${osname}" = SunOS ] ; then solaris_arch=i386 fi - # Get the SS11 compilers into path (make sure it matches ALT setting) - compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/SS11/bin + if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then + compiler_name=${JPRT_SOLARIS_COMPILER_NAME} + else + if [ "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6" -o \ + "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6u10" -o \ + "${JPRT_JOB_PRODUCT_RELEASE}" = "jdk6perf" ] ; then + # All jdk6 builds use SS11 + compiler_name=SS11 + else + # FIXUP: Change to SS12 once it has been validated. + #compiler_name=SS12 + compiler_name=SS11 + fi + fi + + # Get into path (make sure it matches ALT setting) + compiler_path=${slashjava}/devtools/${solaris_arch}/SUNWspro/${compiler_name}/bin dirMustExist "${compiler_path}" COMPILER_PATH path4sdk=${compiler_path} diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index fd5a75de042..459867eae08 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -24,209 +24,274 @@ # Properties for jprt -JPRT.tools.default.release=jdk1.7.0 +# All build result bundles are full jdks, so the 64bit testing does not +# need the 32bit sibling bundle installed. +# Note: If the hotspot/make/Makefile changed to only bundle the 64bit files +# when bundling 64bit, and stripped out the 64bit files from any 32bit +# bundles, then this setting would be need to be "true". -# Build result bundles are not partial builds| but include everything -JPRT.need.sibling.build=false +jprt.need.sibling.build=false -# Directories needed to build -JPRT.bundle.src.dirs=make src agent -JPRT.bundle.exclude.src.dirs=build +# At submit time, the release supplied will be in jprt.submit.release +# and will be one of the official release names defined in jprt. +# jprt supports property value expansion using ${property.name} syntax. +# This tells jprt what default release we want to build -# Standard list of JPRT build targets for this workspace -JPRT.build.targets= \ - solaris_sparc_5.10-{product|fastdebug|debug}, \ - solaris_sparcv9_5.10-{product|fastdebug|debug}, \ - solaris_i586_5.10-{product|fastdebug|debug}, \ - solaris_x64_5.10-{product|fastdebug|debug}, \ - linux_i586-{product|fastdebug|debug}, \ - linux_x64-{product|fastdebug}, \ - windows_i586-{product|fastdebug|debug}, \ - windows_x64-{product|fastdebug|debug} +jprt.tools.default.release=${jprt.submit.release} -# Standard list of JPRT test targets for this workspace -JPRT.test.targets = \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jvm98, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-jvm98, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark, \ - solaris_i586_5.10-{product|fastdebug}-{c1|c2}-jvm98, \ - solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark, \ - solaris_x64_5.10-{product|fastdebug}-c2-jvm98, \ - solaris_x64_5.10-{product|fastdebug}-c2-scimark, \ - linux_i586-{product|fastdebug}-{c1|c2}-jvm98, \ - linux_i586-{product|fastdebug}-{c1|c2}-scimark, \ - linux_x64-{product|fastdebug}-c2-jvm98, \ - linux_x64-{product|fastdebug}-c2-scimark, \ - windows_i586-{product|fastdebug}-{c1|c2}-jvm98, \ - windows_i586-{product|fastdebug}-{c1|c2}-scimark, \ - windows_x64-{product|fastdebug}-c2-jvm98, \ - windows_x64-{product|fastdebug}-c2-scimark, \ - solaris_sparc_5.10-product-{c1|c2}-runThese, \ - solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp, \ - solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp_2, \ - solaris_sparc_5.10-product-{c1|c2}-runThese_Xcomp_3, \ - solaris_sparc_5.10-fastdebug-c1-runThese_Xshare, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_default, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_default_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCBasher_CMS_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_default, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-GCOld_CMS, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_default, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-jbb_CMS, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark_2, \ - solaris_sparc_5.10-{product|fastdebug}-{c1|c2}-scimark_3, \ - solaris_sparcv9_5.10-product-c2-runThese, \ - solaris_sparcv9_5.10-product-c2-runThese_Xcomp, \ - solaris_sparcv9_5.10-product-c2-runThese_Xcomp_2, \ - solaris_sparcv9_5.10-product-c2-runThese_Xcomp_3, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_default, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_SerialGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParNewGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_CMS, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_default_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_SerialGC_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCBasher_CMS_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_default, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_SerialGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_ParallelGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_ParNewGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-GCOld_CMS, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_default, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_SerialGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_ParallelGC, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-jbb_CMS, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark_2, \ - solaris_sparcv9_5.10-{product|fastdebug}-c2-scimark_3, \ - solaris_x64-product-c2-runThese, \ - solaris_x64-product-c2-runThese_Xcomp, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_default, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_CMS, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_default_2, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_SerialGC_2, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \ - solaris_x64-{product|fastdebug}-c2-GCBasher_CMS_2, \ - solaris_x64-{product|fastdebug}-c2-GCOld_default, \ - solaris_x64-{product|fastdebug}-c2-GCOld_SerialGC, \ - solaris_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \ - solaris_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \ - solaris_x64-{product|fastdebug}-c2-GCOld_CMS, \ - solaris_x64-{product|fastdebug}-c2-jbb_default, \ - solaris_x64-{product|fastdebug}-c2-jbb_SerialGC, \ - solaris_x64-{product|fastdebug}-c2-jbb_ParallelGC, \ - solaris_x64-{product|fastdebug}-c2-jbb_CMS, \ - solaris_i586_5.10-product-{c1|c2}-runThese_Xcomp, \ - solaris_i586_5.10-product-c2-runThese_Xcomp_2, \ - solaris_i586_5.10-fastdebug-c1-runThese_Xcomp_2, \ - solaris_i586_5.10-fastdebug-c1-runThese_Xshare, \ - solaris_i586_5.10-product-c1-GCBasher_default, \ - solaris_i586_5.10-product-c1-GCBasher_SerialGC, \ - solaris_i586_5.10-product-c1-GCBasher_ParallelGC, \ - solaris_i586_5.10-product-c1-GCBasher_ParNewGC, \ - solaris_i586_5.10-product-c1-GCBasher_CMS, \ - solaris_i586_5.10-fastdebug-c2-GCBasher_default, \ - solaris_i586_5.10-fastdebug-c2-GCBasher_SerialGC, \ - solaris_i586_5.10-fastdebug-c2-GCBasher_ParallelGC, \ - solaris_i586_5.10-fastdebug-c2-GCBasher_ParNewGC, \ - solaris_i586_5.10-fastdebug-c2-GCBasher_CMS, \ - solaris_i586_5.10-product-c1-GCOld_default, \ - solaris_i586_5.10-product-c1-GCOld_SerialGC, \ - solaris_i586_5.10-product-c1-GCOld_ParallelGC, \ - solaris_i586_5.10-product-c1-GCOld_ParNewGC, \ - solaris_i586_5.10-product-c1-GCOld_CMS, \ - solaris_i586_5.10-fastdebug-c2-jbb_default, \ - solaris_i586_5.10-fastdebug-c2-jbb_ParallelGC, \ - solaris_i586_5.10-fastdebug-c2-jbb_CMS, \ - solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark_2, \ - solaris_i586_5.10-{product|fastdebug}-{c1|c2}-scimark_3, \ - linux_i586-product-c1-runThese_Xcomp, \ - linux_i586-product-c1-runThese_Xcomp_2, \ - linux_i586-product-c1-runThese_Xcomp_3, \ - linux_i586-fastdebug-c1-runThese_Xshare, \ - linux_i586-fastdebug-c2-runThese_Xcomp, \ - linux_i586-fastdebug-c2-runThese_Xcomp_2, \ - linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_default, \ - linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ - linux_i586-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - linux_i586-product-{c1|c2}-GCOld_default, \ - linux_i586-product-{c1|c2}-GCOld_SerialGC, \ - linux_i586-product-{c1|c2}-GCOld_ParallelGC, \ - linux_i586-product-{c1|c2}-GCOld_ParNewGC, \ - linux_i586-product-{c1|c2}-GCOld_CMS, \ - linux_i586-{product|fastdebug}-c1-jbb_default, \ - linux_i586-{product|fastdebug}-c1-jbb_ParallelGC, \ - linux_i586-{product|fastdebug}-c1-jbb_CMS, \ - linux_i586-{product|fastdebug}-c2-scimark_2, \ - linux_i586-{product|fastdebug}-c2-scimark_3, \ - linux_x64-{product|fastdebug}-c2-GCBasher_default, \ - linux_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \ - linux_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - linux_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \ - linux_x64-{product|fastdebug}-c2-GCBasher_CMS, \ - linux_x64-{product|fastdebug}-c2-GCOld_default, \ - linux_x64-{product|fastdebug}-c2-GCOld_SerialGC, \ - linux_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \ - linux_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \ - linux_x64-{product|fastdebug}-c2-GCOld_CMS, \ - linux_x64-{product|fastdebug}-c2-jbb_default, \ - linux_x64-{product|fastdebug}-c2-jbb_ParallelGC, \ - linux_x64-{product|fastdebug}-c2-scimark_2, \ - linux_x64-{product|fastdebug}-c2-scimark_3, \ - windows_i586-product-{c1|c2}-runThese, \ - windows_i586-product-{c1|c2}-runThese_Xcomp, \ - windows_i586-fastdebug-c1-runThese_Xshare, \ - windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_default, \ - windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ - windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ - windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ - windows_i586-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ - windows_i586-product-{c1|c2}-GCOld_default, \ - windows_i586-product-{c1|c2}-GCOld_SerialGC, \ - windows_i586-product-{c1|c2}-GCOld_ParallelGC, \ - windows_i586-product-{c1|c2}-GCOld_ParNewGC, \ - windows_i586-product-{c1|c2}-GCOld_CMS, \ - windows_i586-{product|fastdebug}-{c1|c2}-jbb_default, \ - windows_i586-product-{c1|c2}-jbb_ParallelGC, \ - windows_i586-product-{c1|c2}-jbb_CMS, \ - windows_i586-product-{c1|c2}-scimark_2, \ - windows_i586-product-{c1|c2}-scimark_3, \ - windows_x64-product-c2-runThese, \ - windows_x64-product-c2-runThese_Xcomp, \ - windows_x64-{product|fastdebug}-c2-GCBasher_default, \ - windows_x64-{product|fastdebug}-c2-GCBasher_SerialGC, \ - windows_x64-{product|fastdebug}-c2-GCBasher_ParallelGC, \ - windows_x64-{product|fastdebug}-c2-GCBasher_ParNewGC, \ - windows_x64-{product|fastdebug}-c2-GCBasher_CMS, \ - windows_x64-{product|fastdebug}-c2-GCOld_default, \ - windows_x64-{product|fastdebug}-c2-GCOld_SerialGC, \ - windows_x64-{product|fastdebug}-c2-GCOld_ParallelGC, \ - windows_x64-{product|fastdebug}-c2-GCOld_ParNewGC, \ - windows_x64-{product|fastdebug}-c2-GCOld_CMS, \ - windows_x64-{product|fastdebug}-c2-jbb_default, \ - windows_x64-product-c2-jbb_CMS, \ - windows_x64-product-c2-jbb_ParallelGC, \ - windows_x64-{product|fastdebug}-c2-scimark_2, \ - windows_x64-{product|fastdebug}-c2-scimark_3 +# Define the Solaris platforms we want for the various releases + +jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 +jprt.my.solaris.sparc.jdk6=solaris_sparc_5.8 +jprt.my.solaris.sparc.jdk6perf=solaris_sparc_5.8 +jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8 +jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} + +jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 +jprt.my.solaris.sparcv9.jdk6=solaris_sparcv9_5.8 +jprt.my.solaris.sparcv9.jdk6perf=solaris_sparcv9_5.8 +jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8 +jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} + +jprt.my.solaris.i586.jdk7=solaris_i586_5.10 +jprt.my.solaris.i586.jdk6=solaris_i586_5.8 +jprt.my.solaris.i586.jdk6perf=solaris_i586_5.8 +jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8 +jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} + +jprt.my.solaris.x64.jdk7=solaris_x64_5.10 +jprt.my.solaris.x64.jdk6=solaris_x64_5.10 +jprt.my.solaris.x64.jdk6perf=solaris_x64_5.10 +jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10 +jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} + +jprt.my.linux.i586=linux_i586 +jprt.my.linux.x64=linux_x64 +jprt.my.windows.i586=windows_i586 +jprt.my.windows.x64=windows_x64 + +# Standard list of jprt build targets for this source tree + +jprt.build.targets= \ + ${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \ + ${jprt.my.solaris.i586}-{product|fastdebug|debug}, \ + ${jprt.my.solaris.x64}-{product|fastdebug|debug}, \ + ${jprt.my.linux.i586}-{product|fastdebug|debug}, \ + ${jprt.my.linux.x64}-{product|fastdebug}, \ + ${jprt.my.windows.i586}-{product|fastdebug|debug}, \ + ${jprt.my.windows.x64}-{product|fastdebug|debug} + +# Subset lists of test targets for this source tree + +jprt.my.solaris.sparc.test.targets= \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark, \ + ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese, \ + ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp, \ + ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp_2, \ + ${jprt.my.solaris.sparc}-product-{c1|c2}-runThese_Xcomp_3, \ + ${jprt.my.solaris.sparc}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_default, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_default_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCBasher_CMS_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_default, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_SerialGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParallelGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_ParNewGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-GCOld_CMS, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_default, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_SerialGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_ParallelGC, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-jbb_CMS, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark_2, \ + ${jprt.my.solaris.sparc}-{product|fastdebug}-{c1|c2}-scimark_3 + +jprt.my.solaris.sparcv9.test.targets= \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp_2, \ + ${jprt.my.solaris.sparcv9}-product-c2-runThese_Xcomp_3, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_default_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_SerialGC_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCBasher_CMS_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_default, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_SerialGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParallelGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_ParNewGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-GCOld_CMS, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_SerialGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_ParallelGC, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-jbb_CMS, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark_2, \ + ${jprt.my.solaris.sparcv9}-{product|fastdebug}-c2-scimark_3 + +jprt.my.solaris.x64.test.targets= \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-scimark, \ + ${jprt.my.solaris.x64}-product-c2-runThese, \ + ${jprt.my.solaris.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_default, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_default_2, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_SerialGC_2, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC_2, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC_2, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCBasher_CMS_2, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_default, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-GCOld_CMS, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_SerialGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ + ${jprt.my.solaris.x64}-{product|fastdebug}-c2-jbb_CMS + +jprt.my.solaris.i586.test.targets= \ + ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark, \ + ${jprt.my.solaris.i586}-product-{c1|c2}-runThese_Xcomp, \ + ${jprt.my.solaris.i586}-product-c2-runThese_Xcomp_2, \ + ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xcomp_2, \ + ${jprt.my.solaris.i586}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.solaris.i586}-product-c1-GCBasher_default, \ + ${jprt.my.solaris.i586}-product-c1-GCBasher_SerialGC, \ + ${jprt.my.solaris.i586}-product-c1-GCBasher_ParallelGC, \ + ${jprt.my.solaris.i586}-product-c1-GCBasher_ParNewGC, \ + ${jprt.my.solaris.i586}-product-c1-GCBasher_CMS, \ + ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_default, \ + ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_SerialGC, \ + ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParallelGC, \ + ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_ParNewGC, \ + ${jprt.my.solaris.i586}-fastdebug-c2-GCBasher_CMS, \ + ${jprt.my.solaris.i586}-product-c1-GCOld_default, \ + ${jprt.my.solaris.i586}-product-c1-GCOld_SerialGC, \ + ${jprt.my.solaris.i586}-product-c1-GCOld_ParallelGC, \ + ${jprt.my.solaris.i586}-product-c1-GCOld_ParNewGC, \ + ${jprt.my.solaris.i586}-product-c1-GCOld_CMS, \ + ${jprt.my.solaris.i586}-fastdebug-c2-jbb_default, \ + ${jprt.my.solaris.i586}-fastdebug-c2-jbb_ParallelGC, \ + ${jprt.my.solaris.i586}-fastdebug-c2-jbb_CMS, \ + ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_2, \ + ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_3 + +jprt.my.linux.i586.test.targets = \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \ + ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \ + ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_2, \ + ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_3, \ + ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \ + ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp_2, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ + ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ + ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_default, \ + ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \ + ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \ + ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \ + ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_2, \ + ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_3 + +jprt.my.linux.x64.test.targets = \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_default, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_default, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-GCOld_CMS, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-jbb_ParallelGC, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark_2, \ + ${jprt.my.linux.x64}-{product|fastdebug}-c2-scimark_3 + +jprt.my.windows.i586.test.targets = \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jvm98, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-scimark, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese, \ + ${jprt.my.windows.i586}-product-{c1|c2}-runThese_Xcomp, \ + ${jprt.my.windows.i586}-fastdebug-c1-runThese_Xshare, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \ + ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_default, \ + ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_SerialGC, \ + ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParallelGC, \ + ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_ParNewGC, \ + ${jprt.my.windows.i586}-product-{c1|c2}-GCOld_CMS, \ + ${jprt.my.windows.i586}-{product|fastdebug}-{c1|c2}-jbb_default, \ + ${jprt.my.windows.i586}-product-{c1|c2}-jbb_ParallelGC, \ + ${jprt.my.windows.i586}-product-{c1|c2}-jbb_CMS, \ + ${jprt.my.windows.i586}-product-{c1|c2}-scimark_2, \ + ${jprt.my.windows.i586}-product-{c1|c2}-scimark_3 + +jprt.my.windows.x64.test.targets = \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-jvm98, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark, \ + ${jprt.my.windows.x64}-product-c2-runThese, \ + ${jprt.my.windows.x64}-product-c2-runThese_Xcomp, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_default, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_SerialGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParallelGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_ParNewGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCBasher_CMS, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_default, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_SerialGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParallelGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_ParNewGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-GCOld_CMS, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-jbb_default, \ + ${jprt.my.windows.x64}-product-c2-jbb_CMS, \ + ${jprt.my.windows.x64}-product-c2-jbb_ParallelGC, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark_2, \ + ${jprt.my.windows.x64}-{product|fastdebug}-c2-scimark_3 + +# The complete list of test targets for jprt + +jprt.test.targets = \ + ${jprt.my.solaris.sparc.test.targets}, \ + ${jprt.my.solaris.sparcv9.test.targets}, \ + ${jprt.my.solaris.i586.test.targets}, \ + ${jprt.my.solaris.x64.test.targets}, \ + ${jprt.my.linux.i586.test.targets}, \ + ${jprt.my.linux.x64.test.targets}, \ + ${jprt.my.windows.i586.test.targets}, \ + ${jprt.my.windows.x64.test.targets} diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile index 0e1ee65277a..21f2b3d7f5a 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/Queens.class b/hotspot/make/linux/Queens.class deleted file mode 100644 index d4582a04411..00000000000 Binary files a/hotspot/make/linux/Queens.class and /dev/null differ diff --git a/hotspot/make/linux/build.sh b/hotspot/make/linux/build.sh index 4239c6dcbe9..e317fddd4ae 100644 --- a/hotspot/make/linux/build.sh +++ b/hotspot/make/linux/build.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/adjust-mflags.sh b/hotspot/make/linux/makefiles/adjust-mflags.sh index 325e02d4fb1..169f86b6695 100644 --- a/hotspot/make/linux/makefiles/adjust-mflags.sh +++ b/hotspot/make/linux/makefiles/adjust-mflags.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index 16e48c84ed5..5349f5bd323 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/amd64.make b/hotspot/make/linux/makefiles/amd64.make index d69cce70b9a..fec7787ec64 100644 --- a/hotspot/make/linux/makefiles/amd64.make +++ b/hotspot/make/linux/makefiles/amd64.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make index 54a30d2ad0a..005ef37cd42 100644 --- a/hotspot/make/linux/makefiles/buildtree.make +++ b/hotspot/make/linux/makefiles/buildtree.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -328,18 +328,19 @@ JAVA_FLAG/64 = -d64 WRONG_DATA_MODE_MSG = \ echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." -test_gamma: $(BUILDTREE_MAKE) +test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java @echo Creating $@ ... $(QUIETLY) ( \ echo '#!/bin/sh'; \ $(BUILDTREE_COMMENT); \ echo '. ./env.sh'; \ echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \ - echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>1 > /dev/null"; \ + echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \ echo "then"; \ echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ echo "fi"; \ - echo 'CLASSPATH="$(GAMMADIR)/make/$(OS_FAMILY):$$CLASSPATH"'; \ + echo "rm -f Queens.class"; \ + echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ ) > $@ diff --git a/hotspot/make/linux/makefiles/compiler1.make b/hotspot/make/linux/makefiles/compiler1.make index 3573eccfac4..2fc8eb8a8e1 100644 --- a/hotspot/make/linux/makefiles/compiler1.make +++ b/hotspot/make/linux/makefiles/compiler1.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/compiler2.make b/hotspot/make/linux/makefiles/compiler2.make index 5ef2129ae5a..af1ec8476ca 100644 --- a/hotspot/make/linux/makefiles/compiler2.make +++ b/hotspot/make/linux/makefiles/compiler2.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/core.make b/hotspot/make/linux/makefiles/core.make index dbe2ee3a8e3..27b1aa7c36f 100644 --- a/hotspot/make/linux/makefiles/core.make +++ b/hotspot/make/linux/makefiles/core.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/cscope.make b/hotspot/make/linux/makefiles/cscope.make index 13ee5b65d0e..113d4f831af 100644 --- a/hotspot/make/linux/makefiles/cscope.make +++ b/hotspot/make/linux/makefiles/cscope.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/debug.make b/hotspot/make/linux/makefiles/debug.make index 75bb950891d..4743745228d 100644 --- a/hotspot/make/linux/makefiles/debug.make +++ b/hotspot/make/linux/makefiles/debug.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make index 7a06eb51276..2925654e677 100644 --- a/hotspot/make/linux/makefiles/defs.make +++ b/hotspot/make/linux/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/linux/makefiles/dtrace.make b/hotspot/make/linux/makefiles/dtrace.make index ee02f7a7d7c..a46a6758598 100644 --- a/hotspot/make/linux/makefiles/dtrace.make +++ b/hotspot/make/linux/makefiles/dtrace.make @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/fastdebug.make b/hotspot/make/linux/makefiles/fastdebug.make index c7ae47ac966..740b7584364 100644 --- a/hotspot/make/linux/makefiles/fastdebug.make +++ b/hotspot/make/linux/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index 66173061293..4a01c29c50e 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -50,14 +50,7 @@ PICFLAG = -fPIC VM_PICFLAG/LIBJVM = $(PICFLAG) VM_PICFLAG/AOUT = - -ifneq ($(BUILDARCH), i486) VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) -else -# PIC has significant overhead on x86, build nonpic VM for now. -# Link JVM at a "good" base location to avoid unnecessary .text patching. -JVM_BASE_ADDR = 0x06000000 -endif CFLAGS += $(VM_PICFLAG) CFLAGS += -fno-rtti @@ -91,8 +84,17 @@ endif # Compiler warnings are treated as errors WARNINGS_ARE_ERRORS = -Werror + # Except for a few acceptable ones +# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit +# conversions which might affect the values. To avoid that, we need to turn +# it off explicitly. +ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare +else ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare +endif + CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) # Special cases CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) diff --git a/hotspot/make/linux/makefiles/hp.make b/hotspot/make/linux/makefiles/hp.make index 5ead8272c16..c616d1a8dc8 100644 --- a/hotspot/make/linux/makefiles/hp.make +++ b/hotspot/make/linux/makefiles/hp.make @@ -1,5 +1,5 @@ # -# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/hp1.make b/hotspot/make/linux/makefiles/hp1.make index 7d62469a7f9..36e0d322f0d 100644 --- a/hotspot/make/linux/makefiles/hp1.make +++ b/hotspot/make/linux/makefiles/hp1.make @@ -1,5 +1,5 @@ # -# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/i486.make b/hotspot/make/linux/makefiles/i486.make index 63b67762f34..9dd0b4443fa 100644 --- a/hotspot/make/linux/makefiles/i486.make +++ b/hotspot/make/linux/makefiles/i486.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/ia64.make b/hotspot/make/linux/makefiles/ia64.make index b7c3aa27777..a647bc27e3a 100644 --- a/hotspot/make/linux/makefiles/ia64.make +++ b/hotspot/make/linux/makefiles/ia64.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make index 32d3c2a18d6..0d254bfe8f3 100644 --- a/hotspot/make/linux/makefiles/jsig.make +++ b/hotspot/make/linux/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/jvmg.make b/hotspot/make/linux/makefiles/jvmg.make index 9bf70b45e1b..4b09db64d21 100644 --- a/hotspot/make/linux/makefiles/jvmg.make +++ b/hotspot/make/linux/makefiles/jvmg.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/jvmti.make b/hotspot/make/linux/makefiles/jvmti.make index a73624857f8..70b33efef11 100644 --- a/hotspot/make/linux/makefiles/jvmti.make +++ b/hotspot/make/linux/makefiles/jvmti.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make index 7284ce3a09e..e367409f00e 100644 --- a/hotspot/make/linux/makefiles/launcher.make +++ b/hotspot/make/linux/makefiles/launcher.make @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/makedeps.make b/hotspot/make/linux/makefiles/makedeps.make index 7bb452ace33..ae1fa179078 100644 --- a/hotspot/make/linux/makefiles/makedeps.make +++ b/hotspot/make/linux/makefiles/makedeps.make @@ -1,5 +1,5 @@ # -# Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index da8e6798f28..63cce8b1535 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -3,7 +3,7 @@ # # -# Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-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 @@ -89,6 +89,7 @@ SUNWprivate_1.1 { JVM_FillInStackTrace; JVM_FindClassFromClass; JVM_FindClassFromClassLoader; + JVM_FindClassFromBootLoader; JVM_FindLibraryEntry; JVM_FindLoadedClass; JVM_FindPrimitiveClass; diff --git a/hotspot/make/linux/makefiles/mapfile-vers-jsig b/hotspot/make/linux/makefiles/mapfile-vers-jsig index f7ae7fb22b9..1880c82273d 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-jsig +++ b/hotspot/make/linux/makefiles/mapfile-vers-jsig @@ -1,7 +1,7 @@ # # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product index 7f5407c1309..6a76dd9e97b 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-product +++ b/hotspot/make/linux/makefiles/mapfile-vers-product @@ -3,7 +3,7 @@ # # -# Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-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 @@ -89,6 +89,7 @@ SUNWprivate_1.1 { JVM_FillInStackTrace; JVM_FindClassFromClass; JVM_FindClassFromClassLoader; + JVM_FindClassFromBootLoader; JVM_FindLibraryEntry; JVM_FindLoadedClass; JVM_FindPrimitiveClass; diff --git a/hotspot/make/linux/makefiles/optimized.make b/hotspot/make/linux/makefiles/optimized.make index 0d6aff8e91d..c391e29ef59 100644 --- a/hotspot/make/linux/makefiles/optimized.make +++ b/hotspot/make/linux/makefiles/optimized.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/product.make b/hotspot/make/linux/makefiles/product.make index a128c1101fa..43281abea99 100644 --- a/hotspot/make/linux/makefiles/product.make +++ b/hotspot/make/linux/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/profiled.make b/hotspot/make/linux/makefiles/profiled.make index c73acc848f8..c5acf86329c 100644 --- a/hotspot/make/linux/makefiles/profiled.make +++ b/hotspot/make/linux/makefiles/profiled.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make index a81633de34a..6559388141c 100644 --- a/hotspot/make/linux/makefiles/rules.make +++ b/hotspot/make/linux/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 @@ -133,10 +133,25 @@ ifeq ($(findstring j,$(MFLAGS)),j) COMPILE_DONE = && { echo Done with $<; } endif +# Include $(NONPIC_OBJ_FILES) definition +ifndef LP64 +include $(GAMMADIR)/make/pic.make +endif + +# The non-PIC object files are only generated for 32 bit platforms. +ifdef LP64 %.o: %.cpp @echo Compiling $< $(QUIETLY) $(REMOVE_TARGET) $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE) +else +%.o: %.cpp + @echo Compiling $< + $(QUIETLY) $(REMOVE_TARGET) + $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \ + $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \ + $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)) +endif %.o: %.s @echo Assembling $< diff --git a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make index 41843c5887d..94463d6a049 100644 --- a/hotspot/make/linux/makefiles/sa.make +++ b/hotspot/make/linux/makefiles/sa.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index f0e5d90f382..052adb13413 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/sparc.make b/hotspot/make/linux/makefiles/sparc.make index a86f9f7b6f5..6601c373347 100644 --- a/hotspot/make/linux/makefiles/sparc.make +++ b/hotspot/make/linux/makefiles/sparc.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make index 53819743beb..0a9f75b349a 100644 --- a/hotspot/make/linux/makefiles/sparcWorks.make +++ b/hotspot/make/linux/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/sparcv9.make b/hotspot/make/linux/makefiles/sparcv9.make index 7aad864e51c..d18e73bd2da 100644 --- a/hotspot/make/linux/makefiles/sparcv9.make +++ b/hotspot/make/linux/makefiles/sparcv9.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/linux/makefiles/tiered.make b/hotspot/make/linux/makefiles/tiered.make index 220124e50e1..5ad7f223c1a 100644 --- a/hotspot/make/linux/makefiles/tiered.make +++ b/hotspot/make/linux/makefiles/tiered.make @@ -1,5 +1,5 @@ # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index f0aa13576d0..2a7579febd7 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 65b18ef9e87..73caaf9a534 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/openjdk_distro b/hotspot/make/openjdk_distro index 5eb900d9fcb..b0301aab466 100644 --- a/hotspot/make/openjdk_distro +++ b/hotspot/make/openjdk_distro @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/pic.make b/hotspot/make/pic.make new file mode 100644 index 00000000000..b20f77c130b --- /dev/null +++ b/hotspot/make/pic.make @@ -0,0 +1,41 @@ +# +# Copyright 2006-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. +# +# + +# A list of object files built without the platform specific PIC flags, e.g. +# -fPIC on linux. Performance measurements show that by compiling GC related +# code, we could significantly reduce the GC pause time on 32 bit Linux/Unix +# platforms. See 6454213 for more details. +include $(GAMMADIR)/make/scm.make + +ifneq ($(OSNAME), windows) + ifndef LP64 + NONPIC_DIRS = memory oops gc_implementation gc_interface + NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir)) + # Look for source files under NONPIC_DIRS + NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\ + $(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \ + -name '*.cpp' -print)) + NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES))) + endif +endif diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files index 9b524940f3b..6f76f9d8faa 100644 --- a/hotspot/make/sa.files +++ b/hotspot/make/sa.files @@ -1,5 +1,5 @@ # -# Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/Makefile b/hotspot/make/solaris/Makefile index 0751fe9eb53..2e0882303bf 100644 --- a/hotspot/make/solaris/Makefile +++ b/hotspot/make/solaris/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/Queens.class b/hotspot/make/solaris/Queens.class deleted file mode 100644 index d4582a04411..00000000000 Binary files a/hotspot/make/solaris/Queens.class and /dev/null differ diff --git a/hotspot/make/solaris/build.sh b/hotspot/make/solaris/build.sh index bb8d175758c..29bff2d4b8f 100644 --- a/hotspot/make/solaris/build.sh +++ b/hotspot/make/solaris/build.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/adjust-mflags.sh b/hotspot/make/solaris/makefiles/adjust-mflags.sh index 325e02d4fb1..169f86b6695 100644 --- a/hotspot/make/solaris/makefiles/adjust-mflags.sh +++ b/hotspot/make/solaris/makefiles/adjust-mflags.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index b67ae554da0..f746d77494d 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/solaris/makefiles/amd64.make b/hotspot/make/solaris/makefiles/amd64.make index 9b229e83b79..7ce14eae1db 100644 --- a/hotspot/make/solaris/makefiles/amd64.make +++ b/hotspot/make/solaris/makefiles/amd64.make @@ -1,5 +1,5 @@ # -# Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-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 @@ -45,10 +45,6 @@ OPT_CFLAGS/os_solaris_x86_64.o = -xO1 OPT_CFLAGS/generateOptoStub.o = -xO2 OPT_CFLAGS/thread.o = -xO2 -# Work around for 6624782 -OPT_CFLAGS/instanceKlass.o = -Qoption ube -no_a2lf -OPT_CFLAGS/objArrayKlass.o = -Qoption ube -no_a2lf - else ifeq ("${Platform_compiler}", "gcc") diff --git a/hotspot/make/solaris/makefiles/buildtree.make b/hotspot/make/solaris/makefiles/buildtree.make index 1fb22360dca..47aced3fc59 100644 --- a/hotspot/make/solaris/makefiles/buildtree.make +++ b/hotspot/make/solaris/makefiles/buildtree.make @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -340,7 +340,7 @@ JAVA_FLAG/64 = -d64 WRONG_DATA_MODE_MSG = \ echo "JAVA_HOME must point to $(DATA_MODE)bit JDK." -test_gamma: $(BUILDTREE_MAKE) +test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java @echo Creating $@ ... $(QUIETLY) ( \ echo '#!/bin/ksh'; \ @@ -351,7 +351,8 @@ test_gamma: $(BUILDTREE_MAKE) echo "then"; \ echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \ echo "fi"; \ - echo 'CLASSPATH="$(GAMMADIR)/make/$(OS_FAMILY):$$CLASSPATH"'; \ + echo "rm -f Queens.class"; \ + echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \ echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \ echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \ ) > $@ diff --git a/hotspot/make/solaris/makefiles/compiler1.make b/hotspot/make/solaris/makefiles/compiler1.make index 3573eccfac4..2fc8eb8a8e1 100644 --- a/hotspot/make/solaris/makefiles/compiler1.make +++ b/hotspot/make/solaris/makefiles/compiler1.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/solaris/makefiles/compiler2.make b/hotspot/make/solaris/makefiles/compiler2.make index 5ef2129ae5a..af1ec8476ca 100644 --- a/hotspot/make/solaris/makefiles/compiler2.make +++ b/hotspot/make/solaris/makefiles/compiler2.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/solaris/makefiles/core.make b/hotspot/make/solaris/makefiles/core.make index e52d5b1ecca..e803bdb4ed0 100644 --- a/hotspot/make/solaris/makefiles/core.make +++ b/hotspot/make/solaris/makefiles/core.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/cscope.make b/hotspot/make/solaris/makefiles/cscope.make index 6fa197a56af..b5518555a50 100644 --- a/hotspot/make/solaris/makefiles/cscope.make +++ b/hotspot/make/solaris/makefiles/cscope.make @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/hotspot/make/solaris/makefiles/debug.make b/hotspot/make/solaris/makefiles/debug.make index d759910be9e..69eb236ada1 100644 --- a/hotspot/make/solaris/makefiles/debug.make +++ b/hotspot/make/solaris/makefiles/debug.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -29,7 +29,8 @@ DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +ifeq ($(COMPILER_REV),5.8) # SS11 SEGV when compiling with -g and -xarch=v8, using different backend DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0 diff --git a/hotspot/make/solaris/makefiles/defs.make b/hotspot/make/solaris/makefiles/defs.make index a56e01b65d4..625399a72b3 100644 --- a/hotspot/make/solaris/makefiles/defs.make +++ b/hotspot/make/solaris/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make index f4f7edf934d..bcc7819aa43 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -92,12 +92,12 @@ XARCH = $(subst sparcv9,v9,$(shell echo $(ISA))) $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ - $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \ + $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. -I$(GENERATED) \ $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) @echo Making $@ $(QUIETLY) mkdir -p 64/ ; \ - $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \ + $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. \ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor endif # ifneq ("${ISA}","${BUILDARCH}") diff --git a/hotspot/make/solaris/makefiles/fastdebug.make b/hotspot/make/solaris/makefiles/fastdebug.make index 0329b4c3678..62eaeb8f968 100644 --- a/hotspot/make/solaris/makefiles/fastdebug.make +++ b/hotspot/make/solaris/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -25,7 +25,7 @@ # Sets make macros for making debug version of VM # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make -# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_FLAGS. +# They may also specify FASTDEBUG_CFLAGS, but it defaults to DEBUG_CFLAGS. FASTDEBUG_CFLAGS$(FASTDEBUG_CFLAGS) = $(DEBUG_CFLAGS) @@ -35,15 +35,26 @@ OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") OPT_CFLAGS/SLOWER = -xO2 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) -# CC 5.5 has bug 4908364 with -xO4 + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV), 5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) +endif + +ifeq ($(COMPILER_REV), 5.5) +# CC 5.5 has bug 4908364 with -xO4 (Fixed in 5.6) OPT_CFLAGS/library_call.o = $(OPT_CFLAGS/SLOWER) -else # COMPILER_REV >= 5.5 +endif # COMPILER_REV == 5.5 + +ifeq ($(shell expr $(COMPILER_REV) \<= 5.4), 1) # Compilation of *_.cpp can take an hour or more at O3. Use O2 # See comments at top of sparc.make. OPT_CFLAGS/ad_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) OPT_CFLAGS/dfa_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) -endif # COMPILER_REV >= 5.5 +endif # COMPILER_REV <= 5.4 ifeq (${COMPILER_REV}, 5.0) # Avoid a compiler bug caused by using -xO -g diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make index d7314b97a85..8a88995f6de 100644 --- a/hotspot/make/solaris/makefiles/gcc.make +++ b/hotspot/make/solaris/makefiles/gcc.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/hp.make b/hotspot/make/solaris/makefiles/hp.make index ddf659bfe19..e2fc3a88b52 100644 --- a/hotspot/make/solaris/makefiles/hp.make +++ b/hotspot/make/solaris/makefiles/hp.make @@ -1,5 +1,5 @@ # -# Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/hp1.make b/hotspot/make/solaris/makefiles/hp1.make index 7d62469a7f9..36e0d322f0d 100644 --- a/hotspot/make/solaris/makefiles/hp1.make +++ b/hotspot/make/solaris/makefiles/hp1.make @@ -1,5 +1,5 @@ # -# Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/solaris/makefiles/i486.make b/hotspot/make/solaris/makefiles/i486.make index 10b5949bacd..a8f92a361bb 100644 --- a/hotspot/make/solaris/makefiles/i486.make +++ b/hotspot/make/solaris/makefiles/i486.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/jsig.make b/hotspot/make/solaris/makefiles/jsig.make index 29e4c238a9a..e4a4aef771a 100644 --- a/hotspot/make/solaris/makefiles/jsig.make +++ b/hotspot/make/solaris/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/solaris/makefiles/jvmg.make b/hotspot/make/solaris/makefiles/jvmg.make index 24a3510d4a5..ada307af855 100644 --- a/hotspot/make/solaris/makefiles/jvmg.make +++ b/hotspot/make/solaris/makefiles/jvmg.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -29,7 +29,8 @@ DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS) DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@)) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +ifeq ($(COMPILER_REV),5.8) # SS11 SEGV when compiling with -g and -xarch=v8, using different backend DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0 diff --git a/hotspot/make/solaris/makefiles/jvmti.make b/hotspot/make/solaris/makefiles/jvmti.make index 876714eb55d..dc4efa1e9fc 100644 --- a/hotspot/make/solaris/makefiles/jvmti.make +++ b/hotspot/make/solaris/makefiles/jvmti.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/makefiles/launcher.make b/hotspot/make/solaris/makefiles/launcher.make index 67693bb90b3..2224d58017d 100644 --- a/hotspot/make/solaris/makefiles/launcher.make +++ b/hotspot/make/solaris/makefiles/launcher.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/solaris/makefiles/makedeps.make b/hotspot/make/solaris/makefiles/makedeps.make index 12b01a7da96..751d6ff3417 100644 --- a/hotspot/make/solaris/makefiles/makedeps.make +++ b/hotspot/make/solaris/makefiles/makedeps.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers b/hotspot/make/solaris/makefiles/mapfile-vers index f7ed56e5f10..8c9d6883067 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers +++ b/hotspot/make/solaris/makefiles/mapfile-vers @@ -3,7 +3,7 @@ # # -# Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -89,6 +89,7 @@ SUNWprivate_1.1 { JVM_FillInStackTrace; JVM_FindClassFromClass; JVM_FindClassFromClassLoader; + JVM_FindClassFromBootLoader; JVM_FindLibraryEntry; JVM_FindLoadedClass; JVM_FindPrimitiveClass; diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1 b/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1 index b4b420867be..c77bda4d223 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1 +++ b/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER1 @@ -1,7 +1,7 @@ # # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2 b/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2 index 9e2e5356f55..ee44bf266a9 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2 +++ b/hotspot/make/solaris/makefiles/mapfile-vers-COMPILER2 @@ -1,7 +1,7 @@ # # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-CORE b/hotspot/make/solaris/makefiles/mapfile-vers-CORE index 25069d55c96..b62ad89fcb1 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-CORE +++ b/hotspot/make/solaris/makefiles/mapfile-vers-CORE @@ -1,7 +1,7 @@ # # -# Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-TIERED b/hotspot/make/solaris/makefiles/mapfile-vers-TIERED index 5149a01b598..ee62be5cd96 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-TIERED +++ b/hotspot/make/solaris/makefiles/mapfile-vers-TIERED @@ -1,7 +1,7 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-debug b/hotspot/make/solaris/makefiles/mapfile-vers-debug index 98ce4887aa0..0a7c28078c2 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-debug +++ b/hotspot/make/solaris/makefiles/mapfile-vers-debug @@ -1,7 +1,7 @@ # # -# Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-jsig b/hotspot/make/solaris/makefiles/mapfile-vers-jsig index f7ae7fb22b9..1880c82273d 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-jsig +++ b/hotspot/make/solaris/makefiles/mapfile-vers-jsig @@ -1,7 +1,7 @@ # # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-jvm_db b/hotspot/make/solaris/makefiles/mapfile-vers-jvm_db index 11ac2157b93..95ac685a4b6 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-jvm_db +++ b/hotspot/make/solaris/makefiles/mapfile-vers-jvm_db @@ -1,7 +1,7 @@ # # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-jvm_dtrace b/hotspot/make/solaris/makefiles/mapfile-vers-jvm_dtrace index e10f098330a..2bde56933c2 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-jvm_dtrace +++ b/hotspot/make/solaris/makefiles/mapfile-vers-jvm_dtrace @@ -1,7 +1,7 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/solaris/makefiles/mapfile-vers-nonproduct b/hotspot/make/solaris/makefiles/mapfile-vers-nonproduct index b1544b8b6e1..911a3b7fc55 100644 --- a/hotspot/make/solaris/makefiles/mapfile-vers-nonproduct +++ b/hotspot/make/solaris/makefiles/mapfile-vers-nonproduct @@ -1,7 +1,7 @@ # # -# Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-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 diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make index 4e8f6484790..1f91c3124f2 100644 --- a/hotspot/make/solaris/makefiles/optimized.make +++ b/hotspot/make/solaris/makefiles/optimized.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -30,12 +30,21 @@ OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS) OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@)) # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) - -# Workaround SS11 bug 6345274 (all platforms) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV),5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g +endif + +# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) +ifeq ($(COMPILER_REV),5.8)) OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) -endif # COMPILER_REV >= 5.8 +endif # COMPILER_REV == 5.8 + endif # Platform_compiler == sparcWorks # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings diff --git a/hotspot/make/solaris/makefiles/product.make b/hotspot/make/solaris/makefiles/product.make index d2e78c6646a..66e53536723 100644 --- a/hotspot/make/solaris/makefiles/product.make +++ b/hotspot/make/solaris/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -38,12 +38,21 @@ OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS) -xinline=no%__1cFciEnvbFpost_compiled_method_ endif # (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files) - -# Workaround SS11 bug 6345274 (all platforms) ifeq ("${Platform_compiler}", "sparcWorks") -ifeq ($(shell expr $(COMPILER_REV) \>= 5.8), 1) + +# Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) +ifeq ($(COMPILER_REV),5.9) + # Not clear this workaround could be skipped in some cases. + OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g + OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) -g +endif + +# Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) +ifeq ($(COMPILER_REV),5.8) OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) -endif # COMPILER_REV >= 5.8 +endif # COMPILER_REV == 5.8 + endif # Platform_compiler == sparcWorks # If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings diff --git a/hotspot/make/solaris/makefiles/profiled.make b/hotspot/make/solaris/makefiles/profiled.make index 297e6285183..5213aaad43b 100644 --- a/hotspot/make/solaris/makefiles/profiled.make +++ b/hotspot/make/solaris/makefiles/profiled.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 b/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 index cee930fd1ec..bab5b288d70 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER1_i486 @@ -2175,6 +2175,7 @@ text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%jni_GetStringUTFRegion: jni.o; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc_ii_pc_; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%JVM_IsInterface; text: .text%JVM_GetClassDeclaredConstructors; text: .text%__1cNmethodOopDescOis_initializer6kM_i_; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc b/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc index d135e73cfac..0dc59edddac 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER1_sparc @@ -1500,6 +1500,7 @@ text: .text%__1cQjava_lang_StringGlength6FpnHoopDesc__i_; text: .text%jni_GetStringUTFRegion: jni.o; text: .text%__1cQjava_lang_StringOas_utf8_string6FpnHoopDesc_ii_pc_; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%JVM_IsInterface; text: .text%JVM_GetClassDeclaredConstructors; text: .text%__1cNmethodOopDescOis_initializer6kM_i_; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64 b/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64 index b4bc7db5b72..4531671c613 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64 +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER2_amd64 @@ -4339,6 +4339,7 @@ text: .text%__1cSComputeAdapterInfoIdo_float6M_v_; text: .text%__1cFParseLarray_store6MnJBasicType__v_; text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc_ii_v_: nativeLookup.o; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%__1cZCallInterpreterDirectNodeSalignment_required6kM_i_; text: .text%__1cZCallInterpreterDirectNodePoper_input_base6kM_I_; text: .text%__1cZCallInterpreterDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486 b/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486 index 4113159bf8d..14a1fc2e3fc 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486 +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER2_i486 @@ -4755,6 +4755,7 @@ text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_and_dispatch6MpnITemplat text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFi_vi_v_; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%__1cPshrI_eReg_1NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cHi2bNodeMideal_Opcode6kM_i_: ad_i486_misc.o; text: .text%__1cMmatch_option6FpknMJavaVMOption_pkcp4_i_: arguments.o; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc b/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc index 4eadf379ca5..26ef9b2cd0b 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparc @@ -3713,6 +3713,7 @@ text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cITemplateIgenerate6MpnZInterpreterMacroAssembler__v_; text: .text%__1cQregI_to_stkINodeHis_Copy6kM_I_: ad_sparc_misc.o; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%signalHandler; text: .text%__1cTtypeArrayKlassKlassIoop_size6kMpnHoopDesc__i_: typeArrayKlassKlass.o; text: .text%JVM_handle_solaris_signal; diff --git a/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9 b/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9 index 3cc6b8b510a..5f4949f02be 100644 --- a/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9 +++ b/hotspot/make/solaris/makefiles/reorder_COMPILER2_sparcv9 @@ -3735,6 +3735,7 @@ text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cQjava_lang_ThreadRget_thread_status6FpnHoopDesc__n0AMThreadStatus__; text: .text%__1cIMulINodeGadd_id6kM_pknEType__: classes.o; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%__1cHTypePtrFempty6kM_i_; text: .text%__1cQaddP_reg_regNodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cbFunnecessary_membar_volatileNodePoper_input_base6kM_I_: ad_sparc_misc.o; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 b/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 index b4bc7db5b72..4531671c613 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_amd64 @@ -4339,6 +4339,7 @@ text: .text%__1cSComputeAdapterInfoIdo_float6M_v_; text: .text%__1cFParseLarray_store6MnJBasicType__v_; text: .text%__1cOmangle_name_on6FpnMoutputStream_pnNsymbolOopDesc_ii_v_: nativeLookup.o; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%__1cZCallInterpreterDirectNodeSalignment_required6kM_i_; text: .text%__1cZCallInterpreterDirectNodePoper_input_base6kM_I_; text: .text%__1cZCallInterpreterDirectNodeEemit6kMrnKCodeBuffer_pnNPhaseRegAlloc__v_; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_i486 b/hotspot/make/solaris/makefiles/reorder_TIERED_i486 index 4113159bf8d..14a1fc2e3fc 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_i486 +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_i486 @@ -4755,6 +4755,7 @@ text: .text%__1cbCAbstractInterpreterGeneratorVgenerate_and_dispatch6MpnITemplat text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cNTemplateTableDdef6FnJBytecodesECode_inITosState_3pFi_vi_v_; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%__1cPshrI_eReg_1NodeEsize6kMpnNPhaseRegAlloc__I_; text: .text%__1cHi2bNodeMideal_Opcode6kM_i_: ad_i486_misc.o; text: .text%__1cMmatch_option6FpknMJavaVMOption_pkcp4_i_: arguments.o; diff --git a/hotspot/make/solaris/makefiles/reorder_TIERED_sparc b/hotspot/make/solaris/makefiles/reorder_TIERED_sparc index 4eadf379ca5..26ef9b2cd0b 100644 --- a/hotspot/make/solaris/makefiles/reorder_TIERED_sparc +++ b/hotspot/make/solaris/makefiles/reorder_TIERED_sparc @@ -3713,6 +3713,7 @@ text: .text%__1cITemplateKinitialize6MinITosState_1pFi_vi_v_; text: .text%__1cITemplateIgenerate6MpnZInterpreterMacroAssembler__v_; text: .text%__1cQregI_to_stkINodeHis_Copy6kM_I_: ad_sparc_misc.o; text: .text%JVM_FindClassFromClassLoader; +text: .text%JVM_FindClassFromBootLoader; text: .text%signalHandler; text: .text%__1cTtypeArrayKlassKlassIoop_size6kMpnHoopDesc__i_: typeArrayKlassKlass.o; text: .text%JVM_handle_solaris_signal; diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make index 1329d2b1c42..56ff0e7d6b7 100644 --- a/hotspot/make/solaris/makefiles/rules.make +++ b/hotspot/make/solaris/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -133,19 +133,10 @@ ifeq ($(findstring j,$(MFLAGS)),j) COMPILE_DONE = && { echo Done with $<; } endif -# A list of directories under which all source code are built without -KPIC/-Kpic -# flag. Performance measurements show that compiling GC related code will -# dramatically reduce the gc pause time. See bug 6454213 for more details. - -include $(GAMMADIR)/make/scm.make - -NONPIC_DIRS = memory oops gc_implementation gc_interface -NONPIC_DIRS := $(foreach dir,$(NONPIC_DIRS), $(GAMMADIR)/src/share/vm/$(dir)) -# Look for source code under NONPIC_DIRS -NONPIC_FILES := $(foreach dir,$(NONPIC_DIRS),\ - $(shell find $(dir) \( $(SCM_DIRS) \) -prune -o \ - -name '*.cpp' -print)) -NONPIC_OBJ_FILES := $(notdir $(subst .cpp,.o,$(NONPIC_FILES))) +# Include NONPIC_OBJ_FILES definition +ifndef LP64 +include $(GAMMADIR)/make/pic.make +endif # Sun compiler for 64 bit Solaris does not support building non-PIC object files. ifdef LP64 diff --git a/hotspot/make/solaris/makefiles/sa.make b/hotspot/make/solaris/makefiles/sa.make index 1143688394e..6d700b23437 100644 --- a/hotspot/make/solaris/makefiles/sa.make +++ b/hotspot/make/solaris/makefiles/sa.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make index 83d9fce0e73..906cd9d998e 100644 --- a/hotspot/make/solaris/makefiles/saproc.make +++ b/hotspot/make/solaris/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/solaris/makefiles/sparc.make b/hotspot/make/solaris/makefiles/sparc.make index b3a0e2682bb..6f332cf63bd 100644 --- a/hotspot/make/solaris/makefiles/sparc.make +++ b/hotspot/make/solaris/makefiles/sparc.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -23,7 +23,7 @@ # Obj_Files += solaris_sparc.o -ASFLAGS += $(ARCHFLAG) +ASFLAGS += $(AS_ARCHFLAG) ifeq ("${Platform_compiler}", "sparcWorks") ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index a20546e6528..83ef29612ee 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -28,6 +28,8 @@ CC = cc CPP = CC +# Note that this 'as' is an older version of the Sun Studio 'fbe', and will +# use the older style options. The 'fbe' options will match 'cc' and 'CC'. AS = /usr/ccs/bin/as NM = /usr/ccs/bin/nm @@ -43,25 +45,33 @@ $(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') C_COMPILER_REV := \ $(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') -VALIDATED_COMPILER_REV := 5.8 -VALIDATED_C_COMPILER_REV := 5.8 +# Pick which compiler is validated +ifeq ($(JDK_MINOR_VERSION),6) + # Validated compiler for JDK6 is SS11 (5.8) + VALIDATED_COMPILER_REV := 5.8 + VALIDATED_C_COMPILER_REV := 5.8 +else + # FIXUP: Change to SS12 (5.9) once it has been validated. + # Validated compiler for JDK7 is SS12 (5.9) + #VALIDATED_COMPILER_REV := 5.9 + #VALIDATED_C_COMPILER_REV := 5.9 + VALIDATED_COMPILER_REV := 5.8 + VALIDATED_C_COMPILER_REV := 5.8 +endif +# Warning messages about not using the above validated version ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV}) -dummy_target_to_enforce_compiler_rev: - @echo "Wrong ${CPP} version: ${COMPILER_REV}. " \ - "Use version ${ENFORCE_COMPILER_REV}, or set" \ - "ENFORCE_COMPILER_REV=${COMPILER_REV}." - @exit 1 +dummy_target_to_enforce_compiler_rev:=\ +$(info WARNING: You are using CC version ${COMPILER_REV} \ +and should be using version ${ENFORCE_COMPILER_REV}) endif ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV}) -dummy_target_to_enforce_c_compiler_rev: - @echo "Wrong ${CC} version: ${C_COMPILER_REV}. " \ - "Use version ${ENFORCE_C_COMPILER_REV}, or set" \ - "ENFORCE_C_COMPILER_REV=${C_COMPILER_REV}." - @exit 1 +dummy_target_to_enforce_c_compiler_rev:=\ +$(info WARNING: You are using cc version ${C_COMPILER_REV} \ +and should be using version ${ENFORCE_C_COMPILER_REV}) endif # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 @@ -90,20 +100,44 @@ SOLARIS_7_OR_LATER := \ $(shell uname -r | awk -F. '{ if ($$2 >= 7) print "-DSOLARIS_7_OR_LATER"; }') CFLAGS += ${SOLARIS_7_OR_LATER} -ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) -# set ARCHFLAG/BUILDARCH which will ultimately be ARCHFLAG +# New architecture options started in SS12 (5.9), we need both styles to build. +# The older arch options for SS11 (5.8) or older and also for /usr/ccs/bin/as. +# Note: SS12 default for 32bit sparc is now the same as v8plus, so the +# settings below have changed all SS12 32bit sparc builds to be v8plus. +# The older SS11 (5.8) settings have remained as they always have been. ifeq ($(TYPE),COMPILER2) -ARCHFLAG/sparc = -xarch=v8plus + ARCHFLAG_OLD/sparc = -xarch=v8plus else -ifeq ($(TYPE),TIERED) -ARCHFLAG/sparc = -xarch=v8plus + ifeq ($(TYPE),TIERED) + ARCHFLAG_OLD/sparc = -xarch=v8plus + else + ARCHFLAG_OLD/sparc = -xarch=v8 + endif +endif +ARCHFLAG_NEW/sparc = -m32 -xarch=sparc +ARCHFLAG_OLD/sparcv9 = -xarch=v9 +ARCHFLAG_NEW/sparcv9 = -m64 -xarch=sparc +ARCHFLAG_OLD/i486 = +ARCHFLAG_NEW/i486 = -m32 +ARCHFLAG_OLD/amd64 = -xarch=amd64 +ARCHFLAG_NEW/amd64 = -m64 + +# Select the ARCHFLAGs and other SS12 (5.9) options +ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1) + ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) + ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) + ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) + ARCHFLAG/amd64 = $(ARCHFLAG_NEW/amd64) else -ARCHFLAG/sparc = -xarch=v8 + ARCHFLAG/sparc = $(ARCHFLAG_OLD/sparc) + ARCHFLAG/sparcv9 = $(ARCHFLAG_OLD/sparcv9) + ARCHFLAG/i486 = $(ARCHFLAG_OLD/i486) + ARCHFLAG/amd64 = $(ARCHFLAG_OLD/amd64) endif -endif -ARCHFLAG/sparcv9 = -xarch=v9 -ARCHFLAG/i486 = -ARCHFLAG/amd64 = -xarch=amd64 + +# ARCHFLAGS for the current build arch +ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) +AS_ARCHFLAG = $(ARCHFLAG_OLD/$(BUILDARCH)) # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept. ISA_DIR=$(ISA_DIR/$(BUILDARCH)) @@ -166,13 +200,13 @@ endif # 32bit x86 ifeq ("${Platform_arch_model}", "x86_64") -ASFLAGS += -xarch=amd64 -CFLAGS += -xarch=amd64 +ASFLAGS += $(AS_ARCHFLAG) +CFLAGS += $(ARCHFLAG/amd64) # this one seemed useless -LFLAGS_VM += -xarch=amd64 +LFLAGS_VM += $(ARCHFLAG/amd64) # this one worked -LFLAGS += -xarch=amd64 -AOUT_FLAGS += -xarch=amd64 +LFLAGS += $(ARCHFLAG/amd64) +AOUT_FLAGS += $(ARCHFLAG/amd64) # -xO3 is faster than -xO4 on specjbb with SS10 compiler OPT_CFLAGS=-xO4 $(EXTRA_OPT_CFLAGS) @@ -224,7 +258,7 @@ LFLAGS += -library=%none LFLAGS += -mt -endif # COMPILER_REV >= VALIDATED_COMPILER_REV +endif # COMPILER_REV >= 5.5 ###################################### # End 5.5 Forte compiler options # @@ -293,7 +327,7 @@ PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) LFLAGS += -library=Crun LIBS += -library=Crun -lCrun -endif # COMPILER_REV >= VALIDATED_COMPILER_REV +endif # COMPILER_REV == 5.2 ################################## # End 5.2 Forte compiler options # @@ -320,6 +354,7 @@ ifeq (${COMPILER_REV}, 5.0) # Had to hoist this higher apparently because of other changes. Must # come before -xarch specification. +# NOTE: native says optimize for the machine doing the compile, bad news. CFLAGS += -xtarget=native CFLAGS += $(ARCHFLAG) @@ -359,7 +394,7 @@ CFLAGS += $(GAMMADIR)/src/os_cpu/solaris_x86/vm/solaris_x86_32.il endif # 32bit x86 # The following options run into misaligned ldd problem (raj) -#OPT_CFLAGS = -fast -O4 -xarch=v8 -xchip=ultra +#OPT_CFLAGS = -fast -O4 $(ARCHFLAG/sparc) -xchip=ultra # no more exceptions CFLAGS/NOEX=-noex @@ -427,6 +462,15 @@ DEBUG_CFLAGS = -g FASTDEBUG_CFLAGS = -g0 # The -g0 setting allows the C++ frontend to inline, which is a big win. +# Special global options for SS12 +ifeq ($(COMPILER_REV),5.9) + # There appears to be multiple issues with the new Dwarf2 debug format, so + # we tell the compiler to use the older 'stabs' debug format all the time. + # Note that this needs to be used in optimized compiles too to be 100%. + # This is a workaround for SS12 (5.9) bug 6694600 + CFLAGS += -xdebugformat=stabs +endif + # Enable the following CFLAGS additions if you need to compare the # built ELF objects. # diff --git a/hotspot/make/solaris/makefiles/sparcv9.make b/hotspot/make/solaris/makefiles/sparcv9.make index 985b7b47135..c05d04bc18c 100644 --- a/hotspot/make/solaris/makefiles/sparcv9.make +++ b/hotspot/make/solaris/makefiles/sparcv9.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -23,7 +23,7 @@ # Obj_Files += solaris_sparc.o -ASFLAGS += $(ARCHFLAG) +ASFLAGS += $(AS_ARCHFLAG) ifeq ("${Platform_compiler}", "sparcWorks") ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) diff --git a/hotspot/make/solaris/makefiles/tiered.make b/hotspot/make/solaris/makefiles/tiered.make index 220124e50e1..5ad7f223c1a 100644 --- a/hotspot/make/solaris/makefiles/tiered.make +++ b/hotspot/make/solaris/makefiles/tiered.make @@ -1,5 +1,5 @@ # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make index 5a883565ada..bd8a42238d1 100644 --- a/hotspot/make/solaris/makefiles/top.make +++ b/hotspot/make/solaris/makefiles/top.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index 43d31878e54..70a11975fbc 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/solaris/reorder.sh b/hotspot/make/solaris/reorder.sh index 925b0a2407c..851140fed20 100644 --- a/hotspot/make/solaris/reorder.sh +++ b/hotspot/make/solaris/reorder.sh @@ -1,6 +1,6 @@ #!/bin/sh -x # -# Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/hotspot/make/test/Queens.java b/hotspot/make/test/Queens.java index 075ca9b93ad..06064f7cc35 100644 --- a/hotspot/make/test/Queens.java +++ b/hotspot/make/test/Queens.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 diff --git a/hotspot/make/windows/build.bat b/hotspot/make/windows/build.bat index 36d4ec6b480..444f88a26d4 100644 --- a/hotspot/make/windows/build.bat +++ b/hotspot/make/windows/build.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. +REM Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/build.make b/hotspot/make/windows/build.make index a871a849eb1..66ad19289e2 100644 --- a/hotspot/make/windows/build.make +++ b/hotspot/make/windows/build.make @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh index 98e65150a65..6cc931963b2 100644 --- a/hotspot/make/windows/build_vm_def.sh +++ b/hotspot/make/windows/build_vm_def.sh @@ -1,5 +1,5 @@ # -# Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/hotspot/make/windows/create.bat b/hotspot/make/windows/create.bat index a5a481ff7bd..21f97033669 100644 --- a/hotspot/make/windows/create.bat +++ b/hotspot/make/windows/create.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. +REM Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/cross_build.bat b/hotspot/make/windows/cross_build.bat index 42e0fb147d7..7359061c54e 100644 --- a/hotspot/make/windows/cross_build.bat +++ b/hotspot/make/windows/cross_build.bat @@ -1,6 +1,6 @@ @echo off REM -REM Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +REM Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/make/windows/get_msc_ver.sh b/hotspot/make/windows/get_msc_ver.sh index 1e4f6a02489..6bbbbef7859 100644 --- a/hotspot/make/windows/get_msc_ver.sh +++ b/hotspot/make/windows/get_msc_ver.sh @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make index f7665667fb1..b2f8132c64d 100644 --- a/hotspot/make/windows/makefiles/adlc.make +++ b/hotspot/make/windows/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make index 7292774e1b5..bf6f3be9b2e 100644 --- a/hotspot/make/windows/makefiles/compile.make +++ b/hotspot/make/windows/makefiles/compile.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/windows/makefiles/debug.make b/hotspot/make/windows/makefiles/debug.make index 7ea4aae9486..afd987d9cd0 100644 --- a/hotspot/make/windows/makefiles/debug.make +++ b/hotspot/make/windows/makefiles/debug.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/windows/makefiles/defs.make b/hotspot/make/windows/makefiles/defs.make index 19d49f17af6..bfabddff58e 100644 --- a/hotspot/make/windows/makefiles/defs.make +++ b/hotspot/make/windows/makefiles/defs.make @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/windows/makefiles/fastdebug.make b/hotspot/make/windows/makefiles/fastdebug.make index cb6901bce2f..064592bffe4 100644 --- a/hotspot/make/windows/makefiles/fastdebug.make +++ b/hotspot/make/windows/makefiles/fastdebug.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/windows/makefiles/generated.make b/hotspot/make/windows/makefiles/generated.make index 7eff90d1681..3d2a0001d00 100644 --- a/hotspot/make/windows/makefiles/generated.make +++ b/hotspot/make/windows/makefiles/generated.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/windows/makefiles/jvmti.make b/hotspot/make/windows/makefiles/jvmti.make index 74600a11f77..e0b22c04d3a 100644 --- a/hotspot/make/windows/makefiles/jvmti.make +++ b/hotspot/make/windows/makefiles/jvmti.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/windows/makefiles/makedeps.make b/hotspot/make/windows/makefiles/makedeps.make index e3164313d7e..a64407bfa5f 100644 --- a/hotspot/make/windows/makefiles/makedeps.make +++ b/hotspot/make/windows/makefiles/makedeps.make @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/windows/makefiles/product.make b/hotspot/make/windows/makefiles/product.make index a2887cfcef3..a143d6c99b5 100644 --- a/hotspot/make/windows/makefiles/product.make +++ b/hotspot/make/windows/makefiles/product.make @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make index 04ee8e399c5..f07f84aee1d 100644 --- a/hotspot/make/windows/makefiles/rules.make +++ b/hotspot/make/windows/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index 216c44fc870..481b5149d03 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -1,5 +1,5 @@ # -# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/hotspot/make/windows/makefiles/sanity.make b/hotspot/make/windows/makefiles/sanity.make index 9b7aa13ab69..5b4293d27f8 100644 --- a/hotspot/make/windows/makefiles/sanity.make +++ b/hotspot/make/windows/makefiles/sanity.make @@ -1,5 +1,5 @@ # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/make/windows/makefiles/shared.make b/hotspot/make/windows/makefiles/shared.make index a5055045e82..173450c83b9 100644 --- a/hotspot/make/windows/makefiles/shared.make +++ b/hotspot/make/windows/makefiles/shared.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/windows/makefiles/top.make b/hotspot/make/windows/makefiles/top.make index 679e5692efc..0caabcdfd3f 100644 --- a/hotspot/make/windows/makefiles/top.make +++ b/hotspot/make/windows/makefiles/top.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make index c911ab261f0..e7321de1332 100644 --- a/hotspot/make/windows/makefiles/vm.make +++ b/hotspot/make/windows/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -88,13 +88,20 @@ AGCT_EXPORT=/export:AsyncGetCallTrace !endif !endif -LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ - /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM \ - /export:JNI_GetCreatedJavaVMs /export:jio_snprintf \ - /export:jio_printf /export:jio_fprintf \ - /export:jio_vfprintf /export:jio_vsnprintf $(AGCT_EXPORT) \ - /export:JVM_GetVersionInfo \ - /export:JVM_GetThreadStateNames /export:JVM_GetThreadStateValues \ +LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ + /export:JNI_GetDefaultJavaVMInitArgs \ + /export:JNI_CreateJavaVM \ + /export:JVM_FindClassFromBootLoader \ + /export:JNI_GetCreatedJavaVMs \ + /export:jio_snprintf \ + /export:jio_printf \ + /export:jio_fprintf \ + /export:jio_vfprintf \ + /export:jio_vsnprintf \ + $(AGCT_EXPORT) \ + /export:JVM_GetVersionInfo \ + /export:JVM_GetThreadStateNames \ + /export:JVM_GetThreadStateValues \ /export:JVM_InitAgentProperties CPP_INCLUDE_DIRS=\ diff --git a/hotspot/make/windows/projectfiles/common/Makefile b/hotspot/make/windows/projectfiles/common/Makefile index 1b4a5bf7343..c6793f96b31 100644 --- a/hotspot/make/windows/projectfiles/common/Makefile +++ b/hotspot/make/windows/projectfiles/common/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/windows/projectfiles/compiler1/Makefile b/hotspot/make/windows/projectfiles/compiler1/Makefile index e189845fd58..f96091f39ec 100644 --- a/hotspot/make/windows/projectfiles/compiler1/Makefile +++ b/hotspot/make/windows/projectfiles/compiler1/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1999-2002 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/hotspot/make/windows/projectfiles/compiler2/Makefile b/hotspot/make/windows/projectfiles/compiler2/Makefile index 567f02030ee..7c26e15d1cc 100644 --- a/hotspot/make/windows/projectfiles/compiler2/Makefile +++ b/hotspot/make/windows/projectfiles/compiler2/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/windows/projectfiles/core/Makefile b/hotspot/make/windows/projectfiles/core/Makefile index e42986de410..fa8c3a12d20 100644 --- a/hotspot/make/windows/projectfiles/core/Makefile +++ b/hotspot/make/windows/projectfiles/core/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/hotspot/make/windows/projectfiles/tiered/Makefile b/hotspot/make/windows/projectfiles/tiered/Makefile index 1aaae59680d..2c24068c2b9 100644 --- a/hotspot/make/windows/projectfiles/tiered/Makefile +++ b/hotspot/make/windows/projectfiles/tiered/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp index a4963c65078..c7dce335619 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1523,6 +1523,21 @@ Address MacroAssembler::constant_oop_address(jobject obj, Register d) { return Address(d, address(obj), oop_Relocation::spec(oop_index)); } +void MacroAssembler::set_narrow_oop(jobject obj, Register d) { + assert(oop_recorder() != NULL, "this assembler needs an OopRecorder"); + int oop_index = oop_recorder()->find_index(obj); + RelocationHolder rspec = oop_Relocation::spec(oop_index); + + assert_not_delayed(); + // Relocation with special format (see relocInfo_sparc.hpp). + relocate(rspec, 1); + // Assembler::sethi(0x3fffff, d); + emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(0x3fffff) ); + // Don't add relocation for 'add'. Do patching during 'sethi' processing. + add(d, 0x3ff, d); + +} + void MacroAssembler::align(int modulus) { while (offset() % modulus != 0) nop(); @@ -3406,13 +3421,15 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case set((intptr_t)markOopDesc::prototype()->copy_set_hash(0x2), t2); st_ptr(t2, top, oopDesc::mark_offset_in_bytes()); // set up the mark word // set klass to intArrayKlass - set((intptr_t)Universe::intArrayKlassObj_addr(), t2); - ld_ptr(t2, 0, t2); - store_klass(t2, top); sub(t1, typeArrayOopDesc::header_size(T_INT), t1); add(t1, ThreadLocalAllocBuffer::alignment_reserve(), t1); sll_ptr(t1, log2_intptr(HeapWordSize/sizeof(jint)), t1); st(t1, top, arrayOopDesc::length_offset_in_bytes()); + set((intptr_t)Universe::intArrayKlassObj_addr(), t2); + ld_ptr(t2, 0, t2); + // store klass last. concurrent gcs assumes klass length is valid if + // klass field is not null. + store_klass(t2, top); verify_oop(top); // refill the tlab with an eden allocation @@ -3537,28 +3554,32 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, } } -void MacroAssembler::load_klass(Register s, Register d) { +void MacroAssembler::load_klass(Register src_oop, Register klass) { // The number of bytes in this code is used by // MachCallDynamicJavaNode::ret_addr_offset() // if this changes, change that. if (UseCompressedOops) { - lduw(s, oopDesc::klass_offset_in_bytes(), d); - decode_heap_oop_not_null(d); + lduw(src_oop, oopDesc::klass_offset_in_bytes(), klass); + decode_heap_oop_not_null(klass); } else { - ld_ptr(s, oopDesc::klass_offset_in_bytes(), d); + ld_ptr(src_oop, oopDesc::klass_offset_in_bytes(), klass); } } -// ??? figure out src vs. dst! -void MacroAssembler::store_klass(Register d, Register s1) { +void MacroAssembler::store_klass(Register klass, Register dst_oop) { if (UseCompressedOops) { - assert(s1 != d, "not enough registers"); - encode_heap_oop_not_null(d); - // Zero out entire klass field first. - st_ptr(G0, s1, oopDesc::klass_offset_in_bytes()); - st(d, s1, oopDesc::klass_offset_in_bytes()); + assert(dst_oop != klass, "not enough registers"); + encode_heap_oop_not_null(klass); + st(klass, dst_oop, oopDesc::klass_offset_in_bytes()); } else { - st_ptr(d, s1, oopDesc::klass_offset_in_bytes()); + st_ptr(klass, dst_oop, oopDesc::klass_offset_in_bytes()); + } +} + +void MacroAssembler::store_klass_gap(Register s, Register d) { + if (UseCompressedOops) { + assert(s != d, "not enough registers"); + st(s, d, oopDesc::klass_gap_offset_in_bytes()); } } @@ -3622,6 +3643,7 @@ void MacroAssembler::store_heap_oop(Register d, const Address& a, int offset) { void MacroAssembler::encode_heap_oop(Register src, Register dst) { assert (UseCompressedOops, "must be compressed"); + verify_oop(src); Label done; if (src == dst) { // optimize for frequent case src == dst @@ -3643,12 +3665,14 @@ void MacroAssembler::encode_heap_oop(Register src, Register dst) { void MacroAssembler::encode_heap_oop_not_null(Register r) { assert (UseCompressedOops, "must be compressed"); + verify_oop(r); sub(r, G6_heapbase, r); srlx(r, LogMinObjAlignmentInBytes, r); } void MacroAssembler::encode_heap_oop_not_null(Register src, Register dst) { assert (UseCompressedOops, "must be compressed"); + verify_oop(src); sub(src, G6_heapbase, dst); srlx(dst, LogMinObjAlignmentInBytes, dst); } @@ -3661,11 +3685,13 @@ void MacroAssembler::decode_heap_oop(Register src, Register dst) { bpr(rc_nz, true, Assembler::pt, dst, done); delayed() -> add(dst, G6_heapbase, dst); // annuled if not taken bind(done); + verify_oop(dst); } void MacroAssembler::decode_heap_oop_not_null(Register r) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. + // Also do not verify_oop as this is called by verify_oop. assert (UseCompressedOops, "must be compressed"); sllx(r, LogMinObjAlignmentInBytes, r); add(r, G6_heapbase, r); @@ -3674,6 +3700,7 @@ void MacroAssembler::decode_heap_oop_not_null(Register r) { void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) { // Do not add assert code to this unless you change vtableStubs_sparc.cpp // pd_code_size_limit. + // Also do not verify_oop as this is called by verify_oop. assert (UseCompressedOops, "must be compressed"); sllx(src, LogMinObjAlignmentInBytes, dst); add(dst, G6_heapbase, dst); diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index c1aae2e6620..e1f7e0636b8 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1977,8 +1977,9 @@ class MacroAssembler: public Assembler { inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); } // klass oop manipulations if compressed - void load_klass(Register src_oop, Register dst); - void store_klass(Register dst_oop, Register s1); + void load_klass(Register src_oop, Register klass); + void store_klass(Register klass, Register dst_oop); + void store_klass_gap(Register s, Register dst_oop); // oop manipulations void load_heap_oop(const Address& s, Register d, int offset = 0); @@ -2103,6 +2104,8 @@ class MacroAssembler: public Assembler { inline void set_oop_constant( jobject obj, Register d ); // uses constant_oop_address inline void set_oop ( Address obj_addr ); // same as load_address + void set_narrow_oop( jobject obj, Register d ); + // nop padding void align(int modulus); diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp index dafab4bdcfd..28321303b08 100644 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 8436fb8561b..f1dc75f1ef4 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index 74bc5ecf3b4..d5696d442f4 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 523b0042a21..a002e2474aa 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp index fc180cb43d3..9ddae97ef12 100644 --- a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp index 8bd53e47a51..f2d6486f856 100644 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 1e8077d55d9..13626f0700e 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index aff31ce6c2f..5881dd69be4 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 3deee97da75..16e3c6746fb 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp index 1e7263b41ef..2527e35b3e9 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp index 4001805226b..d3e80557098 100644 --- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp index af1450c7440..795e1831e52 100644 --- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -87,6 +87,17 @@ void Relocation::pd_set_data_value(address x, intptr_t o) { #ifdef _LP64 jint inst2; guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi"); + if (format() != 0) { + assert(type() == relocInfo::oop_type, "only narrow oops case"); + jint np = oopDesc::encode_heap_oop((oop)x); + inst &= ~Assembler::hi22(-1); + inst |= Assembler::hi22((intptr_t)np); + ip->set_long_at(0, inst); + inst2 = ip->long_at( NativeInstruction::nop_instruction_size ); + guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op"); + ip->set_long_at(NativeInstruction::nop_instruction_size, ip->set_data32_simm13( inst2, (intptr_t)np)); + break; + } ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x ); #ifdef COMPILER2 // [RGV] Someone must have missed putting in a reloc entry for the diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp index ed38e6e50cb..69c6c889b7b 100644 --- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2001 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -31,7 +31,12 @@ // There is no need for format bits; the instructions are // sufficiently self-identifying. +#ifndef _LP64 format_width = 0 +#else + // Except narrow oops in 64-bits VM. + format_width = 1 +#endif }; diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 7f5c4f81407..3812e2eaed9 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -2556,7 +2556,6 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( int total_strings = 0; int first_arg_to_pass = 0; int total_c_args = 0; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(); // Skip the receiver as dtrace doesn't want to see it if( !method->is_static() ) { @@ -2721,7 +2720,8 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( #endif /* ASSERT */ VMRegPair zero; - zero.set2(G0->as_VMReg()); + const Register g0 = G0; // without this we get a compiler warning (why??) + zero.set2(g0->as_VMReg()); int c_arg, j_arg; @@ -2778,7 +2778,9 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( __ br_null(in_reg, true, Assembler::pn, skipUnbox); __ delayed()->mov(G0, tmp); - switch (out_sig_bt[c_arg]) { + BasicType bt = out_sig_bt[c_arg]; + int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); + switch (bt) { case T_BYTE: __ ldub(in_reg, box_offset, tmp); break; case T_SHORT: diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 73458015efe..c02673b3efc 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1,5 +1,5 @@ // -// Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1998-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 @@ -5471,7 +5471,6 @@ instruct loadN(iRegN dst, memory mem) %{ // Load Klass Pointer instruct loadKlass(iRegP dst, memory mem) %{ match(Set dst (LoadKlass mem)); - predicate(!n->in(MemNode::Address)->bottom_type()->is_narrow()); ins_cost(MEMORY_REF_COST); size(4); @@ -5486,11 +5485,11 @@ instruct loadKlass(iRegP dst, memory mem) %{ ins_pipe(iload_mem); %} -// Load Klass Pointer -instruct loadKlassComp(iRegP dst, memory mem) %{ - match(Set dst (LoadKlass mem)); - predicate(n->in(MemNode::Address)->bottom_type()->is_narrow()); +// Load narrow Klass Pointer +instruct loadNKlass(iRegN dst, memory mem) %{ + match(Set dst (LoadNKlass mem)); ins_cost(MEMORY_REF_COST); + size(4); format %{ "LDUW $mem,$dst\t! compressed klass ptr" %} @@ -5503,9 +5502,6 @@ instruct loadKlassComp(iRegP dst, memory mem) %{ } else { __ lduw(base, $mem$$disp, dst); } - // klass oop never null but this is generated for nonheader klass loads - // too which can be null. - __ decode_heap_oop(dst); %} ins_pipe(iload_mem); %} @@ -5609,22 +5605,24 @@ instruct loadConP_poll(iRegP dst, immP_poll src) %{ ins_pipe(loadConP_poll); %} +instruct loadConN0(iRegN dst, immN0 src) %{ + match(Set dst src); + + size(4); + format %{ "CLR $dst\t! compressed NULL ptr" %} + ins_encode( SetNull( dst ) ); + ins_pipe(ialu_imm); +%} + instruct loadConN(iRegN dst, immN src) %{ match(Set dst src); - ins_cost(DEFAULT_COST * 2); - format %{ "SET $src,$dst\t!ptr" %} + ins_cost(DEFAULT_COST * 3/2); + format %{ "SET $src,$dst\t! compressed ptr" %} ins_encode %{ - address con = (address)$src$$constant; Register dst = $dst$$Register; - if (con == NULL) { - __ mov(G0, dst); - } else { - __ set_oop((jobject)$src$$constant, dst); - __ encode_heap_oop(dst); - } + __ set_narrow_oop((jobject)$src$$constant, dst); %} - ins_pipe(loadConP); - + ins_pipe(ialu_hi_lo_reg); %} instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{ @@ -5957,7 +5955,7 @@ instruct storeA8B(memory mem, regD src) %{ // Convert oop pointer into compressed form instruct encodeHeapOop(iRegN dst, iRegP src) %{ - predicate(n->bottom_type()->is_narrowoop()->make_oopptr()->ptr() != TypePtr::NotNull); + predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull); match(Set dst (EncodeP src)); format %{ "encode_heap_oop $src, $dst" %} ins_encode %{ @@ -5967,7 +5965,7 @@ instruct encodeHeapOop(iRegN dst, iRegP src) %{ %} instruct encodeHeapOop_not_null(iRegN dst, iRegP src) %{ - predicate(n->bottom_type()->is_narrowoop()->make_oopptr()->ptr() == TypePtr::NotNull); + predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull); match(Set dst (EncodeP src)); format %{ "encode_heap_oop_not_null $src, $dst" %} ins_encode %{ @@ -5977,7 +5975,8 @@ instruct encodeHeapOop_not_null(iRegN dst, iRegP src) %{ %} instruct decodeHeapOop(iRegP dst, iRegN src) %{ - predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull); + predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull && + n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant); match(Set dst (DecodeN src)); format %{ "decode_heap_oop $src, $dst" %} ins_encode %{ @@ -5987,7 +5986,8 @@ instruct decodeHeapOop(iRegP dst, iRegN src) %{ %} instruct decodeHeapOop_not_null(iRegP dst, iRegN src) %{ - predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull); + predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull || + n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant); match(Set dst (DecodeN src)); format %{ "decode_heap_oop_not_null $src, $dst" %} ins_encode %{ @@ -6258,6 +6258,34 @@ instruct cmovIF_imm(cmpOpF cmp, flagsRegF fcc, iRegI dst, immI11 src) %{ ins_pipe(ialu_imm); %} +// Conditional move for RegN. Only cmov(reg,reg). +instruct cmovNP_reg(cmpOpP cmp, flagsRegP pcc, iRegN dst, iRegN src) %{ + match(Set dst (CMoveN (Binary cmp pcc) (Binary dst src))); + ins_cost(150); + format %{ "MOV$cmp $pcc,$src,$dst" %} + ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::ptr_cc)) ); + ins_pipe(ialu_reg); +%} + +// This instruction also works with CmpN so we don't need cmovNN_reg. +instruct cmovNI_reg(cmpOp cmp, flagsReg 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); + size(4); + format %{ "MOV$cmp $fcc,$src,$dst" %} + ins_encode( enc_cmov_reg_f(cmp,dst,src, fcc) ); + ins_pipe(ialu_reg); +%} + // Conditional move instruct cmovPP_reg(cmpOpP cmp, flagsRegP pcc, iRegP dst, iRegP src) %{ match(Set dst (CMoveP (Binary cmp pcc) (Binary dst src))); @@ -6275,6 +6303,7 @@ instruct cmovPP_imm(cmpOpP cmp, flagsRegP pcc, iRegP dst, immP0 src) %{ ins_pipe(ialu_imm); %} +// This instruction also works with CmpN so we don't need cmovPN_reg. instruct cmovPI_reg(cmpOp cmp, flagsReg icc, iRegP dst, iRegP src) %{ match(Set dst (CMoveP (Binary cmp icc) (Binary dst src))); ins_cost(150); @@ -6650,10 +6679,9 @@ instruct compareAndSwapP_bool(iRegP mem_ptr, iRegP oldval, iRegP newval, iRegI r ins_pipe( long_memory_op ); %} -instruct compareAndSwapN_bool_comp(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI res, o7RegI tmp, flagsReg ccr ) %{ +instruct compareAndSwapN_bool(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{ match(Set res (CompareAndSwapN mem_ptr (Binary oldval newval))); - effect( USE mem_ptr, KILL ccr, KILL tmp); - + effect( USE mem_ptr, KILL ccr, KILL tmp1); format %{ "MOV $newval,O7\n\t" "CASA [$mem_ptr],$oldval,O7\t! If $oldval==[$mem_ptr] Then store O7 into [$mem_ptr], set O7=[$mem_ptr] in any case\n\t" @@ -6661,18 +6689,8 @@ instruct compareAndSwapN_bool_comp(iRegP mem_ptr, iRegN oldval, iRegN newval, iR "MOV 1,$res\n\t" "MOVne icc,R_G0,$res" %} - ins_encode %{ - Register Rmem = reg_to_register_object($mem_ptr$$reg); - Register Rold = reg_to_register_object($oldval$$reg); - Register Rnew = reg_to_register_object($newval$$reg); - Register Rres = reg_to_register_object($res$$reg); - - __ cas(Rmem, Rold, Rnew); - __ cmp( Rold, Rnew ); - __ mov(1, Rres); - __ movcc( Assembler::notEqual, false, Assembler::icc, G0, Rres ); - %} - + ins_encode( enc_casi(mem_ptr, oldval, newval), + enc_iflags_ne_to_boolean(res) ); ins_pipe( long_memory_op ); %} @@ -8265,6 +8283,27 @@ instruct compP_iRegP_imm13(flagsRegP pcc, iRegP op1, immP13 op2 ) %{ ins_pipe(ialu_cconly_reg_imm); %} +// Compare Narrow oops +instruct compN_iRegN(flagsReg icc, iRegN op1, iRegN op2 ) %{ + match(Set icc (CmpN op1 op2)); + + size(4); + format %{ "CMP $op1,$op2\t! compressed ptr" %} + opcode(Assembler::subcc_op3, Assembler::arith_op); + ins_encode( form3_rs1_rs2_rd( op1, op2, R_G0 ) ); + ins_pipe(ialu_cconly_reg_reg); +%} + +instruct compN_iRegN_immN0(flagsReg icc, iRegN op1, immN0 op2 ) %{ + match(Set icc (CmpN op1 op2)); + + size(4); + format %{ "CMP $op1,$op2\t! compressed ptr" %} + opcode(Assembler::subcc_op3, Assembler::arith_op); + ins_encode( form3_rs1_simm13_rd( op1, op2, R_G0 ) ); + ins_pipe(ialu_cconly_reg_imm); +%} + //----------Max and Min-------------------------------------------------------- // Min Instructions // Conditional move for min @@ -8595,6 +8634,14 @@ instruct cmovIL_imm(cmpOp cmp, flagsRegL xcc, iRegI dst, immI11 src) %{ ins_pipe(ialu_imm); %} +instruct cmovNL_reg(cmpOp cmp, flagsRegL xcc, iRegN dst, iRegN src) %{ + match(Set dst (CMoveN (Binary cmp xcc) (Binary dst src))); + ins_cost(150); + format %{ "MOV$cmp $xcc,$src,$dst" %} + ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::xcc)) ); + ins_pipe(ialu_reg); +%} + instruct cmovPL_reg(cmpOp cmp, flagsRegL xcc, iRegP dst, iRegP src) %{ match(Set dst (CMoveP (Binary cmp xcc) (Binary dst src))); ins_cost(150); @@ -8826,16 +8873,6 @@ instruct partialSubtypeCheck_vs_zero( flagsRegP pcc, o1RegP sub, o2RegP super, i %} -instruct compP_iRegN_immN0(flagsRegP pcc, iRegN op1, immN0 op2 ) %{ - match(Set pcc (CmpN op1 op2)); - - size(4); - format %{ "CMP $op1,$op2\t! ptr" %} - opcode(Assembler::subcc_op3, Assembler::arith_op); - ins_encode( form3_rs1_simm13_rd( op1, op2, R_G0 ) ); - ins_pipe(ialu_cconly_reg_imm); -%} - // ============================================================================ // inlined locking and unlocking diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index 73e092d620c..f21ed2f80ba 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index 63e2bdc3e59..090242c17e6 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index a9bc2b9eff3..bd852da5636 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -3222,7 +3222,8 @@ void TemplateTable::_new() { __ set((intptr_t)markOopDesc::prototype(), G4_scratch); } __ st_ptr(G4_scratch, RallocatedObject, oopDesc::mark_offset_in_bytes()); // mark - __ store_klass(RinstanceKlass, RallocatedObject); // klass + __ store_klass_gap(G0, RallocatedObject); // klass gap if compressed + __ store_klass(RinstanceKlass, RallocatedObject); // klass (last for cms) { SkipIfEqual skip_if( diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 46b9e34e6a6..a870c7dc15b 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index d10845d0659..050e7e68fcc 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp index 299ce53e31e..af2536b7c48 100644 --- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp b/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp index e68bf489309..91c2e9ab193 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp b/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp index 02fb38d4056..9588449955c 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86_32.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1054,7 +1054,7 @@ class MacroAssembler: public Assembler { // range (0 <= offset <= page_size). void null_check(Register reg, int offset = -1); - static bool needs_explicit_null_check(int offset); + static bool needs_explicit_null_check(intptr_t offset); // Required platform-specific helpers for Label::patch_instructions. // They _shadow_ the declarations in AbstractAssembler, which are undefined. diff --git a/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp b/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp index f700fd71b5e..431c233df73 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -683,7 +683,8 @@ address Assembler::locate_operand(address inst, WhichOperand which) { case REP8(0xB8): // movl/q r, #32/#64(oop?) if (which == end_pc_operand) return ip + (is_64bit ? 8 : 4); - assert((which == call32_operand || which == imm64_operand) && is_64bit, ""); + assert((which == call32_operand || which == imm64_operand) && is_64bit || + which == narrow_oop_operand && !is_64bit, ""); return ip; case 0x69: // imul r, a, #32 @@ -909,7 +910,8 @@ void Assembler::check_relocation(RelocationHolder const& rspec, int format) { } else if (r->is_call() || format == call32_operand) { opnd = locate_operand(inst, call32_operand); } else if (r->is_data()) { - assert(format == imm64_operand || format == disp32_operand, "format ok"); + assert(format == imm64_operand || format == disp32_operand || + format == narrow_oop_operand, "format ok"); opnd = locate_operand(inst, (WhichOperand) format); } else { assert(format == 0, "cannot specify a format"); @@ -4933,6 +4935,8 @@ void MacroAssembler::tlab_refill(Label& retry, movq(Address(top, arrayOopDesc::length_offset_in_bytes()), t1); // set klass to intArrayKlass movptr(t1, ExternalAddress((address) Universe::intArrayKlassObj_addr())); + // store klass last. concurrent gcs assumes klass length is valid if + // klass field is not null. store_klass(top, t1); // refill the tlab with an eden allocation @@ -5003,8 +5007,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re jcc(Assembler::notEqual, cas_label); // The bias pattern is present in the object's header. Need to check // whether the bias owner and the epoch are both still current. - load_klass(tmp_reg, obj_reg); - movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); + load_prototype_header(tmp_reg, obj_reg); orq(tmp_reg, r15_thread); xorq(tmp_reg, swap_reg); andq(tmp_reg, ~((int) markOopDesc::age_mask_in_place)); @@ -5078,8 +5081,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re // // FIXME: due to a lack of registers we currently blow away the age // bits in this situation. Should attempt to preserve them. - load_klass(tmp_reg, obj_reg); - movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); + load_prototype_header(tmp_reg, obj_reg); orq(tmp_reg, r15_thread); if (os::is_MP()) { lock(); @@ -5109,8 +5111,7 @@ int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Re // // FIXME: due to a lack of registers we currently blow away the age // bits in this situation. Should attempt to preserve them. - load_klass(tmp_reg, obj_reg); - movq(tmp_reg, Address(tmp_reg, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); + load_prototype_header(tmp_reg, obj_reg); if (os::is_MP()) { lock(); } @@ -5154,17 +5155,32 @@ void MacroAssembler::load_klass(Register dst, Register src) { } } +void MacroAssembler::load_prototype_header(Register dst, Register src) { + if (UseCompressedOops) { + movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); + movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); + } else { + movq(dst, Address(src, oopDesc::klass_offset_in_bytes())); + movq(dst, Address(dst, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes())); + } +} + void MacroAssembler::store_klass(Register dst, Register src) { if (UseCompressedOops) { encode_heap_oop_not_null(src); - // zero the entire klass field first as the gap needs to be zeroed too. - movptr(Address(dst, oopDesc::klass_offset_in_bytes()), NULL_WORD); movl(Address(dst, oopDesc::klass_offset_in_bytes()), src); } else { movq(Address(dst, oopDesc::klass_offset_in_bytes()), src); } } +void MacroAssembler::store_klass_gap(Register dst, Register src) { + if (UseCompressedOops) { + // Store to klass gap in destination + movl(Address(dst, oopDesc::klass_gap_offset_in_bytes()), src); + } +} + void MacroAssembler::load_heap_oop(Register dst, Address src) { if (UseCompressedOops) { movl(dst, src); @@ -5188,13 +5204,15 @@ void MacroAssembler::store_heap_oop(Address dst, Register src) { void MacroAssembler::encode_heap_oop(Register r) { assert (UseCompressedOops, "should be compressed"); #ifdef ASSERT - Label ok; - pushq(rscratch1); // cmpptr trashes rscratch1 - cmpptr(r12_heapbase, ExternalAddress((address)Universe::heap_base_addr())); - jcc(Assembler::equal, ok); - stop("MacroAssembler::encode_heap_oop: heap base corrupted?"); - bind(ok); - popq(rscratch1); + if (CheckCompressedOops) { + Label ok; + pushq(rscratch1); // cmpptr trashes rscratch1 + cmpptr(r12_heapbase, ExternalAddress((address)Universe::heap_base_addr())); + jcc(Assembler::equal, ok); + stop("MacroAssembler::encode_heap_oop: heap base corrupted?"); + bind(ok); + popq(rscratch1); + } #endif verify_oop(r, "broken oop in encode_heap_oop"); testq(r, r); @@ -5206,11 +5224,13 @@ void MacroAssembler::encode_heap_oop(Register r) { void MacroAssembler::encode_heap_oop_not_null(Register r) { assert (UseCompressedOops, "should be compressed"); #ifdef ASSERT - Label ok; - testq(r, r); - jcc(Assembler::notEqual, ok); - stop("null oop passed to encode_heap_oop_not_null"); - bind(ok); + if (CheckCompressedOops) { + Label ok; + testq(r, r); + jcc(Assembler::notEqual, ok); + stop("null oop passed to encode_heap_oop_not_null"); + bind(ok); + } #endif verify_oop(r, "broken oop in encode_heap_oop_not_null"); subq(r, r12_heapbase); @@ -5220,11 +5240,13 @@ void MacroAssembler::encode_heap_oop_not_null(Register r) { void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) { assert (UseCompressedOops, "should be compressed"); #ifdef ASSERT - Label ok; - testq(src, src); - jcc(Assembler::notEqual, ok); - stop("null oop passed to encode_heap_oop_not_null2"); - bind(ok); + if (CheckCompressedOops) { + Label ok; + testq(src, src); + jcc(Assembler::notEqual, ok); + stop("null oop passed to encode_heap_oop_not_null2"); + bind(ok); + } #endif verify_oop(src, "broken oop in encode_heap_oop_not_null2"); if (dst != src) { @@ -5237,14 +5259,16 @@ void MacroAssembler::encode_heap_oop_not_null(Register dst, Register src) { void MacroAssembler::decode_heap_oop(Register r) { assert (UseCompressedOops, "should be compressed"); #ifdef ASSERT - Label ok; - pushq(rscratch1); - cmpptr(r12_heapbase, - ExternalAddress((address)Universe::heap_base_addr())); - jcc(Assembler::equal, ok); - stop("MacroAssembler::decode_heap_oop: heap base corrupted?"); - bind(ok); - popq(rscratch1); + if (CheckCompressedOops) { + Label ok; + pushq(rscratch1); + cmpptr(r12_heapbase, + ExternalAddress((address)Universe::heap_base_addr())); + jcc(Assembler::equal, ok); + stop("MacroAssembler::decode_heap_oop: heap base corrupted?"); + bind(ok); + popq(rscratch1); + } #endif Label done; @@ -5265,6 +5289,7 @@ void MacroAssembler::decode_heap_oop_not_null(Register r) { assert (UseCompressedOops, "should only be used for compressed headers"); // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. + // Also do not verify_oop as this is called by verify_oop. assert(Address::times_8 == LogMinObjAlignmentInBytes, "decode alg wrong"); leaq(r, Address(r12_heapbase, r, Address::times_8, 0)); } @@ -5273,10 +5298,24 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) { assert (UseCompressedOops, "should only be used for compressed headers"); // Cannot assert, unverified entry point counts instructions (see .ad file) // vtableStubs also counts instructions in pd_code_size_limit. + // Also do not verify_oop as this is called by verify_oop. assert(Address::times_8 == LogMinObjAlignmentInBytes, "decode alg wrong"); leaq(dst, Address(r12_heapbase, src, Address::times_8, 0)); } +void MacroAssembler::set_narrow_oop(Register dst, jobject obj) { + assert(oop_recorder() != NULL, "this assembler needs an OopRecorder"); + int oop_index = oop_recorder()->find_index(obj); + RelocationHolder rspec = oop_Relocation::spec(oop_index); + + // movl dst,obj + InstructionMark im(this); + int encode = prefix_and_encode(dst->encoding()); + emit_byte(0xB8 | encode); + emit_data(oop_index, rspec, narrow_oop_operand); +} + + Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { switch (cond) { // Note some conditions are synonyms for others diff --git a/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp b/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp index 9e1ccbfe59d..bf509e02b22 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86_64.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -490,7 +490,12 @@ class Assembler : public AbstractAssembler { imm64_operand = 0, // embedded 64-bit immediate operand disp32_operand = 1, // embedded 32-bit displacement call32_operand = 2, // embedded 32-bit self-relative displacement +#ifndef AMD64 _WhichOperand_limit = 3 +#else + narrow_oop_operand = 3, // embedded 32-bit immediate narrow oop + _WhichOperand_limit = 4 +#endif }; public: @@ -1023,7 +1028,7 @@ class MacroAssembler : public Assembler { // is needed if the offset is within a certain range (0 <= offset <= // page_size). void null_check(Register reg, int offset = -1); - static bool needs_explicit_null_check(int offset); + static bool needs_explicit_null_check(intptr_t offset); // Required platform-specific helpers for Label::patch_instructions. // They _shadow_ the declarations in AbstractAssembler, which are undefined. @@ -1104,6 +1109,9 @@ class MacroAssembler : public Assembler { // oop manipulations void load_klass(Register dst, Register src); void store_klass(Register dst, Register src); + void store_klass_gap(Register dst, Register src); + + void load_prototype_header(Register dst, Register src); void load_heap_oop(Register dst, Address src); void store_heap_oop(Address dst, Register src); @@ -1114,6 +1122,8 @@ class MacroAssembler : public Assembler { void encode_heap_oop_not_null(Register dst, Register src); void decode_heap_oop_not_null(Register dst, Register src); + void set_narrow_oop(Register dst, jobject obj); + // Stack frame creation/removal void enter(); void leave(); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 7c632cbabcd..081f38c3bac 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 7c4861d614e..d2f9e2d35b7 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index b80a66ed87c..27024aa8a4b 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 5019d16c367..9fe370e85de 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 153b1002bff..85a1944bd44 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 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 25611881bbc..4756a2587be 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -233,7 +233,7 @@ void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, assert(Rsub_klass != rcx, "rcx holds 2ndary super array length"); assert(Rsub_klass != rdi, "rdi holds 2ndary super array scan ptr"); - Label not_subtype, loop; + Label not_subtype, not_subtype_pop, loop; // Profile the not-null value's klass. profile_typecheck(rcx, Rsub_klass, rdi); // blows rcx, rdi @@ -272,12 +272,13 @@ void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, // and we store values in objArrays always encoded, thus we need to encode value // before repne if (UseCompressedOops) { + pushq(rax); encode_heap_oop(rax); repne_scanl(); // Not equal? - jcc(Assembler::notEqual, not_subtype); - // decode heap oop here for movq - decode_heap_oop(rax); + jcc(Assembler::notEqual, not_subtype_pop); + // restore heap oop here for movq + popq(rax); } else { repne_scanq(); jcc(Assembler::notEqual, not_subtype); @@ -287,9 +288,10 @@ void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass, Klass::secondary_super_cache_offset_in_bytes()), rax); jmp(ok_is_subtype); + bind(not_subtype_pop); + // restore heap oop here for miss + if (UseCompressedOops) popq(rax); bind(not_subtype); - // decode heap oop here for miss - if (UseCompressedOops) decode_heap_oop(rax); profile_typecheck_failed(rcx); // blows rcx } diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 251c32065a0..9636c5739e5 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp index 9133af54123..f8147a4cc64 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp index f4115bcf985..255e8210f99 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp index c5fee6815da..1be2c138211 100644 --- a/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp +++ b/hotspot/src/cpu/x86/vm/register_definitions_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp index 2c547c64518..055c237149b 100644 --- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp +++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -30,11 +30,15 @@ void Relocation::pd_set_data_value(address x, intptr_t o) { #ifdef AMD64 x += o; typedef Assembler::WhichOperand WhichOperand; - WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm64, call32 + WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm64, call32, narrow oop assert(which == Assembler::disp32_operand || + which == Assembler::narrow_oop_operand || which == Assembler::imm64_operand, "format unpacks ok"); if (which == Assembler::imm64_operand) { *pd_address_in_code() = x; + } else if (which == Assembler::narrow_oop_operand) { + address disp = Assembler::locate_operand(addr(), which); + *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x); } else { // Note: Use runtime_call_type relocations for call32_operand. address ip = addr(); diff --git a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp index 964cd1ff307..da2fe93dacc 100644 --- a/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp +++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -29,5 +29,10 @@ offset_unit = 1, // Encodes Assembler::disp32_operand vs. Assembler::imm32_operand. +#ifndef AMD64 format_width = 1 +#else + // vs Assembler::narrow_oop_operand. + format_width = 2 +#endif }; diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 7dc635d0c34..85befcf4e78 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -1920,7 +1920,6 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( int total_strings = 0; int first_arg_to_pass = 0; int total_c_args = 0; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(); if( !method->is_static() ) { // Pass in receiver first in_sig_bt[i++] = T_OBJECT; @@ -2131,7 +2130,10 @@ nmethod *SharedRuntime::generate_dtrace_nmethod( assert(dst.first()->is_stack() && (!dst.second()->is_valid() || dst.second()->is_stack()), "value(s) must go into stack slots"); - if ( out_sig_bt[c_arg] == T_LONG ) { + + BasicType bt = out_sig_bt[c_arg]; + int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); + if ( bt == T_LONG ) { __ movl(rbx, Address(in_reg, box_offset + VMRegImpl::stack_slot_size)); __ movl(Address(rsp, reg2offset_out(dst.second())), rbx); diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 8fa458680d3..b2d4a6513ac 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -1950,7 +1950,6 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(MacroAssembler *masm, int total_strings = 0; int first_arg_to_pass = 0; int total_c_args = 0; - int box_offset = java_lang_boxing_object::value_offset_in_bytes(); // Skip the receiver as dtrace doesn't want to see it if( !method->is_static() ) { @@ -2197,8 +2196,10 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(MacroAssembler *masm, __ testq(in_reg, in_reg); __ jcc(Assembler::zero, skipUnbox); + BasicType bt = out_sig_bt[c_arg]; + int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); Address src1(in_reg, box_offset); - if ( out_sig_bt[c_arg] == T_LONG ) { + if ( bt == T_LONG ) { __ movq(in_reg, src1); __ movq(stack_dst, in_reg); assert(out_sig_bt[c_arg+1] == T_VOID, "must be"); @@ -2460,8 +2461,10 @@ nmethod *SharedRuntime::generate_dtrace_nmethod(MacroAssembler *masm, Label skip; __ testq(r, r); __ jcc(Assembler::equal, skip); + BasicType bt = out_sig_bt[c_arg]; + int box_offset = java_lang_boxing_object::value_offset_in_bytes(bt); Address src1(r, box_offset); - if ( out_sig_bt[c_arg] == T_LONG ) { + if ( bt == T_LONG ) { __ movq(r, src1); } else { __ movl(r, src1); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 5cfbc09fe74..68188361b50 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp index 6134af3071a..3f7d4719b5f 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp index 79bcd92f2e4..24e7e12fc85 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index f84c8f8cc05..c831b0cdc38 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -3163,7 +3163,9 @@ void TemplateTable::_new() { __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), (intptr_t) markOopDesc::prototype()); // header (address 0x1) } - __ store_klass(rax, rsi); // klass + __ 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 __ jmp(done); } diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86_32.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86_32.cpp index ba4e3481cb7..d65cc0cc3e6 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -307,6 +307,10 @@ void VM_Version::get_processor_features() { // Use it on new AMD cpus starting from Opteron. UseAddressNop = true; } + if( supports_sse2() && FLAG_IS_DEFAULT(UseNewLongLShift) ) { + // Use it on new AMD cpus starting from Opteron. + UseNewLongLShift = true; + } if( FLAG_IS_DEFAULT(UseXmmLoadAndClearUpper) ) { if( supports_sse4a() ) { UseXmmLoadAndClearUpper = true; // use movsd only on '10h' Opteron diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86_64.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86_64.cpp index ee8e2c69018..71be1f8a20e 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 3a934d8d7f1..931b3aa900a 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 90607dc2508..35db833e9ef 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -1,5 +1,5 @@ // -// Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +// 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 @@ -3806,6 +3806,78 @@ encode %{ masm.bind(DONE_LABEL); %} + enc_class enc_Array_Equals(eDIRegP ary1, eSIRegP ary2, eAXRegI tmp1, eBXRegI tmp2, eCXRegI result) %{ + Label TRUE_LABEL, FALSE_LABEL, DONE_LABEL, COMPARE_LOOP_HDR, COMPARE_LOOP; + MacroAssembler masm(&cbuf); + + Register ary1Reg = as_Register($ary1$$reg); + Register ary2Reg = as_Register($ary2$$reg); + Register tmp1Reg = as_Register($tmp1$$reg); + Register tmp2Reg = as_Register($tmp2$$reg); + Register resultReg = as_Register($result$$reg); + + int length_offset = arrayOopDesc::length_offset_in_bytes(); + int base_offset = arrayOopDesc::base_offset_in_bytes(T_CHAR); + + // Check the input args + masm.cmpl(ary1Reg, ary2Reg); + masm.jcc(Assembler::equal, TRUE_LABEL); + masm.testl(ary1Reg, ary1Reg); + masm.jcc(Assembler::zero, FALSE_LABEL); + masm.testl(ary2Reg, ary2Reg); + masm.jcc(Assembler::zero, FALSE_LABEL); + + // Check the lengths + masm.movl(tmp2Reg, Address(ary1Reg, length_offset)); + masm.movl(resultReg, Address(ary2Reg, length_offset)); + masm.cmpl(tmp2Reg, resultReg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.testl(resultReg, resultReg); + masm.jcc(Assembler::zero, TRUE_LABEL); + + // Get the number of 4 byte vectors to compare + masm.shrl(resultReg, 1); + + // Check for odd-length arrays + masm.andl(tmp2Reg, 1); + masm.testl(tmp2Reg, tmp2Reg); + masm.jcc(Assembler::zero, COMPARE_LOOP_HDR); + + // Compare 2-byte "tail" at end of arrays + masm.load_unsigned_word(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset)); + masm.load_unsigned_word(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset)); + masm.cmpl(tmp1Reg, tmp2Reg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.testl(resultReg, resultReg); + masm.jcc(Assembler::zero, TRUE_LABEL); + + // Setup compare loop + masm.bind(COMPARE_LOOP_HDR); + // Shift tmp1Reg and tmp2Reg to the last 4-byte boundary of the arrays + masm.leal(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset)); + masm.leal(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset)); + masm.negl(resultReg); + + // 4-byte-wide compare loop + masm.bind(COMPARE_LOOP); + masm.movl(ary1Reg, Address(tmp1Reg, resultReg, Address::times_4, 0)); + masm.movl(ary2Reg, Address(tmp2Reg, resultReg, Address::times_4, 0)); + masm.cmpl(ary1Reg, ary2Reg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.increment(resultReg); + masm.jcc(Assembler::notZero, COMPARE_LOOP); + + masm.bind(TRUE_LABEL); + masm.movl(resultReg, 1); // return true + masm.jmp(DONE_LABEL); + + masm.bind(FALSE_LABEL); + masm.xorl(resultReg, resultReg); // return false + + // That's it + masm.bind(DONE_LABEL); + %} + enc_class enc_pop_rdx() %{ emit_opcode(cbuf,0x5A); %} @@ -4682,6 +4754,33 @@ operand immI_32_63() %{ interface(CONST_INTER); %} +operand immI_1() %{ + predicate( n->get_int() == 1 ); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + +operand immI_2() %{ + predicate( n->get_int() == 2 ); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + +operand immI_3() %{ + predicate( n->get_int() == 3 ); + match(ConI); + + op_cost(0); + format %{ %} + interface(CONST_INTER); +%} + // Pointer Immediate operand immP() %{ match(ConP); @@ -8871,6 +8970,63 @@ instruct xorl_eReg_mem(eRegL dst, load_long_memory mem, eFlagsReg cr) %{ ins_pipe( ialu_reg_long_mem ); %} +// Shift Left Long by 1 +instruct shlL_eReg_1(eRegL dst, immI_1 cnt, eFlagsReg cr) %{ + predicate(UseNewLongLShift); + match(Set dst (LShiftL dst cnt)); + effect(KILL cr); + ins_cost(100); + format %{ "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi" %} + ins_encode %{ + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + %} + ins_pipe( ialu_reg_long ); +%} + +// Shift Left Long by 2 +instruct shlL_eReg_2(eRegL dst, immI_2 cnt, eFlagsReg cr) %{ + predicate(UseNewLongLShift); + match(Set dst (LShiftL dst cnt)); + effect(KILL cr); + ins_cost(100); + format %{ "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi\n\t" + "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi" %} + ins_encode %{ + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + %} + ins_pipe( ialu_reg_long ); +%} + +// Shift Left Long by 3 +instruct shlL_eReg_3(eRegL dst, immI_3 cnt, eFlagsReg cr) %{ + predicate(UseNewLongLShift); + match(Set dst (LShiftL dst cnt)); + effect(KILL cr); + ins_cost(100); + format %{ "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi\n\t" + "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi\n\t" + "ADD $dst.lo,$dst.lo\n\t" + "ADC $dst.hi,$dst.hi" %} + ins_encode %{ + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + __ addl($dst$$Register,$dst$$Register); + __ adcl(HIGH_FROM_LOW($dst$$Register),HIGH_FROM_LOW($dst$$Register)); + %} + ins_pipe( ialu_reg_long ); +%} + // Shift Left Long by 1-31 instruct shlL_eReg_1_31(eRegL dst, immI_1_31 cnt, eFlagsReg cr) %{ match(Set dst (LShiftL dst cnt)); @@ -11565,6 +11721,17 @@ instruct string_compare(eDIRegP str1, eSIRegP str2, eAXRegI tmp1, eBXRegI tmp2, ins_pipe( pipe_slow ); %} +// fast array equals +instruct array_equals(eDIRegP ary1, eSIRegP ary2, eAXRegI tmp1, eBXRegI tmp2, eCXRegI result, eFlagsReg cr) %{ + match(Set result (AryEq ary1 ary2)); + effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL cr); + //ins_cost(300); + + format %{ "Array Equals $ary1,$ary2 -> $result // KILL EAX, EBX" %} + ins_encode( enc_Array_Equals(ary1, ary2, tmp1, tmp2, result) ); + ins_pipe( pipe_slow ); +%} + //----------Control Flow Instructions------------------------------------------ // Signed compare Instructions instruct compI_eReg(eFlagsReg cr, eRegI op1, eRegI op2) %{ diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 2c79821c238..302994148c0 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -1,5 +1,5 @@ // -// Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2003-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 @@ -3808,6 +3808,78 @@ encode %{ masm.bind(DONE_LABEL); %} + enc_class enc_Array_Equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI tmp1, rbx_RegI tmp2, rcx_RegI result) %{ + Label TRUE_LABEL, FALSE_LABEL, DONE_LABEL, COMPARE_LOOP_HDR, COMPARE_LOOP; + MacroAssembler masm(&cbuf); + + Register ary1Reg = as_Register($ary1$$reg); + Register ary2Reg = as_Register($ary2$$reg); + Register tmp1Reg = as_Register($tmp1$$reg); + Register tmp2Reg = as_Register($tmp2$$reg); + Register resultReg = as_Register($result$$reg); + + int length_offset = arrayOopDesc::length_offset_in_bytes(); + int base_offset = arrayOopDesc::base_offset_in_bytes(T_CHAR); + + // Check the input args + masm.cmpq(ary1Reg, ary2Reg); + masm.jcc(Assembler::equal, TRUE_LABEL); + masm.testq(ary1Reg, ary1Reg); + masm.jcc(Assembler::zero, FALSE_LABEL); + masm.testq(ary2Reg, ary2Reg); + masm.jcc(Assembler::zero, FALSE_LABEL); + + // Check the lengths + masm.movl(tmp2Reg, Address(ary1Reg, length_offset)); + masm.movl(resultReg, Address(ary2Reg, length_offset)); + masm.cmpl(tmp2Reg, resultReg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.testl(resultReg, resultReg); + masm.jcc(Assembler::zero, TRUE_LABEL); + + // Get the number of 4 byte vectors to compare + masm.shrl(resultReg, 1); + + // Check for odd-length arrays + masm.andl(tmp2Reg, 1); + masm.testl(tmp2Reg, tmp2Reg); + masm.jcc(Assembler::zero, COMPARE_LOOP_HDR); + + // Compare 2-byte "tail" at end of arrays + masm.load_unsigned_word(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset)); + masm.load_unsigned_word(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset)); + masm.cmpl(tmp1Reg, tmp2Reg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.testl(resultReg, resultReg); + masm.jcc(Assembler::zero, TRUE_LABEL); + + // Setup compare loop + masm.bind(COMPARE_LOOP_HDR); + // Shift tmp1Reg and tmp2Reg to the last 4-byte boundary of the arrays + masm.leaq(tmp1Reg, Address(ary1Reg, resultReg, Address::times_4, base_offset)); + masm.leaq(tmp2Reg, Address(ary2Reg, resultReg, Address::times_4, base_offset)); + masm.negq(resultReg); + + // 4-byte-wide compare loop + masm.bind(COMPARE_LOOP); + masm.movl(ary1Reg, Address(tmp1Reg, resultReg, Address::times_4, 0)); + masm.movl(ary2Reg, Address(tmp2Reg, resultReg, Address::times_4, 0)); + masm.cmpl(ary1Reg, ary2Reg); + masm.jcc(Assembler::notEqual, FALSE_LABEL); + masm.incrementq(resultReg); + masm.jcc(Assembler::notZero, COMPARE_LOOP); + + masm.bind(TRUE_LABEL); + masm.movl(resultReg, 1); // return true + masm.jmp(DONE_LABEL); + + masm.bind(FALSE_LABEL); + masm.xorl(resultReg, resultReg); // return false + + // That's it + masm.bind(DONE_LABEL); + %} + enc_class enc_rethrow() %{ cbuf.set_inst_mark(); @@ -5202,15 +5274,15 @@ operand indIndexScaleOffset(any_RegP reg, immL32 off, rRegL lreg, immI2 scale) %} %} -// Indirect Memory Times Scale Plus Index Register Plus Offset Operand -operand indIndexScaleOffsetComp(rRegN src, immL32 off, r12RegL base) %{ +// Indirect Narrow Oop Plus Offset Operand +operand indNarrowOopOffset(rRegN src, immL32 off) %{ constraint(ALLOC_IN_RC(ptr_reg)); - match(AddP (DecodeN src base) off); + match(AddP (DecodeN src) off); op_cost(10); - format %{"[$base + $src << 3 + $off] (compressed)" %} + format %{"[R12 + $src << 3 + $off] (compressed oop addressing)" %} interface(MEMORY_INTER) %{ - base($base); + base(0xc); // R12 index($src); scale(0x3); disp($off); @@ -5365,7 +5437,7 @@ operand cmpOpU() opclass memory(indirect, indOffset8, indOffset32, indIndexOffset, indIndex, indIndexScale, indIndexScaleOffset, indPosIndexScaleOffset, - indIndexScaleOffsetComp); + indNarrowOopOffset); //----------PIPELINE----------------------------------------------------------- // Rules which define the behavior of the target architectures pipeline. @@ -6044,10 +6116,9 @@ instruct loadP(rRegP dst, memory mem) %} // Load Compressed Pointer -instruct loadN(rRegN dst, memory mem, rFlagsReg cr) +instruct loadN(rRegN dst, memory mem) %{ match(Set dst (LoadN mem)); - effect(KILL cr); ins_cost(125); // XXX format %{ "movl $dst, $mem\t# compressed ptr" %} @@ -6064,7 +6135,6 @@ instruct loadN(rRegN dst, memory mem, rFlagsReg cr) instruct loadKlass(rRegP dst, memory mem) %{ match(Set dst (LoadKlass mem)); - predicate(!n->in(MemNode::Address)->bottom_type()->is_narrow()); ins_cost(125); // XXX format %{ "movq $dst, $mem\t# class" %} @@ -6073,22 +6143,17 @@ instruct loadKlass(rRegP dst, memory mem) ins_pipe(ialu_reg_mem); // XXX %} -// Load Klass Pointer -instruct loadKlassComp(rRegP dst, memory mem) +// Load narrow Klass Pointer +instruct loadNKlass(rRegN dst, memory mem) %{ - match(Set dst (LoadKlass mem)); - predicate(n->in(MemNode::Address)->bottom_type()->is_narrow()); + match(Set dst (LoadNKlass mem)); ins_cost(125); // XXX - format %{ "movl $dst, $mem\t# compressed class\n\t" - "decode_heap_oop $dst,$dst" %} + format %{ "movl $dst, $mem\t# compressed klass ptr" %} ins_encode %{ Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp); Register dst = as_Register($dst$$reg); __ movl(dst, addr); - // klass is never null in the header but this is generated for all - // klass loads not just the _klass field in the header. - __ decode_heap_oop(dst); %} ins_pipe(ialu_reg_mem); // XXX %} @@ -6362,16 +6427,14 @@ instruct loadConN(rRegN dst, immN src) %{ match(Set dst src); ins_cost(125); - format %{ "movq $dst, $src\t# compressed ptr\n\t" - "encode_heap_oop_not_null $dst,$dst" %} + format %{ "movl $dst, $src\t# compressed ptr" %} ins_encode %{ address con = (address)$src$$constant; Register dst = $dst$$Register; if (con == NULL) { ShouldNotReachHere(); } else { - __ movoop(dst, (jobject)$src$$constant); - __ encode_heap_oop_not_null(dst); + __ set_narrow_oop(dst, (jobject)$src$$constant); } %} ins_pipe(ialu_reg_fat); // XXX @@ -6633,13 +6696,12 @@ instruct storeImmP(memory mem, immP31 src) %} // Store Compressed Pointer -instruct storeN(memory mem, rRegN src, rFlagsReg cr) +instruct storeN(memory mem, rRegN src) %{ match(Set mem (StoreN mem src)); - effect(KILL cr); ins_cost(125); // XXX - format %{ "movl $mem, $src\t# ptr" %} + format %{ "movl $mem, $src\t# compressed ptr" %} ins_encode %{ Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp); Register src = as_Register($src$$reg); @@ -6998,7 +7060,7 @@ instruct castP2X(rRegL dst, rRegP src) // Convert oop pointer into compressed form instruct encodeHeapOop(rRegN dst, rRegP src, rFlagsReg cr) %{ - predicate(n->bottom_type()->is_narrowoop()->make_oopptr()->ptr() != TypePtr::NotNull); + predicate(n->bottom_type()->make_ptr()->ptr() != TypePtr::NotNull); match(Set dst (EncodeP src)); effect(KILL cr); format %{ "encode_heap_oop $dst,$src" %} @@ -7014,7 +7076,7 @@ instruct encodeHeapOop(rRegN dst, rRegP src, rFlagsReg cr) %{ %} instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{ - predicate(n->bottom_type()->is_narrowoop()->make_oopptr()->ptr() == TypePtr::NotNull); + predicate(n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull); match(Set dst (EncodeP src)); effect(KILL cr); format %{ "encode_heap_oop_not_null $dst,$src" %} @@ -7027,7 +7089,8 @@ instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{ %} instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{ - predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull); + predicate(n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull && + n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant); match(Set dst (DecodeN src)); effect(KILL cr); format %{ "decode_heap_oop $dst,$src" %} @@ -7043,7 +7106,8 @@ instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{ %} instruct decodeHeapOop_not_null(rRegP dst, rRegN src) %{ - predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull); + predicate(n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull || + n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant); match(Set dst (DecodeN src)); format %{ "decode_heap_oop_not_null $dst,$src" %} ins_encode %{ @@ -7142,6 +7206,30 @@ instruct cmovI_memU(cmpOpU cop, rFlagsRegU cr, rRegI dst, memory src) ins_pipe(pipe_cmov_mem); %} +// Conditional move +instruct cmovN_reg(rRegN dst, rRegN src, rFlagsReg cr, cmpOp cop) +%{ + match(Set dst (CMoveN (Binary cop cr) (Binary dst src))); + + ins_cost(200); // XXX + format %{ "cmovl$cop $dst, $src\t# signed, compressed ptr" %} + opcode(0x0F, 0x40); + ins_encode(REX_reg_reg(dst, src), enc_cmov(cop), reg_reg(dst, src)); + ins_pipe(pipe_cmov_reg); +%} + +// Conditional move +instruct cmovN_regU(rRegN dst, rRegN src, rFlagsRegU cr, cmpOpU cop) +%{ + match(Set dst (CMoveN (Binary cop cr) (Binary dst src))); + + ins_cost(200); // XXX + format %{ "cmovl$cop $dst, $src\t# unsigned, compressed ptr" %} + opcode(0x0F, 0x40); + ins_encode(REX_reg_reg(dst, src), enc_cmov(cop), reg_reg(dst, src)); + ins_pipe(pipe_cmov_reg); +%} + // Conditional move instruct cmovP_reg(rRegP dst, rRegP src, rFlagsReg cr, cmpOp cop) %{ @@ -10862,6 +10950,18 @@ instruct string_compare(rdi_RegP str1, rsi_RegP str2, rax_RegI tmp1, ins_pipe( pipe_slow ); %} +// fast array equals +instruct array_equals(rdi_RegP ary1, rsi_RegP ary2, rax_RegI tmp1, + rbx_RegI tmp2, rcx_RegI result, rFlagsReg cr) %{ + match(Set result (AryEq ary1 ary2)); + effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL cr); + //ins_cost(300); + + format %{ "Array Equals $ary1,$ary2 -> $result // KILL RAX, RBX" %} + ins_encode( enc_Array_Equals(ary1, ary2, tmp1, tmp2, result) ); + ins_pipe( pipe_slow ); +%} + //----------Control Flow Instructions------------------------------------------ // Signed compare Instructions @@ -11055,14 +11155,50 @@ instruct testP_reg_mem(rFlagsReg cr, memory op, immP0 zero) ins_pipe(ialu_cr_reg_imm); %} + +instruct compN_rReg(rFlagsRegU cr, rRegN op1, rRegN op2) +%{ + match(Set cr (CmpN op1 op2)); + + format %{ "cmpl $op1, $op2\t# compressed ptr" %} + ins_encode %{ __ cmpl(as_Register($op1$$reg), as_Register($op2$$reg)); %} + ins_pipe(ialu_cr_reg_reg); +%} + +instruct compN_rReg_mem(rFlagsRegU cr, rRegN src, memory mem) +%{ + match(Set cr (CmpN src (LoadN mem))); + + ins_cost(500); // XXX + format %{ "cmpl $src, mem\t# compressed ptr" %} + ins_encode %{ + Address adr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp); + __ cmpl(as_Register($src$$reg), adr); + %} + ins_pipe(ialu_cr_reg_mem); +%} + instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{ match(Set cr (CmpN src zero)); - format %{ "testl $src, $src" %} + format %{ "testl $src, $src\t# compressed ptr" %} ins_encode %{ __ testl($src$$Register, $src$$Register); %} ins_pipe(ialu_cr_reg_imm); %} +instruct testN_reg_mem(rFlagsReg cr, memory mem, immN0 zero) +%{ + match(Set cr (CmpN (LoadN mem) zero)); + + ins_cost(500); // XXX + format %{ "testl $mem, 0xffffffff\t# compressed ptr" %} + ins_encode %{ + Address addr = build_address($mem$$base, $mem$$index, $mem$$scale, $mem$$disp); + __ cmpl(addr, (int)0xFFFFFFFF); + %} + ins_pipe(ialu_cr_reg_mem); +%} + // Yanked all unsigned pointer compare operations. // Pointer compares are done with CmpP which is already unsigned. diff --git a/hotspot/src/os/linux/vm/attachListener_linux.cpp b/hotspot/src/os/linux/vm/attachListener_linux.cpp index 81ce1cc976b..f40ac8e8491 100644 --- a/hotspot/src/os/linux/vm/attachListener_linux.cpp +++ b/hotspot/src/os/linux/vm/attachListener_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp index ea0eab9b975..b7951d881b4 100644 --- a/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp +++ b/hotspot/src/os/linux/vm/dtraceJSDT_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/os/linux/vm/hpi_linux.hpp b/hotspot/src/os/linux/vm/hpi_linux.hpp index d14ca94347c..b671a4e7315 100644 --- a/hotspot/src/os/linux/vm/hpi_linux.hpp +++ b/hotspot/src/os/linux/vm/hpi_linux.hpp @@ -70,6 +70,10 @@ inline int hpi::send(int fd, char *buf, int nBytes, int flags) { RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, (unsigned int) flags)); } +inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) { + return send(fd, buf, nBytes, flags); +} + inline int hpi::timeout(int fd, long timeout) { julong prevtime,newtime; struct timeval t; diff --git a/hotspot/src/os/linux/vm/jvm_linux.cpp b/hotspot/src/os/linux/vm/jvm_linux.cpp index dc4d2859c6a..b38ff5c327f 100644 --- a/hotspot/src/os/linux/vm/jvm_linux.cpp +++ b/hotspot/src/os/linux/vm/jvm_linux.cpp @@ -132,7 +132,7 @@ JVM_END */ struct siglabel { - char *name; + const char *name; int number; }; diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index d28700aab88..bc5d9ebc69e 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -75,8 +75,8 @@ int os::Linux::_page_size = -1; bool os::Linux::_is_floating_stack = false; bool os::Linux::_is_NPTL = false; bool os::Linux::_supports_fast_thread_cpu_time = false; -char * os::Linux::_glibc_version = NULL; -char * os::Linux::_libpthread_version = NULL; +const char * os::Linux::_glibc_version = NULL; +const char * os::Linux::_libpthread_version = NULL; static jlong initial_time_count=0; @@ -213,9 +213,9 @@ pid_t os::Linux::gettid() { // the system call returns 1. This causes the VM to act as if it is // a single processor and elide locking (see is_MP() call). static bool unsafe_chroot_detected = false; -static char *unstable_chroot_error = "/proc file system not found.\n" - "Java may be unstable running multithreaded in a chroot " - "environment on Linux when /proc filesystem is not mounted."; +static const char *unstable_chroot_error = "/proc file system not found.\n" + "Java may be unstable running multithreaded in a chroot " + "environment on Linux when /proc filesystem is not mounted."; void os::Linux::initialize_system_info() { _processor_count = sysconf(_SC_NPROCESSORS_CONF); @@ -544,26 +544,23 @@ void os::Linux::libpthread_init() { if (n > 0) { char *str = (char *)malloc(n); confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n); - // Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells // us "NPTL-0.29" even we are running with LinuxThreads. Check if this - // is the case: + // is the case. LinuxThreads has a hard limit on max number of threads. + // So sysconf(_SC_THREAD_THREADS_MAX) will return a positive value. + // On the other hand, NPTL does not have such a limit, sysconf() + // will return -1 and errno is not changed. Check if it is really NPTL. if (strcmp(os::Linux::glibc_version(), "glibc 2.3.2") == 0 && - strstr(str, "NPTL")) { - // LinuxThreads has a hard limit on max number of threads. So - // sysconf(_SC_THREAD_THREADS_MAX) will return a positive value. - // On the other hand, NPTL does not have such a limit, sysconf() - // will return -1 and errno is not changed. Check if it is really - // NPTL: - if (sysconf(_SC_THREAD_THREADS_MAX) > 0) { - free(str); - str = "linuxthreads"; - } + strstr(str, "NPTL") && + sysconf(_SC_THREAD_THREADS_MAX) > 0) { + free(str); + os::Linux::set_libpthread_version("linuxthreads"); + } else { + os::Linux::set_libpthread_version(str); } - os::Linux::set_libpthread_version(str); } else { - // glibc before 2.3.2 only has LinuxThreads. - os::Linux::set_libpthread_version("linuxthreads"); + // glibc before 2.3.2 only has LinuxThreads. + os::Linux::set_libpthread_version("linuxthreads"); } if (strstr(libpthread_version(), "NPTL")) { @@ -2417,8 +2414,20 @@ static bool linux_mprotect(char* addr, size_t size, int prot) { return ::mprotect(bottom, size, prot) == 0; } -bool os::protect_memory(char* addr, size_t size) { - return linux_mprotect(addr, size, PROT_READ); +// Set protections specified +bool os::protect_memory(char* addr, size_t bytes, ProtType prot, + bool is_committed) { + unsigned int p = 0; + switch (prot) { + case MEM_PROT_NONE: p = PROT_NONE; break; + case MEM_PROT_READ: p = PROT_READ; break; + case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break; + case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break; + default: + ShouldNotReachHere(); + } + // is_committed is unused. + return linux_mprotect(addr, bytes, p); } bool os::guard_memory(char* addr, size_t size) { @@ -3707,8 +3716,9 @@ void os::make_polling_page_unreadable(void) { // Mark the polling page as readable void os::make_polling_page_readable(void) { - if( !protect_memory((char *)_polling_page, Linux::page_size()) ) + if( !linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) { fatal("Could not enable polling page"); + } }; int os::active_processor_count() { @@ -4632,11 +4642,7 @@ extern char** environ; // Unlike system(), this function can be called from signal handler. It // doesn't block SIGINT et al. int os::fork_and_exec(char* cmd) { - char * argv[4]; - argv[0] = "sh"; - argv[1] = "-c"; - argv[2] = cmd; - argv[3] = NULL; + const char * argv[4] = {"sh", "-c", cmd, NULL}; // fork() in LinuxThreads/NPTL is not async-safe. It needs to run // pthread_atfork handlers and reset pthread library. All we need is a @@ -4661,7 +4667,7 @@ int os::fork_and_exec(char* cmd) { // IA64 should use normal execve() from glibc to match the glibc fork() // above. NOT_IA64(syscall(__NR_execve, "/bin/sh", argv, environ);) - IA64_ONLY(execve("/bin/sh", argv, environ);) + IA64_ONLY(execve("/bin/sh", (char* const*)argv, environ);) // execve failed _exit(-1); diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index 54fc117311f..baa412501f3 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -52,8 +52,8 @@ class Linux { static address _initial_thread_stack_bottom; static uintptr_t _initial_thread_stack_size; - static char *_glibc_version; - static char *_libpthread_version; + static const char *_glibc_version; + static const char *_libpthread_version; static bool _is_floating_stack; static bool _is_NPTL; @@ -72,8 +72,8 @@ class Linux { static julong physical_memory() { return _physical_memory; } static void initialize_system_info(); - static void set_glibc_version(char *s) { _glibc_version = s; } - static void set_libpthread_version(char *s) { _libpthread_version = s; } + static void set_glibc_version(const char *s) { _glibc_version = s; } + static void set_libpthread_version(const char *s) { _libpthread_version = s; } static bool supports_variable_stack_size(); @@ -134,8 +134,8 @@ class Linux { static bool chained_handler(int sig, siginfo_t* siginfo, void* context); // GNU libc and libpthread version strings - static char *glibc_version() { return _glibc_version; } - static char *libpthread_version() { return _libpthread_version; } + static const char *glibc_version() { return _glibc_version; } + static const char *libpthread_version() { return _libpthread_version; } // NPTL or LinuxThreads? static bool is_LinuxThreads() { return !_is_NPTL; } diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp index 399fa0c4474..6f6d608ae2d 100644 --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp index 8e9be682488..feedb287ada 100644 --- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp +++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os/solaris/dtrace/jhelper.d b/hotspot/src/os/solaris/dtrace/jhelper.d index 19b4c08c2d3..6f2f6165c35 100644 --- a/hotspot/src/os/solaris/dtrace/jhelper.d +++ b/hotspot/src/os/solaris/dtrace/jhelper.d @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os/solaris/dtrace/libjvm_db.c b/hotspot/src/os/solaris/dtrace/libjvm_db.c index 5c133663d4b..ad0031e4b92 100644 --- a/hotspot/src/os/solaris/dtrace/libjvm_db.c +++ b/hotspot/src/os/solaris/dtrace/libjvm_db.c @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp index 49f74216f16..5f05d7c1cd1 100644 --- a/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp +++ b/hotspot/src/os/solaris/vm/dtraceJSDT_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/os/solaris/vm/hpi_solaris.hpp b/hotspot/src/os/solaris/vm/hpi_solaris.hpp index cd5f2eab6ac..8164a8eca9f 100644 --- a/hotspot/src/os/solaris/vm/hpi_solaris.hpp +++ b/hotspot/src/os/solaris/vm/hpi_solaris.hpp @@ -71,6 +71,10 @@ inline int hpi::send(int fd, char *buf, int nBytes, int flags) { INTERRUPTIBLE_RETURN_INT(::send(fd, buf, nBytes, flags), os::Solaris::clear_interrupted); } +inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) { + RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags)); +} + // As both poll and select can be interrupted by signals, we have to be // prepared to restart the system call after updating the timeout, unless // a poll() is done with timeout == -1, in which case we repeat with this diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index ce6765e8d50..b6ca2a6db90 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -2965,10 +2965,21 @@ static bool solaris_mprotect(char* addr, size_t bytes, int prot) { return retVal == 0; } -// Protect memory (make it read-only. (Used to pass readonly pages through +// Protect memory (Used to pass readonly pages through // JNI GetArrayElements with empty arrays.) -bool os::protect_memory(char* addr, size_t bytes) { - return solaris_mprotect(addr, bytes, PROT_READ); +bool os::protect_memory(char* addr, size_t bytes, ProtType prot, + bool is_committed) { + unsigned int p = 0; + switch (prot) { + case MEM_PROT_NONE: p = PROT_NONE; break; + case MEM_PROT_READ: p = PROT_READ; break; + case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break; + case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break; + default: + ShouldNotReachHere(); + } + // is_committed is unused. + return solaris_mprotect(addr, bytes, p); } // guard_memory and unguard_memory only happens within stack guard pages. diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp index 545802ae158..cffe4ee80ac 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp index 3fe038dd6ce..0c640973e61 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp index 8f8986a98a2..9ef18dfdb59 100644 --- a/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp +++ b/hotspot/src/os/windows/vm/dtraceJSDT_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/os/windows/vm/hpi_windows.hpp b/hotspot/src/os/windows/vm/hpi_windows.hpp index 1398950c85b..663654f0774 100644 --- a/hotspot/src/os/windows/vm/hpi_windows.hpp +++ b/hotspot/src/os/windows/vm/hpi_windows.hpp @@ -102,6 +102,10 @@ HPIDECL(send, "send", _socket, Send, int, "%d", fd, buf, nBytes, flags), (fd, buf, nBytes, flags)); +inline int hpi::raw_send(int fd, char *buf, int nBytes, int flags) { + return send(fd, buf, nBytes, flags); +} + HPIDECL(timeout, "timeout", _socket, Timeout, int, "%d", (int fd, long timeout), ("fd = %d, timeout = %ld", fd, timeout), diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index a114b894690..14b3141d27e 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -2170,6 +2170,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // Windows 98 reports faulting addresses incorrectly if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) || !os::win32::is_nt()) { + return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL)); } @@ -2563,9 +2564,33 @@ bool os::release_memory(char* addr, size_t bytes) { return VirtualFree(addr, 0, MEM_RELEASE) != 0; } -bool os::protect_memory(char* addr, size_t bytes) { +// Set protections specified +bool os::protect_memory(char* addr, size_t bytes, ProtType prot, + bool is_committed) { + unsigned int p = 0; + switch (prot) { + case MEM_PROT_NONE: p = PAGE_NOACCESS; break; + case MEM_PROT_READ: p = PAGE_READONLY; break; + case MEM_PROT_RW: p = PAGE_READWRITE; break; + case MEM_PROT_RWX: p = PAGE_EXECUTE_READWRITE; break; + default: + ShouldNotReachHere(); + } + DWORD old_status; - return VirtualProtect(addr, bytes, PAGE_READONLY, &old_status) != 0; + + // Strange enough, but on Win32 one can change protection only for committed + // memory, not a big deal anyway, as bytes less or equal than 64K + if (!is_committed && !commit_memory(addr, bytes)) { + fatal("cannot commit protection page"); + } + // One cannot use os::guard_memory() here, as on Win32 guard page + // have different (one-shot) semantics, from MSDN on PAGE_GUARD: + // + // Pages in the region become guard pages. Any attempt to access a guard page + // causes the system to raise a STATUS_GUARD_PAGE exception and turn off + // the guard page status. Guard pages thus act as a one-time access alarm. + return VirtualProtect(addr, bytes, p, &old_status) != 0; } bool os::guard_memory(char* addr, size_t bytes) { diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 26be952c03f..49dc4e75d5c 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp index 7ffae8d17ea..0fcd3b0d6d8 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/assembler_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -27,12 +27,6 @@ #include -bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { - // Since the linux kernel resides at the low end of - // user address space, no null pointer check is needed. - return offset < 0 || offset >= 0x100000; -} - void MacroAssembler::read_ccr_trap(Register ccr_save) { // No implementation breakpoint_trap(); diff --git a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp index a932a1079bc..3dc9842c623 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/atomic_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp index 4f2693db8ed..ccc884e8329 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.ad b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.ad index 33288c5df2c..1f768790289 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.ad +++ b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.ad @@ -1,5 +1,5 @@ // -// Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1999-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s index dda3d05563e..ec5e2cd7139 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s +++ b/hotspot/src/os_cpu/linux_sparc/vm/linux_sparc.s @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp index 9b39f98fb22..44b0d2c83f2 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/orderAccess_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index cc209852554..2226285c0e7 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp index 0a88fef95e2..4c74a6af6ab 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp b/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp index 250704ff5d9..8a14e013c53 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/prefetch_linux_sparc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp index a2c536cfc53..a3cfcb09666 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp index 5cfa7ee8647..a301a243106 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/threadLS_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp index 1c8a030d0d7..bcb8442b4d4 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp index 14ece634631..38779d09f0f 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/thread_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp index 5358d213c65..30036c490a4 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/vmStructs_linux_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp index 34bd7c82c99..9a15150502e 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 diff --git a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp index e35442d61b5..1854b007516 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -39,10 +39,3 @@ void MacroAssembler::get_thread(Register thread) { movptr(thread, tls); } - -bool MacroAssembler::needs_explicit_null_check(int offset) { - // Linux kernel guarantees that the first page is always unmapped. Don't - // assume anything more than that. - bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size(); - return !offset_in_first_page; -} diff --git a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp index 02ad9e4bdd8..24a4dce09e4 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -65,9 +65,3 @@ void MacroAssembler::get_thread(Register thread) { popq(rax); } } - -// NOTE: since the linux kernel resides at the low end of -// user address space, no null pointer check is needed. -bool MacroAssembler::needs_explicit_null_check(int offset) { - return offset < 0 || offset >= 0x100000; -} diff --git a/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp index f0e0d5c4775..fb36b9379f1 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp +++ b/hotspot/src/os_cpu/linux_x86/vm/bytes_linux_x86.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index d598333157e..174c1df492e 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp index 8e18dde9c31..caab18f5dcd 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/assembler_solaris_sparc.cpp @@ -28,18 +28,6 @@ #include // For trap numbers #include // For V8 compatibility -bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { - // The first page of virtual addresses is unmapped on SPARC. - // Thus, any access the VM makes through a null pointer with an offset of - // less than 4K will get a recognizable SIGSEGV, which the signal handler - // will transform into a NullPointerException. - // (Actually, the first 64K or so is unmapped, but it's simpler - // to depend only on the first 4K or so.) - - bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size(); - return !offset_in_first_page; -} - void MacroAssembler::read_ccr_trap(Register ccr_save) { // Execute a trap to get the PSR, mask and shift // to get the condition codes. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s index 411fdcdabf0..4762af983f4 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s +++ b/hotspot/src/os_cpu/solaris_sparc/vm/solaris_sparc.s @@ -1,5 +1,5 @@ !! -!! Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +!! Copyright 2005-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 diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp index 1896130226f..2b6c743dc12 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp index 2f877bfce47..bce611c1125 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -79,9 +79,3 @@ void MacroAssembler::get_thread(Register thread) { if (thread != rax) popl(rax); popl(thread); } - -bool MacroAssembler::needs_explicit_null_check(int offset) { - // Identical to Sparc/Solaris code - bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size(); - return !offset_in_first_page; -} diff --git a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp index b6c210f93b8..2ccae8a683d 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 @@ -85,9 +85,3 @@ void MacroAssembler::get_thread(Register thread) { popq(rax); } } - -bool MacroAssembler::needs_explicit_null_check(int offset) { - // Identical to Sparc/Solaris code - bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size(); - return !offset_in_first_page; -} 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 34365dfaee9..b21206dd227 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp index 06c9aed2e85..bc4b56b2d89 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp index dd90d704fea..5e91ce654f8 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -58,7 +58,3 @@ void MacroAssembler::get_thread(Register thread) { "Thread Pointer Offset has not been initialized"); movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset())); } - -bool MacroAssembler::needs_explicit_null_check(int offset) { - return offset < 0 || (int)os::vm_page_size() <= offset; -} diff --git a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp index c0211d0afd8..7ff190fb21b 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -65,7 +65,3 @@ void MacroAssembler::get_thread(Register thread) { popq(rax); } } - -bool MacroAssembler::needs_explicit_null_check(int offset) { - return offset < 0 || (int)os::vm_page_size() <= offset; -} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/build.xml new file mode 100644 index 00000000000..2c8642cfb1a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.svg. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/manifest.mf new file mode 100644 index 00000000000..689e17a01e8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.svg +OpenIDE-Module-Layer: com/sun/hotspot/igv/svg/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/svg/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/build-impl.xml new file mode 100644 index 00000000000..5fe569eec79 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/genfiles.properties new file mode 100644 index 00000000000..5018df1e656 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=ebcf0422 +build.xml.script.CRC32=d7a2678d +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=ebcf0422 +nbproject/build-impl.xml.script.CRC32=57997f94 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.xml new file mode 100644 index 00000000000..3939a84a094 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.svg + + + + com.sun.hotspot.igv.svg + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/BatikSVG.java b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/BatikSVG.java new file mode 100644 index 00000000000..8326ff11009 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/BatikSVG.java @@ -0,0 +1,86 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.svg; + +import java.awt.Graphics2D; +import java.io.Writer; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import org.w3c.dom.DOMImplementation; + +/** + * + * @author Thomas Wuerthinger + */ +public class BatikSVG { + + private static Constructor SVGGraphics2DConstructor; + private static Method Method_stream; + private static Method Method_createDefault; + private static Method Method_getDOMImplementation; + private static Method Method_setEmbeddedFontsOn; + + public static Graphics2D createGraphicsObject() { + try { + if (SVGGraphics2DConstructor == null) { + ClassLoader cl = BatikSVG.class.getClassLoader(); + Class Class_GenericDOMImplementation = cl.loadClass("org.apache.batik.dom.GenericDOMImplementation"); + Class Class_SVGGeneratorContext = cl.loadClass("org.apache.batik.svggen.SVGGeneratorContext"); + Class Class_SVGGraphics2D = cl.loadClass("org.apache.batik.svggen.SVGGraphics2D"); + Method_getDOMImplementation = Class_GenericDOMImplementation.getDeclaredMethod("getDOMImplementation", new Class[0]); + Method_createDefault = Class_SVGGeneratorContext.getDeclaredMethod("createDefault", new Class[]{org.w3c.dom.Document.class}); + Method_setEmbeddedFontsOn = Class_SVGGeneratorContext.getDeclaredMethod("setEmbeddedFontsOn", new Class[]{boolean.class}); + Method_stream = Class_SVGGraphics2D.getDeclaredMethod("stream", Writer.class, boolean.class); + SVGGraphics2DConstructor = Class_SVGGraphics2D.getConstructor(Class_SVGGeneratorContext, boolean.class); + } + DOMImplementation dom = (DOMImplementation) Method_getDOMImplementation.invoke(null); + org.w3c.dom.Document document = dom.createDocument("http://www.w3.org/2000/svg", "svg", null); + Object ctx = Method_createDefault.invoke(null, document); + Method_setEmbeddedFontsOn.invoke(ctx, true); + Graphics2D svgGenerator = (Graphics2D) SVGGraphics2DConstructor.newInstance(ctx, true); + return svgGenerator; + } catch (ClassNotFoundException e) { + return null; + } catch (NoSuchMethodException e) { + return null; + } catch (IllegalAccessException e) { + return null; + } catch (InvocationTargetException e) { + return null; + } catch (InstantiationException e) { + return null; + } + } + + public static void printToStream(Graphics2D svgGenerator, Writer stream, boolean useCSS) { + try { + Method_stream.invoke(svgGenerator, stream, useCSS); + } catch (IllegalAccessException e) { + assert false; + } catch (InvocationTargetException e) { + assert false; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/Bundle.properties new file mode 100644 index 00000000000..e579912925b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=BatikSVGProxy diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/layer.xml new file mode 100644 index 00000000000..c16a8a0fed6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/BatikSVGProxy/src/com/sun/hotspot/igv/svg/layer.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/build.xml new file mode 100644 index 00000000000..1466d8606bc --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.bytecodes. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/manifest.mf new file mode 100644 index 00000000000..a04660a02f9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.bytecodes +OpenIDE-Module-Layer: com/sun/hotspot/igv/bytecodes/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/bytecodes/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/build-impl.xml new file mode 100644 index 00000000000..4991499c388 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/genfiles.properties new file mode 100644 index 00000000000..a60cd07cac9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1dee290d +build.xml.script.CRC32=d594034f +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=1dee290d +nbproject/build-impl.xml.script.CRC32=b4dab126 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.xml new file mode 100644 index 00000000000..91bd8120565 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/project.xml @@ -0,0 +1,62 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.bytecodes + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.openide.explorer + + + + 6.11 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.windows + + + + 6.16 + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/Bundle.properties new file mode 100644 index 00000000000..cd6852f9dd9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/Bundle.properties @@ -0,0 +1,5 @@ +CTL_BytecodeViewAction=Open BytecodeView Window +CTL_BytecodeViewTopComponent=BytecodeView Window +CTL_SelectBytecodesAction=Select nodes +HINT_BytecodeViewTopComponent=This is a BytecodeView window +OpenIDE-Module-Name=Bytecodes diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeNode.java new file mode 100644 index 00000000000..f9d1aa0ec72 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeNode.java @@ -0,0 +1,100 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import com.sun.hotspot.igv.data.InputBytecode; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.StringPropertyMatcher; +import java.awt.Image; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.swing.Action; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.util.Utilities; + +/** + * + * @author Thomas Wuerthinger + */ +public class BytecodeNode extends AbstractNode { + + private Set nodes; + + public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) { + + super(Children.LEAF); + this.setDisplayName(bytecode.getBci() + " " + bytecode.getName()); + + bciValue = bytecode.getBci() + " " + bciValue; + bciValue = bciValue.trim(); + + Properties.PropertySelector selector = new Properties.PropertySelector(graph.getNodes()); + StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue); + List nodeList = selector.selectMultiple(matcher); + if (nodeList.size() > 0) { + nodes = new HashSet(); + for (InputNode n : nodeList) { + nodes.add(n); + } + this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)"); + } + } + + @Override + public Image getIcon(int i) { + if (nodes != null) { + return Utilities.loadImage("com/sun/hotspot/igv/bytecodes/images/link.gif"); + } else { + return Utilities.loadImage("com/sun/hotspot/igv/bytecodes/images/bytecode.gif"); + } + } + + @Override + public Image getOpenedIcon(int i) { + return getIcon(i); + } + + @Override + public Action[] getActions(boolean b) { + return new Action[]{(Action) SelectBytecodesAction.findObject(SelectBytecodesAction.class, true)}; + } + + @Override + public Action getPreferredAction() { + return (Action) SelectBytecodesAction.findObject(SelectBytecodesAction.class, true); + } + + @Override + public T getCookie(Class aClass) { + if (aClass == SelectBytecodesCookie.class && nodes != null) { + return (T) (new SelectBytecodesCookie(nodes)); + } + return super.getCookie(aClass); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewAction.java new file mode 100644 index 00000000000..df7b398e54d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewAction.java @@ -0,0 +1,45 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import org.openide.util.NbBundle; +import org.openide.windows.TopComponent; + +/** + * @author Thomas Wuerthinger + */ +public class BytecodeViewAction extends AbstractAction { + + public BytecodeViewAction() { + super(NbBundle.getMessage(BytecodeViewAction.class, "CTL_BytecodeViewAction")); + } + + public void actionPerformed(ActionEvent evt) { + TopComponent win = BytecodeViewTopComponent.findInstance(); + win.open(); + win.requestActive(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.form b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.form new file mode 100644 index 00000000000..c2549ecaf63 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.form @@ -0,0 +1,26 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java new file mode 100644 index 00000000000..6fbbe90e912 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java @@ -0,0 +1,172 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import java.awt.BorderLayout; +import java.io.Serializable; +import org.openide.ErrorManager; +import org.openide.explorer.ExplorerManager; +import org.openide.explorer.ExplorerUtils; +import org.openide.explorer.view.BeanTreeView; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; + +/** + * @author Thomas Wuerthinger + */ +final class BytecodeViewTopComponent extends TopComponent implements ExplorerManager.Provider, LookupListener { + + private static BytecodeViewTopComponent instance; + private static final String PREFERRED_ID = "BytecodeViewTopComponent"; + private ExplorerManager manager; + private BeanTreeView treeView; + private Lookup.Result result = null; + private MethodNode rootNode; + + private BytecodeViewTopComponent() { + initComponents(); + setName(NbBundle.getMessage(BytecodeViewTopComponent.class, "CTL_BytecodeViewTopComponent")); + setToolTipText(NbBundle.getMessage(BytecodeViewTopComponent.class, "HINT_BytecodeViewTopComponent")); + + manager = new ExplorerManager(); + rootNode = new MethodNode(null, null, ""); + manager.setRootContext(rootNode); + + setLayout(new BorderLayout()); + + treeView = new BeanTreeView(); + treeView.setRootVisible(false); + this.add(BorderLayout.CENTER, treeView); + associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + /** + * Gets default instance. Do not use directly: reserved for *.settings files only, + * i.e. deserialization routines; otherwise you could get a non-deserialized instance. + * To obtain the singleton instance, use {@link findInstance}. + */ + public static synchronized BytecodeViewTopComponent getDefault() { + if (instance == null) { + instance = new BytecodeViewTopComponent(); + } + return instance; + } + + /** + * Obtain the BytecodeViewTopComponent instance. Never call {@link #getDefault} directly! + */ + public static synchronized BytecodeViewTopComponent findInstance() { + TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (win == null) { + ErrorManager.getDefault().log(ErrorManager.WARNING, "Cannot find BytecodeView component. It will not be located properly in the window system."); + return getDefault(); + } + if (win instanceof BytecodeViewTopComponent) { + return (BytecodeViewTopComponent) win; + } + ErrorManager.getDefault().log(ErrorManager.WARNING, "There seem to be multiple components with the '" + PREFERRED_ID + "' ID. That is a potential source of errors and unexpected behavior."); + return getDefault(); + } + + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_ALWAYS; + } + + @Override + public void componentOpened() { + Lookup.Template tpl = new Lookup.Template(Object.class); + result = Utilities.actionsGlobalContext().lookup(tpl); + result.addLookupListener(this); + } + + @Override + public void componentClosed() { + result.removeLookupListener(this); + result = null; + } + + @Override + public Object writeReplace() { + return new ResolvableHelper(); + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + public ExplorerManager getExplorerManager() { + return manager; + } + + public void resultChanged(LookupEvent lookupEvent) { + InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + if (p != null) { + InputGraph graph = p.getGraph(); + if (graph != null) { + Group g = graph.getGroup(); + rootNode.update(graph, g.getMethod()); + } + } + } + + final static class ResolvableHelper implements Serializable { + + private static final long serialVersionUID = 1L; + + public Object readResolve() { + return BytecodeViewTopComponent.getDefault(); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentSettings.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentSettings.xml new file mode 100644 index 00000000000..d9469aba6b1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentSettings.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentWstcref.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentWstcref.xml new file mode 100644 index 00000000000..a680c8f02fe --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponentWstcref.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/MethodNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/MethodNode.java new file mode 100644 index 00000000000..b8f777e851e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/MethodNode.java @@ -0,0 +1,102 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import com.sun.hotspot.igv.data.InputBytecode; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputMethod; +import java.awt.Image; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.util.Utilities; + +/** + * + * @author Thomas Wuerthinger + */ +public class MethodNode extends AbstractNode { + + private static class MethodNodeChildren extends Children.Keys { + + private InputMethod method; + private InputGraph graph; + private String bciString; + + public MethodNodeChildren(InputMethod method, InputGraph graph, String bciString) { + this.method = method; + this.bciString = bciString; + this.graph = graph; + } + + protected Node[] createNodes(Object object) { + assert object instanceof InputBytecode; + InputBytecode bc = (InputBytecode) object; + if (bc.getInlined() == null) { + return new Node[]{new BytecodeNode(bc, graph, bciString)}; + } else { + return new Node[]{new BytecodeNode(bc, graph, bciString), new MethodNode(bc.getInlined(), graph, bc.getBci() + " " + bciString)}; + } + } + + @Override + public void addNotify() { + if (method != null) { + setKeys(method.getBytecodes()); + } + } + + public void setMethod(InputMethod method, InputGraph graph) { + this.method = method; + this.graph = graph; + addNotify(); + } + } + + /** Creates a new instance of MethodNode */ + public MethodNode(InputMethod method, InputGraph graph, String bciString) { + super((method != null && method.getBytecodes().size() == 0) ? Children.LEAF : new MethodNodeChildren(method, graph, bciString)); + if (method != null) { + this.setDisplayName(method.getName()); + } + } + + @Override + public Image getIcon(int i) { + return Utilities.loadImage("com/sun/hotspot/igv/bytecodes/images/method.gif"); + } + + @Override + public Image getOpenedIcon(int i) { + return getIcon(i); + } + + public void update(InputGraph graph, InputMethod method) { + ((MethodNodeChildren) this.getChildren()).setMethod(method, graph); + if (method != null) { + this.setDisplayName(method.getName()); + } + + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesAction.java new file mode 100644 index 00000000000..317e3a0fbfe --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesAction.java @@ -0,0 +1,75 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class SelectBytecodesAction extends CookieAction { + + protected void performAction(Node[] activatedNodes) { + SelectBytecodesCookie c = activatedNodes[0].getCookie(SelectBytecodesCookie.class); + InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + if (p != null) { + p.setSelectedNodes(c.getNodes()); + } + } + + protected int mode() { + return CookieAction.MODE_EXACTLY_ONE; + } + + public String getName() { + return NbBundle.getMessage(SelectBytecodesAction.class, "CTL_SelectBytecodesAction"); + } + + protected Class[] cookieClasses() { + return new Class[]{ + SelectBytecodesCookie.class + }; + } + + @Override + protected void initialize() { + super.initialize(); + putValue("noIconInMenu", Boolean.TRUE); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesCookie.java b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesCookie.java new file mode 100644 index 00000000000..ff48bbb49ac --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/SelectBytecodesCookie.java @@ -0,0 +1,47 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.bytecodes; + +import com.sun.hotspot.igv.data.InputNode; +import java.util.Collections; +import java.util.Set; +import org.openide.nodes.Node; + +/** + * + * @author Thomas Wuerthinger + */ +public class SelectBytecodesCookie implements Node.Cookie { + + private Set nodes; + + /** Creates a new instance of SelectBytecodesCookie */ + public SelectBytecodesCookie(Set nodes) { + this.nodes = nodes; + } + + public Set getNodes() { + return Collections.unmodifiableSet(nodes); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/bytecode.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/bytecode.gif new file mode 100644 index 00000000000..5a2a355e391 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/bytecode.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/link.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/link.gif new file mode 100644 index 00000000000..fc6595b2c98 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/link.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/method.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/method.gif new file mode 100644 index 00000000000..dc90fd03877 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/images/method.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/layer.xml new file mode 100644 index 00000000000..de53ae1da33 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Bytecodes/src/com/sun/hotspot/igv/bytecodes/layer.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/build.xml new file mode 100644 index 00000000000..b90d3b8b143 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.controlflow. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/manifest.mf new file mode 100644 index 00000000000..3ed19068d76 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.controlflow +OpenIDE-Module-Layer: com/sun/hotspot/igv/controlflow/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/controlflow/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/build-impl.xml new file mode 100644 index 00000000000..1664c75b0dc --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/genfiles.properties new file mode 100644 index 00000000000..ba61dc52aba --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=b524efb3 +build.xml.script.CRC32=79a27be9 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=b524efb3 +nbproject/build-impl.xml.script.CRC32=582bdab7 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.xml new file mode 100644 index 00000000000..212cf234593 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/project.xml @@ -0,0 +1,70 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.controlflow + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.hierarchicallayout + + + + 1.0 + + + + com.sun.hotspot.igv.layout + + + + 1.0 + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.api.visual + + + + 2.9 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.windows + + + + 6.16 + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockConnectionWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockConnectionWidget.java new file mode 100644 index 00000000000..d1e9b9b9c60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockConnectionWidget.java @@ -0,0 +1,83 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import com.sun.hotspot.igv.data.InputBlockEdge; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; +import org.netbeans.api.visual.widget.ConnectionWidget; + +/** + * + * @author Thomas Wuerthinger + */ +public class BlockConnectionWidget extends ConnectionWidget implements Link { + + private BlockWidget from; + private BlockWidget to; + private Port inputSlot; + private Port outputSlot; + private List points; + private InputBlockEdge edge; + + public BlockConnectionWidget(ControlFlowScene scene, InputBlockEdge edge) { + super(scene); + + this.edge = edge; + this.from = (BlockWidget) scene.findWidget(edge.getFrom()); + this.to = (BlockWidget) scene.findWidget(edge.getTo()); + inputSlot = to.getInputSlot(); + outputSlot = from.getOutputSlot(); + points = new ArrayList(); + } + + public InputBlockEdge getEdge() { + return edge; + } + + public Port getTo() { + return inputSlot; + } + + public Port getFrom() { + return outputSlot; + } + + public void setControlPoints(List p) { + this.points = p; + } + + @Override + public List getControlPoints() { + return points; + } + + @Override + public String toString() { + return "Connection[ " + from.toString() + " - " + to.toString() + "]"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockWidget.java new file mode 100644 index 00000000000..c56e93e7313 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/BlockWidget.java @@ -0,0 +1,160 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Point; +import org.netbeans.api.visual.border.BorderFactory; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.LabelWidget; + +/** + * + * @author Thomas Wuerthinger + */ +public class BlockWidget extends LabelWidget implements Vertex { + + public static final Dimension SIZE = new Dimension(20, 20); + private InputBlock block; + private Port inputSlot; + private Port outputSlot; + private Cluster cluster; + private boolean root; + private static final Font font = new Font(Font.SERIF, Font.PLAIN, 12); + private static final Font boldFont = font.deriveFont(Font.BOLD); + public static final Color NORMAL_FOREGROUND_COLOR = Color.BLACK; + public static final Color HOVER_FOREGROUND_COLOR = Color.BLUE; + + /** Creates a new instance of BlockWidget */ + public BlockWidget(ControlFlowScene scene, InputBlock block) { + super(scene); + this.block = block; + this.setLabel(block.getName()); + this.setForeground(NORMAL_FOREGROUND_COLOR); + this.setBorder(BorderFactory.createLineBorder(1, NORMAL_FOREGROUND_COLOR)); + this.setMinimumSize(SIZE); + this.setMaximumSize(SIZE); + + this.setFont(font); + + final BlockWidget widget = this; + inputSlot = new Port() { + + public Point getRelativePosition() { + return new Point((int) (SIZE.getWidth() / 2), (int) (SIZE.getHeight() / 2)); + } + + public Vertex getVertex() { + return widget; + } + }; + + outputSlot = new Port() { + + public Point getRelativePosition() { + return new Point((int) (SIZE.getWidth() / 2), (int) (SIZE.getHeight() / 2)); + } + + public Vertex getVertex() { + return widget; + } + }; + } + + public Port getInputSlot() { + return inputSlot; + } + + public Port getOutputSlot() { + return outputSlot; + } + + public InputBlock getBlock() { + return block; + } + + public Dimension getSize() { + return SIZE; + } + + public void setPosition(Point p) { + this.setPreferredLocation(p); + } + + @Override + public String toString() { + return block.getName(); + } + + public Point getPosition() { + return this.getPreferredLocation(); + } + + public Cluster getCluster() { + return cluster; + } + + public boolean isRoot() { + return root; + } + + public void setCluster(Cluster c) { + cluster = c; + } + + public void setRoot(boolean b) { + root = b; + } + + public int compareTo(Vertex o) { + return toString().compareTo(o.toString()); + } + + @Override + protected void notifyStateChanged(ObjectState previousState, ObjectState state) { + super.notifyStateChanged(previousState, state); + + if (previousState.isHovered() != state.isHovered()) { + if (state.isHovered()) { + this.setBorder(BorderFactory.createLineBorder(1, HOVER_FOREGROUND_COLOR)); + } else { + this.setBorder(BorderFactory.createLineBorder(1, NORMAL_FOREGROUND_COLOR)); + } + } + + if (previousState.isSelected() != state.isSelected()) { + if (state.isSelected()) { + this.setFont(boldFont); + } else { + this.setFont(font); + } + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/Bundle.properties new file mode 100644 index 00000000000..31865f13af1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/Bundle.properties @@ -0,0 +1,4 @@ +CTL_ControlFlowAction=Open ControlFlow Window +CTL_ControlFlowTopComponent=ControlFlow Window +HINT_ControlFlowTopComponent=This is a ControlFlow window +OpenIDE-Module-Name=ControlFlow diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowAction.java new file mode 100644 index 00000000000..bafde102313 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowAction.java @@ -0,0 +1,46 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import org.openide.util.NbBundle; +import org.openide.windows.TopComponent; + +/** + * + * @author Thomas Wuerthinger + */ +public class ControlFlowAction extends AbstractAction { + + public ControlFlowAction() { + super(NbBundle.getMessage(ControlFlowAction.class, "CTL_ControlFlowAction")); + } + + public void actionPerformed(ActionEvent evt) { + TopComponent win = ControlFlowTopComponent.findInstance(); + win.open(); + win.requestActive(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java new file mode 100644 index 00000000000..8b794b11aa5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowScene.java @@ -0,0 +1,296 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputBlockEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import com.sun.hotspot.igv.data.InputNode; +import java.awt.Color; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Set; +import javax.swing.BorderFactory; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.MoveProvider; +import org.netbeans.api.visual.action.RectangularSelectDecorator; +import org.netbeans.api.visual.action.RectangularSelectProvider; +import org.netbeans.api.visual.action.SelectProvider; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.anchor.AnchorFactory; +import org.netbeans.api.visual.anchor.AnchorShape; +import com.sun.hotspot.igv.controlflow.HierarchicalGraphLayout; +import org.netbeans.api.visual.layout.LayoutFactory; +import org.netbeans.api.visual.router.RouterFactory; +import org.netbeans.api.visual.widget.LayerWidget; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.graph.GraphScene; +import org.netbeans.api.visual.graph.layout.GraphLayout; +import org.netbeans.api.visual.layout.SceneLayout; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +public class ControlFlowScene extends GraphScene implements SelectProvider, MoveProvider, RectangularSelectDecorator, RectangularSelectProvider { + + private Set selection; + private Hashtable blockMap; + private InputGraph oldGraph; + private LayerWidget edgeLayer; + private LayerWidget mainLayer; + private LayerWidget selectLayer; + private WidgetAction hoverAction = this.createWidgetHoverAction(); + private WidgetAction selectAction = ActionFactory.createSelectAction(this); + private WidgetAction moveAction = ActionFactory.createMoveAction(null, this); + + public ControlFlowScene() { + selection = new HashSet(); + + this.getInputBindings().setZoomActionModifiers(0); + this.setLayout(LayoutFactory.createAbsoluteLayout()); + + mainLayer = new LayerWidget(this); + this.addChild(mainLayer); + + edgeLayer = new LayerWidget(this); + this.addChild(edgeLayer); + + selectLayer = new LayerWidget(this); + this.addChild(selectLayer); + + this.getActions().addAction(hoverAction); + this.getActions().addAction(selectAction); + this.getActions().addAction(ActionFactory.createRectangularSelectAction(this, selectLayer, this)); + this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1)); + } + + public void setGraph(InputGraph g) { + if (g == oldGraph) { + return; + } + oldGraph = g; + + ArrayList blocks = new ArrayList(this.getNodes()); + for (InputBlock b : blocks) { + removeNode(b); + } + + ArrayList edges = new ArrayList(this.getEdges()); + for (InputBlockEdge e : edges) { + removeEdge(e); + } + + for (InputBlock b : g.getBlocks()) { + addNode(b); + } + + for (InputBlock b : g.getBlocks()) { + for (InputBlockEdge e : b.getOutputs()) { + addEdge(e); + assert g.getBlocks().contains(e.getFrom()); + assert g.getBlocks().contains(e.getTo()); + this.setEdgeSource(e, e.getFrom()); + this.setEdgeTarget(e, e.getTo()); + } + } + + GraphLayout layout = new HierarchicalGraphLayout();//GridGraphLayout(); + SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(this, layout); + sceneLayout.invokeLayout(); + + this.validate(); + } + + public BlockWidget getBlockWidget(InputBlock b) { + return blockMap.get(b); + } + + public void clearSelection() { + for (BlockWidget w : selection) { + w.setState(w.getState().deriveSelected(false)); + } + selection.clear(); + selectionChanged(); + } + + public void selectionChanged() { + InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + if (p != null) { + Set inputNodes = new HashSet(); + for (BlockWidget w : selection) { + inputNodes.addAll(w.getBlock().getNodes()); + } + p.setSelectedNodes(inputNodes); + } + } + + public void addToSelection(BlockWidget widget) { + widget.setState(widget.getState().deriveSelected(true)); + selection.add(widget); + selectionChanged(); + } + + public void removeFromSelection(BlockWidget widget) { + widget.setState(widget.getState().deriveSelected(false)); + selection.remove(widget); + selectionChanged(); + } + + public boolean isAimingAllowed(Widget widget, Point point, boolean b) { + return false; + } + + public boolean isSelectionAllowed(Widget widget, Point point, boolean b) { + return true; + } + + public void select(Widget widget, Point point, boolean change) { + if (widget == this) { + clearSelection(); + } else { + + assert widget instanceof BlockWidget; + BlockWidget bw = (BlockWidget) widget; + if (change) { + if (selection.contains(bw)) { + removeFromSelection(bw); + } else { + addToSelection(bw); + } + } else { + if (!selection.contains(bw)) { + clearSelection(); + addToSelection(bw); + } + } + } + } + + public void movementStarted(Widget widget) { + } + + public void movementFinished(Widget widget) { + } + + public Point getOriginalLocation(Widget widget) { + return widget.getPreferredLocation(); + } + + public void setNewLocation(Widget widget, Point location) { + Point originalLocation = getOriginalLocation(widget); + int xOffset = location.x - originalLocation.x; + int yOffset = location.y - originalLocation.y; + for (Widget w : this.selection) { + Point p = new Point(w.getPreferredLocation()); + p.translate(xOffset, yOffset); + w.setPreferredLocation(p); + } + + } + + public Widget createSelectionWidget() { + Widget widget = new Widget(this); + widget.setOpaque(false); + widget.setBorder(BorderFactory.createLineBorder(Color.black, 2)); + widget.setForeground(Color.red); + return widget; + } + + public void performSelection(Rectangle rectangle) { + + if (rectangle.width < 0) { + rectangle.x += rectangle.width; + rectangle.width *= -1; + } + + if (rectangle.height < 0) { + rectangle.y += rectangle.height; + rectangle.height *= -1; + } + + boolean changed = false; + for (InputBlock b : this.getNodes()) { + BlockWidget w = (BlockWidget) findWidget(b); + Rectangle r = new Rectangle(w.getBounds()); + r.setLocation(w.getLocation()); + if (r.intersects(rectangle)) { + if (!selection.contains(w)) { + changed = true; + selection.add(w); + w.setState(w.getState().deriveSelected(true)); + } + } else { + if (selection.contains(w)) { + changed = true; + selection.remove(w); + w.setState(w.getState().deriveSelected(false)); + } + } + } + + if (changed) { + selectionChanged(); + } + + } + + protected Widget attachNodeWidget(InputBlock node) { + BlockWidget w = new BlockWidget(this, node); + mainLayer.addChild(w); + w.getActions().addAction(hoverAction); + w.getActions().addAction(selectAction); + w.getActions().addAction(moveAction); + return w; + } + + protected Widget attachEdgeWidget(InputBlockEdge edge) { + ConnectionWidget w = new BlockConnectionWidget(this, edge); + w.setRouter(RouterFactory.createDirectRouter()); + w.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED); + edgeLayer.addChild(w); + return w; + } + + protected void attachEdgeSourceAnchor(InputBlockEdge edge, InputBlock oldSourceNode, InputBlock sourceNode) { + Widget w = this.findWidget(edge); + assert w instanceof ConnectionWidget; + ConnectionWidget cw = (ConnectionWidget) w; + cw.setSourceAnchor(AnchorFactory.createRectangularAnchor(findWidget(sourceNode))); + + } + + protected void attachEdgeTargetAnchor(InputBlockEdge edge, InputBlock oldTargetNode, InputBlock targetNode) { + Widget w = this.findWidget(edge); + assert w instanceof ConnectionWidget; + ConnectionWidget cw = (ConnectionWidget) w; + cw.setTargetAnchor(AnchorFactory.createRectangularAnchor(findWidget(targetNode))); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.form b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.form new file mode 100644 index 00000000000..c2549ecaf63 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.form @@ -0,0 +1,26 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java new file mode 100644 index 00000000000..968cdd531b7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java @@ -0,0 +1,179 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import java.awt.BorderLayout; +import java.io.Serializable; +import javax.swing.JScrollPane; +import org.openide.ErrorManager; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; + +/** + * + * @author Thomas Wuerthinger + */ +final class ControlFlowTopComponent extends TopComponent implements LookupListener { + + private static ControlFlowTopComponent instance; + private Lookup.Result result = null; + private static final String PREFERRED_ID = "ControlFlowTopComponent"; + private ControlFlowScene scene; + + private ControlFlowTopComponent() { + initComponents(); + setName(NbBundle.getMessage(ControlFlowTopComponent.class, "CTL_ControlFlowTopComponent")); + setToolTipText(NbBundle.getMessage(ControlFlowTopComponent.class, "HINT_ControlFlowTopComponent")); + + scene = new ControlFlowScene(); + this.setLayout(new BorderLayout()); + this.associateLookup(scene.getLookup()); + + + JScrollPane panel = new JScrollPane(scene.createView()); + this.add(panel, BorderLayout.CENTER); + } + + @Override + public void requestFocus() { + super.requestFocus(); + scene.getView().requestFocus(); + } + + @Override + public boolean requestFocusInWindow() { + super.requestFocusInWindow(); + return scene.getView().requestFocusInWindow(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(0, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + /** + * Gets default instance. Do not use directly: reserved for *.settings files only, + * i.e. deserialization routines; otherwise you could get a non-deserialized instance. + * To obtain the singleton instance, use {@link findInstance}. + */ + public static synchronized ControlFlowTopComponent getDefault() { + if (instance == null) { + instance = new ControlFlowTopComponent(); + } + return instance; + } + + /** + * Obtain the ControlFlowTopComponent instance. Never call {@link #getDefault} directly! + */ + public static synchronized ControlFlowTopComponent findInstance() { + TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (win == null) { + ErrorManager.getDefault().log(ErrorManager.WARNING, "Cannot find ControlFlow component. It will not be located properly in the window system."); + return getDefault(); + } + if (win instanceof ControlFlowTopComponent) { + return (ControlFlowTopComponent) win; + } + ErrorManager.getDefault().log(ErrorManager.WARNING, "There seem to be multiple components with the '" + PREFERRED_ID + "' ID. That is a potential source of errors and unexpected behavior."); + return getDefault(); + } + + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_ALWAYS; + } + + @Override + public void componentOpened() { + Lookup.Template tpl = new Lookup.Template(Object.class); + result = Utilities.actionsGlobalContext().lookup(tpl); + result.addLookupListener(this); + } + + @Override + public void componentClosed() { + result.removeLookupListener(this); + result = null; + } + + public void resultChanged(LookupEvent lookupEvent) { + + InputGraphProvider p = Lookup.getDefault().lookup(InputGraphProvider.class); + if (p != null) { + InputGraph g = p.getGraph(); + if (g != null) { + scene.setGraph(g); + } + } + } + + @Override + public Object writeReplace() { + return new ResolvableHelper(); + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + @Override + public void requestActive() { + scene.getView().requestFocusInWindow(); + super.requestActive(); + } + + final static class ResolvableHelper implements Serializable { + + private static final long serialVersionUID = 1L; + + public Object readResolve() { + return ControlFlowTopComponent.getDefault(); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentSettings.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentSettings.xml new file mode 100644 index 00000000000..e226cd5ece9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentSettings.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentWstcref.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentWstcref.xml new file mode 100644 index 00000000000..07bbb1f52fb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/ControlFlowTopComponentWstcref.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/HierarchicalGraphLayout.java b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/HierarchicalGraphLayout.java new file mode 100644 index 00000000000..2a0c9ee4896 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/HierarchicalGraphLayout.java @@ -0,0 +1,167 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.controlflow; + +import com.sun.hotspot.igv.hierarchicallayout.HierarchicalLayoutManager; +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.LayoutGraph; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Dimension; +import java.awt.Point; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.netbeans.api.visual.graph.layout.GraphLayout; +import org.netbeans.api.visual.graph.layout.UniversalGraph; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class HierarchicalGraphLayout extends GraphLayout { + + public HierarchicalGraphLayout() { + } + + private class LinkWrapper implements Link { + + private VertexWrapper from; + private VertexWrapper to; + + public LinkWrapper(VertexWrapper from, VertexWrapper to) { + this.from = from; + this.to = to; + } + + public Port getFrom() { + return from.getSlot(); + } + + public Port getTo() { + return to.getSlot(); + } + + public List getControlPoints() { + return new ArrayList(); + } + + public void setControlPoints(List list) { + // Do nothing for now + } + } + + private class VertexWrapper implements Vertex { + + private N node; + private UniversalGraph graph; + private Port slot; + private Point position; + + public VertexWrapper(N node, UniversalGraph graph) { + this.node = node; + this.graph = graph; + final VertexWrapper vertex = this; + this.slot = new Port() { + + public Vertex getVertex() { + return vertex; + } + + public Point getRelativePosition() { + return new Point((int) (vertex.getSize().getWidth() / 2), (int) (vertex.getSize().getHeight() / 2)); + } + }; + + Widget w = graph.getScene().findWidget(node); + this.position = w.getPreferredLocation(); + } + + public Cluster getCluster() { + return null; + } + + public Dimension getSize() { + Widget w = graph.getScene().findWidget(node); + return w.getBounds().getSize(); + } + + public Point getPosition() { + return position; + } + + public void setPosition(Point p) { + HierarchicalGraphLayout.this.setResolvedNodeLocation(graph, node, p); + position = p; + } + + public boolean isRoot() { + return false; + } + + public int compareTo(Vertex o) { + VertexWrapper vw = (VertexWrapper) o; + return node.toString().compareTo(vw.node.toString()); + } + + public Port getSlot() { + return slot; + } + } + + protected void performGraphLayout(UniversalGraph graph) { + + Set links = new HashSet(); + Set vertices = new HashSet(); + Map vertexMap = new HashMap(); + + for (N node : graph.getNodes()) { + VertexWrapper v = new VertexWrapper(node, graph); + vertexMap.put(node, v); + vertices.add(v); + } + + for (E edge : graph.getEdges()) { + N source = graph.getEdgeSource(edge); + N target = graph.getEdgeTarget(edge); + LinkWrapper l = new LinkWrapper(vertexMap.get(source), vertexMap.get(target)); + links.add(l); + } + + HierarchicalLayoutManager m = new HierarchicalLayoutManager(HierarchicalLayoutManager.Combine.NONE); + + LayoutGraph layoutGraph = new LayoutGraph(links, vertices); + m.doLayout(layoutGraph); + } + + protected void performNodesLayout(UniversalGraph graph, Collection nodes) { + throw new UnsupportedOperationException(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/layer.xml new file mode 100644 index 00000000000..36b0e8ce903 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ControlFlow/src/com/sun/hotspot/igv/controlflow/layer.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/build.xml new file mode 100644 index 00000000000..a70f0080267 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.coordinator. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/manifest.mf new file mode 100644 index 00000000000..073c1e8040b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.coordinator +OpenIDE-Module-Layer: com/sun/hotspot/igv/coordinator/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/coordinator/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/build-impl.xml new file mode 100644 index 00000000000..4deca64beea --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/genfiles.properties new file mode 100644 index 00000000000..71781f95c87 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=077de97c +build.xml.script.CRC32=d29d586c +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=077de97c +nbproject/build-impl.xml.script.CRC32=03daa42d +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.xml new file mode 100644 index 00000000000..ad5afed1591 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/project.xml @@ -0,0 +1,126 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.coordinator + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.difference + + + + 1.0 + + + + com.sun.hotspot.igv.settings + + + + 1.0 + + + + com.sun.hotspot.igv.util + + + + 1.0 + + + + org.netbeans.api.progress + + + + 1 + 1.10.0.1 + + + + org.openide.actions + + + + 6.6.1.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5.1 + + + + org.openide.explorer + + + + 6.11 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.loaders + + + + 6.7 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.windows + + + + 6.16 + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer new file mode 100644 index 00000000000..bf7aace9e7d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer @@ -0,0 +1,2 @@ +com.sun.hotspot.igv.coordinator.StandardGroupOrganizer +com.sun.hotspot.igv.coordinator.GraphCountGroupOrganizer \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/Bundle.properties new file mode 100644 index 00000000000..455f648095d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/Bundle.properties @@ -0,0 +1,7 @@ + +AdvancedOption_DisplayName_Coordinator=Settings +AdvancedOption_Tooltip_Coordinator=Visualization Tool Settings +CTL_OutlineTopComponent=Outline Window +CTL_SomeAction=test +HINT_OutlineTopComponent=This is a Outline window +OpenIDE-Module-Name=Coordinator diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java new file mode 100644 index 00000000000..b5398edaeea --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/FolderNode.java @@ -0,0 +1,139 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator; + +import com.sun.hotspot.igv.coordinator.actions.RemoveCookie; +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.Pair; +import java.awt.Image; +import java.util.ArrayList; +import java.util.List; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.util.Utilities; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; + +/** + * + * @author Thomas Wuerthinger + */ +public class FolderNode extends AbstractNode { + + private GroupOrganizer organizer; + private InstanceContent content; + private List>> structure; + private List subFolders; + private FolderChildren children; + + private static class FolderChildren extends Children.Keys { + + private FolderNode parent; + + public void setParent(FolderNode parent) { + this.parent = parent; + } + + @Override + protected Node[] createNodes(Object arg0) { + + Pair> p = (Pair>) arg0; + if (p.getLeft().length() == 0) { + + List curNodes = new ArrayList(); + for (Group g : p.getRight()) { + for (InputGraph graph : g.getGraphs()) { + curNodes.add(new GraphNode(graph)); + } + } + + Node[] result = new Node[curNodes.size()]; + for (int i = 0; i < curNodes.size(); i++) { + result[i] = curNodes.get(i); + } + return result; + + } else { + return new Node[]{new FolderNode(p.getLeft(), parent.organizer, parent.subFolders, p.getRight())}; + } + } + + @Override + public void addNotify() { + this.setKeys(parent.structure); + + } + } + + protected InstanceContent getContent() { + return content; + } + + @Override + public Image getIcon(int i) { + return Utilities.loadImage("com/sun/hotspot/igv/coordinator/images/folder.gif"); + } + + protected FolderNode(String name, GroupOrganizer organizer, List subFolders, List groups) { + this(name, organizer, subFolders, groups, new FolderChildren(), new InstanceContent()); + } + + private FolderNode(String name, GroupOrganizer organizer, List oldSubFolders, final List groups, FolderChildren children, InstanceContent content) { + super(children, new AbstractLookup(content)); + children.setParent(this); + this.content = content; + this.children = children; + content.add(new RemoveCookie() { + + public void remove() { + for (Group g : groups) { + if (g.getDocument() != null) { + g.getDocument().removeGroup(g); + } + } + } + }); + init(name, organizer, oldSubFolders, groups); + } + + public void init(String name, GroupOrganizer organizer, List oldSubFolders, List groups) { + this.setDisplayName(name); + this.organizer = organizer; + this.subFolders = new ArrayList(oldSubFolders); + if (name.length() > 0) { + this.subFolders.add(name); + } + structure = organizer.organize(subFolders, groups); + assert structure != null; + children.addNotify(); + } + + @Override + public Image getOpenedIcon(int i) { + return getIcon(i); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphCountGroupOrganizer.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphCountGroupOrganizer.java new file mode 100644 index 00000000000..42648d0f082 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphCountGroupOrganizer.java @@ -0,0 +1,81 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.coordinator; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.Pair; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; + +/** + * + * @author Thomas Wuerthinger + */ +public class GraphCountGroupOrganizer implements GroupOrganizer { + + public String getName() { + return "Graph count structure"; + } + + public List>> organize(List subFolders, List groups) { + + List>> result = new ArrayList>>(); + + if (subFolders.size() == 0) { + Map> map = new HashMap>(); + for (Group g : groups) { + Integer cur = g.getGraphs().size(); + if (!map.containsKey(cur)) { + map.put(cur, new ArrayList()); + } + map.get(cur).add(g); + } + + SortedSet keys = new TreeSet(map.keySet()); + for (Integer i : keys) { + result.add(new Pair>("Graph count " + i, map.get(i))); + } + + } else if (subFolders.size() == 1) { + for (Group g : groups) { + List children = new ArrayList(); + children.add(g); + Pair> p = new Pair>(); + p.setLeft(g.getName()); + p.setRight(children); + result.add(p); + } + } else if (subFolders.size() == 2) { + result.add(new Pair>("", groups)); + } + + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphNode.java new file mode 100644 index 00000000000..0fd780cf679 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/GraphNode.java @@ -0,0 +1,130 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator; + +import com.sun.hotspot.igv.coordinator.actions.DiffGraphAction; +import com.sun.hotspot.igv.coordinator.actions.DiffGraphCookie; +import com.sun.hotspot.igv.coordinator.actions.RemoveCookie; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.GraphViewer; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import com.sun.hotspot.igv.util.PropertiesSheet; +import java.awt.Image; +import javax.swing.Action; +import org.openide.actions.OpenAction; +import org.openide.cookies.OpenCookie; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.nodes.Sheet; +import org.openide.util.Lookup; +import org.openide.util.Utilities; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; + +/** + * + * @author Thomas Wuerthinger + */ +public class GraphNode extends AbstractNode { + + private InputGraph graph; + + /** Creates a new instance of GraphNode */ + public GraphNode(InputGraph graph) { + this(graph, new InstanceContent()); + } + + private GraphNode(final InputGraph graph, InstanceContent content) { + super(Children.LEAF, new AbstractLookup(content)); + this.graph = graph; + this.setDisplayName(graph.getName()); + content.add(graph); + + final GraphViewer viewer = Lookup.getDefault().lookup(GraphViewer.class); + + if (viewer != null) { + // Action for opening the graph + content.add(new OpenCookie() { + + public void open() { + viewer.view(graph); + } + }); + } + + // Action for removing a graph + content.add(new RemoveCookie() { + + public void remove() { + graph.getGroup().removeGraph(graph); + } + }); + } + + @Override + protected Sheet createSheet() { + Sheet s = super.createSheet(); + PropertiesSheet.initializeSheet(graph.getProperties(), s); + return s; + } + + @Override + public Image getIcon(int i) { + return Utilities.loadImage("com/sun/hotspot/igv/coordinator/images/graph.gif"); + } + + @Override + public Image getOpenedIcon(int i) { + return getIcon(i); + } + + @Override + public T getCookie(Class aClass) { + if (aClass == DiffGraphCookie.class) { + InputGraphProvider graphProvider = Utilities.actionsGlobalContext().lookup(InputGraphProvider.class); + + InputGraph graphA = null; + if (graphProvider != null) { + graphA = graphProvider.getGraph(); + } + + if (graphA != null && !graphA.isDifferenceGraph()) { + return (T) new DiffGraphCookie(graphA, graph); + } + } + + return super.getCookie(aClass); + } + + @Override + public Action[] getActions(boolean b) { + return new Action[]{(Action) DiffGraphAction.findObject(DiffGraphAction.class, true), (Action) OpenAction.findObject(OpenAction.class, true)}; + } + + @Override + public Action getPreferredAction() { + return (Action) OpenAction.findObject(OpenAction.class, true); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.form b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.form new file mode 100644 index 00000000000..37e033f1989 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.form @@ -0,0 +1,41 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java new file mode 100644 index 00000000000..9e6177b1782 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java @@ -0,0 +1,271 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator; + +import com.sun.hotspot.igv.coordinator.actions.ImportAction; +import com.sun.hotspot.igv.coordinator.actions.RemoveAction; +import com.sun.hotspot.igv.coordinator.actions.RemoveAllAction; +import com.sun.hotspot.igv.coordinator.actions.SaveAllAction; +import com.sun.hotspot.igv.coordinator.actions.SaveAsAction; +import com.sun.hotspot.igv.coordinator.actions.StructuredViewAction; +import com.sun.hotspot.igv.data.GraphDocument; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupCallback; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import com.sun.hotspot.igv.data.services.GroupReceiver; +import java.awt.BorderLayout; +import java.awt.Component; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.border.Border; +import org.openide.ErrorManager; +import org.openide.awt.Toolbar; +import org.openide.awt.ToolbarPool; +import org.openide.explorer.ExplorerManager; +import org.openide.explorer.ExplorerUtils; +import org.openide.explorer.view.BeanTreeView; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.NbBundle; +import org.openide.util.actions.NodeAction; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; + +/** + * + * @author Thomas Wuerthinger + */ +public final class OutlineTopComponent extends TopComponent implements ExplorerManager.Provider, LookupListener { + + public static OutlineTopComponent instance; + public static final String PREFERRED_ID = "OutlineTopComponent"; + private ExplorerManager manager; + private GraphDocument document; + private FolderNode root; + private GroupOrganizer organizer; + + private OutlineTopComponent() { + initComponents(); + + setName(NbBundle.getMessage(OutlineTopComponent.class, "CTL_OutlineTopComponent")); + setToolTipText(NbBundle.getMessage(OutlineTopComponent.class, "HINT_OutlineTopComponent")); + + document = new GraphDocument(); + initListView(); + initToolbar(); + initReceivers(); + } + + private void initListView() { + manager = new ExplorerManager(); + organizer = new StandardGroupOrganizer(); + root = new FolderNode("", organizer, new ArrayList(), document.getGroups()); + manager.setRootContext(root); + ((BeanTreeView) this.jScrollPane1).setRootVisible(false); + + document.getChangedEvent().addListener(new ChangedListener() { + + public void changed(GraphDocument document) { + updateStructure(); + } + }); + + associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); + } + + private void initToolbar() { + + Toolbar toolbar = new Toolbar(); + Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N + toolbar.setBorder(b); + this.add(toolbar, BorderLayout.NORTH); + + toolbar.add(ImportAction.get(ImportAction.class)); + toolbar.add(((NodeAction) RemoveAction.get(RemoveAction.class)).createContextAwareInstance(this.getLookup())); + toolbar.add(RemoveAllAction.get(RemoveAllAction.class)); + + toolbar.add(((NodeAction) SaveAsAction.get(SaveAsAction.class)).createContextAwareInstance(this.getLookup())); + toolbar.add(SaveAllAction.get(SaveAllAction.class)); + + toolbar.add(StructuredViewAction.get(StructuredViewAction.class).getToolbarPresenter()); + + for (Toolbar tb : ToolbarPool.getDefault().getToolbars()) { + tb.setVisible(false); + } + + initOrganizers(); + } + + public void setOrganizer(GroupOrganizer organizer) { + this.organizer = organizer; + updateStructure(); + } + + private void initOrganizers() { + + } + + private void initReceivers() { + + final GroupCallback callback = new GroupCallback() { + + public void started(Group g) { + getDocument().addGroup(g); + } + }; + + Collection receivers = Lookup.getDefault().lookupAll(GroupReceiver.class); + if (receivers.size() > 0) { + JPanel panel = new JPanel(); + panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); + + for (GroupReceiver r : receivers) { + Component c = r.init(callback); + panel.add(c); + } + + jPanel2.add(panel, BorderLayout.PAGE_START); + } + } + + private void updateStructure() { + root.init("", organizer, new ArrayList(), document.getGroups()); + } + + public void clear() { + document.clear(); + } + + public ExplorerManager getExplorerManager() { + return manager; + } + + public GraphDocument getDocument() { + return document; + } + + /** + * Gets default instance. Do not use directly: reserved for *.settings files only, + * i.e. deserialization routines; otherwise you could get a non-deserialized instance. + * To obtain the singleton instance, use {@link findInstance}. + */ + public static synchronized OutlineTopComponent getDefault() { + if (instance == null) { + instance = new OutlineTopComponent(); + } + return instance; + } + + /** + * Obtain the OutlineTopComponent instance. Never call {@link #getDefault} directly! + */ + public static synchronized OutlineTopComponent findInstance() { + TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (win == null) { + ErrorManager.getDefault().log(ErrorManager.WARNING, "Cannot find Outline component. It will not be located properly in the window system."); + return getDefault(); + } + if (win instanceof OutlineTopComponent) { + return (OutlineTopComponent) win; + } + ErrorManager.getDefault().log(ErrorManager.WARNING, "There seem to be multiple components with the '" + PREFERRED_ID + "' ID. That is a potential source of errors and unexpected behavior."); + return getDefault(); + } + + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_ALWAYS; + } + + @Override + public void componentOpened() { + this.requestActive(); + } + + @Override + public void componentClosed() { + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + public void resultChanged(LookupEvent lookupEvent) { + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + // Not called when user starts application for the first time + super.readExternal(objectInput); + ((BeanTreeView) this.jScrollPane1).setRootVisible(false); + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + super.writeExternal(objectOutput); + } + + static final class ResolvableHelper implements Serializable { + + private static final long serialVersionUID = 1L; + + public Object readResolve() { + return OutlineTopComponent.getDefault(); + } + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel2 = new javax.swing.JPanel(); + jScrollPane1 = new BeanTreeView(); + + setLayout(new java.awt.BorderLayout()); + + jPanel2.setLayout(new java.awt.BorderLayout()); + jPanel2.add(jScrollPane1, java.awt.BorderLayout.CENTER); + + add(jPanel2, java.awt.BorderLayout.CENTER); + }// //GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel jPanel2; + private javax.swing.JScrollPane jScrollPane1; + // End of variables declaration//GEN-END:variables +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentSettings.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentSettings.xml new file mode 100644 index 00000000000..1acdbcbe986 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentSettings.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentWstcref.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentWstcref.xml new file mode 100644 index 00000000000..329140ea6bd --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/OutlineTopComponentWstcref.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardConfiguration.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardConfiguration.xml new file mode 100644 index 00000000000..1e05bc21edb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardConfiguration.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardGroupOrganizer.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardGroupOrganizer.java new file mode 100644 index 00000000000..d907ba80c62 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/StandardGroupOrganizer.java @@ -0,0 +1,62 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.coordinator; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import com.sun.hotspot.igv.data.Pair; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class StandardGroupOrganizer implements GroupOrganizer { + + public String getName() { + return "-- None --"; + } + + public List>> organize(List subFolders, List groups) { + + List>> result = new ArrayList>>(); + + if (groups.size() == 1 && subFolders.size() > 0) { + result.add(new Pair>("", groups)); + } else { + for (Group g : groups) { + List children = new ArrayList(); + children.add(g); + Pair> p = new Pair>(); + p.setLeft(g.getName()); + p.setRight(children); + result.add(p); + } + } + + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/Bundle.properties new file mode 100644 index 00000000000..5b5b93f4773 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/Bundle.properties @@ -0,0 +1,18 @@ +CTL_EditFilterAction=Edit... +CTL_ImportAction=Open... +CTL_OpenGraphAction=View graph +CTL_DiffGraphAction=Difference to current graph +CTL_RemoveAction=Remove methods +CTL_ApplyFilterAction=Apply +CTL_FilterAction=Open Filter Window +CTL_AppliedFilterAction=Open AppliedFilter Window +CTL_OutlineAction=Open Outline Window +CTL_MoveFilterUpAction=Move upwards +CTL_MoveFilterDownAction=Move downwards +CTL_RemoveFilterAction=Remove +CTL_RemoveFilterSettingsAction=Remove filter setting +CTL_SaveAsAction=Save selected methods... +CTL_SaveAllAction=Save all... +CTL_SaveFilterSettingsAction=Save filter settings... +CTL_PropertiesAction=Open Properties Window +CTL_NewFilterAction=New filter... diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphAction.java new file mode 100644 index 00000000000..3e7737e7f7f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphAction.java @@ -0,0 +1,70 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class DiffGraphAction extends CookieAction { + + protected void performAction(Node[] activatedNodes) { + DiffGraphCookie c = activatedNodes[0].getCookie(DiffGraphCookie.class); + c.openDiff(); + } + + protected int mode() { + return CookieAction.MODE_EXACTLY_ONE; + } + + public String getName() { + return NbBundle.getMessage(DiffGraphAction.class, "CTL_DiffGraphAction"); + } + + protected Class[] cookieClasses() { + return new Class[]{ + DiffGraphCookie.class + }; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/diff.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphCookie.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphCookie.java new file mode 100644 index 00000000000..b95ecf032eb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/DiffGraphCookie.java @@ -0,0 +1,56 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.GraphViewer; +import com.sun.hotspot.igv.difference.Difference; +import org.openide.nodes.Node; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +public class DiffGraphCookie implements Node.Cookie { + + private InputGraph a; + private InputGraph b; + + public DiffGraphCookie(InputGraph a, InputGraph b) { + this.a = a; + this.b = b; + } + + public void openDiff() { + + final GraphViewer viewer = Lookup.getDefault().lookup(GraphViewer.class); + + if(viewer != null) { + InputGraph diffGraph = Difference.createDiffGraph(a, b); + viewer.view(diffGraph); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java new file mode 100644 index 00000000000..cc1e4b15e1d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/ImportAction.java @@ -0,0 +1,175 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.coordinator.OutlineTopComponent; +import com.sun.hotspot.igv.data.GraphDocument; +import com.sun.hotspot.igv.data.serialization.Parser; +import com.sun.hotspot.igv.settings.Settings; +import com.sun.hotspot.igv.data.serialization.XMLParser; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import javax.swing.Action; +import javax.swing.JFileChooser; +import javax.swing.KeyStroke; +import javax.swing.filechooser.FileFilter; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.RequestProcessor; +import org.openide.util.actions.CallableSystemAction; +import org.openide.xml.XMLUtil; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ImportAction extends CallableSystemAction { + + public static FileFilter getFileFilter() { + return new FileFilter() { + + public boolean accept(File f) { + return f.getName().toLowerCase().endsWith(".xml") || f.isDirectory(); + } + + public String getDescription() { + return "XML files (*.xml)"; + } + }; + } + + public void performAction() { + + JFileChooser fc = new JFileChooser(); + fc.setFileFilter(ImportAction.getFileFilter()); + fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT))); + + if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + + File dir = file; + if (!dir.isDirectory()) { + dir = dir.getParentFile(); + } + + Settings.get().put(Settings.DIRECTORY, dir.getAbsolutePath()); + + try { + final XMLReader reader = XMLUtil.createXMLReader(); + final FileInputStream inputStream = new FileInputStream(file); + final InputSource is = new InputSource(inputStream); + + final ProgressHandle handle = ProgressHandleFactory.createHandle("Opening file " + file.getName()); + final int basis = 1000; + handle.start(basis); + final int start = inputStream.available(); + + final XMLParser.ParseMonitor parseMonitor = new XMLParser.ParseMonitor() { + + public void setProgress(double d) { + try { + int curAvailable = inputStream.available(); + int prog = (int) (basis * (double) (start - curAvailable) / (double) start); + handle.progress(prog); + } catch (IOException ex) { + } + } + + public void setState(String state) { + setProgress(0.0); + handle.progress(state); + } + }; + final Parser parser = new Parser(); + final OutlineTopComponent component = OutlineTopComponent.findInstance(); + + component.requestActive(); + + RequestProcessor.getDefault().post(new Runnable() { + + public void run() { + GraphDocument document = null; + try { + document = parser.parse(reader, is, parseMonitor); + parseMonitor.setState("Finishing"); + component.getDocument().addGraphDocument(document); + } catch (SAXException ex) { + String s = "Exception during parsing the XML file, could not load document!"; + if (ex instanceof XMLParser.MissingAttributeException) { + XMLParser.MissingAttributeException e = (XMLParser.MissingAttributeException) ex; + s += "\nMissing attribute \"" + e.getAttributeName() + "\""; + } + ex.printStackTrace(); + NotifyDescriptor d = new NotifyDescriptor.Message(s, NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notify(d); + } + handle.finish(); + } + }); + + } catch (SAXException ex) { + ex.printStackTrace(); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + + public String getName() { + return NbBundle.getMessage(ImportAction.class, "CTL_ImportAction"); + } + + public ImportAction() { + putValue(Action.SHORT_DESCRIPTION, "Open an XML graph document"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK)); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/import.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/OutlineAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/OutlineAction.java new file mode 100644 index 00000000000..580d1fa4566 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/OutlineAction.java @@ -0,0 +1,48 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.coordinator.*; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import org.openide.util.NbBundle; +import org.openide.windows.TopComponent; + +/** + * + * @author Thomas Wuerthinger + */ +public class OutlineAction extends AbstractAction { + + public OutlineAction() { + super(NbBundle.getMessage(OutlineAction.class, "CTL_OutlineAction")); + } + + public void actionPerformed(ActionEvent evt) { + TopComponent win = OutlineTopComponent.findInstance(); + win.open(); + win.requestActive(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAction.java new file mode 100644 index 00000000000..180cb84c2ca --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAction.java @@ -0,0 +1,73 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import javax.swing.Action; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.NodeAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class RemoveAction extends NodeAction { + + protected void performAction(Node[] activatedNodes) { + for (Node n : activatedNodes) { + RemoveCookie removeCookie = n.getCookie(RemoveCookie.class); + if (removeCookie != null) { + removeCookie.remove(); + } + } + } + + public RemoveAction() { + putValue(Action.SHORT_DESCRIPTION, "Remove"); + } + + public String getName() { + return NbBundle.getMessage(RemoveAction.class, "CTL_RemoveAction"); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/remove.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + protected boolean enable(Node[] nodes) { + return nodes.length > 0; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAllAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAllAction.java new file mode 100644 index 00000000000..68372525a1a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveAllAction.java @@ -0,0 +1,70 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.coordinator.OutlineTopComponent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class RemoveAllAction extends CallableSystemAction { + + + public String getName() { + return NbBundle.getMessage(RemoveAllAction.class, "CTL_ImportAction"); + } + + public RemoveAllAction() { + putValue(Action.SHORT_DESCRIPTION, "Remove all methods"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.CTRL_MASK)); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/removeall.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + public void performAction() { + OutlineTopComponent.findInstance().clear(); + } +} diff --git a/jdk/make/tools/winver/src/StdAfx.cpp b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveCookie.java similarity index 76% rename from jdk/make/tools/winver/src/StdAfx.cpp rename to hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveCookie.java index a7169bc689b..7fc2989bc56 100644 --- a/jdk/make/tools/winver/src/StdAfx.cpp +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/RemoveCookie.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -23,11 +23,14 @@ * have any questions. */ -// stdafx.cpp : source file that includes just the standard includes -// getver.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information +package com.sun.hotspot.igv.coordinator.actions; -#include "stdafx.h" +import org.openide.nodes.Node; -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file +/** + * + * @author Thomas Wuerthinger + */ +public interface RemoveCookie extends Node.Cookie { + void remove(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAllAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAllAction.java new file mode 100644 index 00000000000..af56a00936c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAllAction.java @@ -0,0 +1,69 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.coordinator.OutlineTopComponent; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class SaveAllAction extends CallableSystemAction { + + public void performAction() { + final OutlineTopComponent component = OutlineTopComponent.findInstance(); + SaveAsAction.save(component.getDocument()); + } + + public String getName() { + return NbBundle.getMessage(SaveAllAction.class, "CTL_SaveAllAction"); + } + + public SaveAllAction() { + putValue(Action.SHORT_DESCRIPTION, "Save all methods to XML file"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK)); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/saveall.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAsAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAsAction.java new file mode 100644 index 00000000000..d8565b09b8c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/SaveAsAction.java @@ -0,0 +1,122 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.data.GraphDocument; +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.serialization.Printer; +import com.sun.hotspot.igv.settings.Settings; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import javax.swing.JFileChooser; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; +import org.openide.util.actions.NodeAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class SaveAsAction extends NodeAction { + + protected void performAction(Node[] activatedNodes) { + + GraphDocument doc = new GraphDocument(); + for (Node n : activatedNodes) { + Group group = n.getLookup().lookup(Group.class); + doc.addGroup(group); + } + + save(doc); + } + + public static void save(GraphDocument doc) { + JFileChooser fc = new JFileChooser(); + fc.setFileFilter(ImportAction.getFileFilter()); + fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT))); + + if (fc.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + if (!file.getName().contains(".")) { + file = new File(file.getAbsolutePath() + ".xml"); + } + + File dir = file; + if (!dir.isDirectory()) { + dir = dir.getParentFile(); + } + Settings.get().put(Settings.DIRECTORY, dir.getAbsolutePath()); + try { + Writer writer = new OutputStreamWriter(new FileOutputStream(file)); + Printer p = new Printer(); + p.export(writer, doc); + writer.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + + } + } + } + + protected int mode() { + return CookieAction.MODE_SOME; + } + + public String getName() { + return NbBundle.getMessage(SaveAsAction.class, "CTL_SaveAsAction"); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/coordinator/images/save.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + protected boolean enable(Node[] nodes) { + + int cnt = 0; + for (Node n : nodes) { + cnt += n.getLookup().lookupAll(Group.class).size(); + } + + return cnt > 0; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/StructuredViewAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/StructuredViewAction.java new file mode 100644 index 00000000000..1486c2e8e02 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/actions/StructuredViewAction.java @@ -0,0 +1,180 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.coordinator.actions; + +import com.sun.hotspot.igv.coordinator.OutlineTopComponent; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import java.awt.Component; +import java.awt.Image; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.swing.Action; +import javax.swing.ButtonGroup; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import org.openide.awt.DropDownButtonFactory; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.Utilities; +import org.openide.util.actions.CallableSystemAction; + +public class StructuredViewAction extends CallableSystemAction { + + private static JButton dropDownButton; + private static ButtonGroup buttonGroup; + private static JPopupMenu popup; + private MyMenuItemListener menuItemListener; + private Map map; + + public StructuredViewAction() { + + putValue(Action.SHORT_DESCRIPTION, "Cluster nodes into blocks"); + } + + @Override + public Component getToolbarPresenter() { + + Image iconImage = Utilities.loadImage("com/sun/hotspot/igv/coordinator/images/structure.gif"); + ImageIcon icon = new ImageIcon(iconImage); + + popup = new JPopupMenu(); + + menuItemListener = new MyMenuItemListener(); + + buttonGroup = new ButtonGroup(); + + Collection organizersCollection = Lookup.getDefault().lookupAll(GroupOrganizer.class); + + List organizers = new ArrayList(organizersCollection); + Collections.sort(organizers, new Comparator() { + public int compare(GroupOrganizer a, GroupOrganizer b) { + return a.getName().compareTo(b.getName()); + } + }); + + map = new HashMap(); + + boolean first = true; + for(GroupOrganizer organizer : organizers) { + JCheckBoxMenuItem item = new JCheckBoxMenuItem(organizer.getName()); + map.put(item, organizer); + item.addActionListener(menuItemListener); + buttonGroup.add(item); + popup.add(item); + if(first) { + item.setSelected(true); + first = false; + } + } + + dropDownButton = DropDownButtonFactory.createDropDownButton( + new ImageIcon( + new BufferedImage(32, 32, BufferedImage.TYPE_BYTE_GRAY)), + popup); + + dropDownButton.setIcon(icon); + + dropDownButton.setToolTipText("Insert Layer Registration"); + + dropDownButton.addItemListener(new ItemListener() { + + public void itemStateChanged(ItemEvent e) { + int state = e.getStateChange(); + if (state == ItemEvent.SELECTED) { + performAction(); + } + } + }); + + dropDownButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + performAction(); + } + }); + + popup.addPopupMenuListener(new PopupMenuListener() { + + public void popupMenuCanceled(PopupMenuEvent e) { + dropDownButton.setSelected(false); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + dropDownButton.setSelected(false); + } + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + dropDownButton.setSelected(true); + } + }); + + return dropDownButton; + + } + + private class MyMenuItemListener implements ActionListener { + + public void actionPerformed(ActionEvent ev) { + JMenuItem item = (JMenuItem) ev.getSource(); + GroupOrganizer organizer = map.get(item); + assert organizer != null : "Organizer must exist!"; + OutlineTopComponent.findInstance().setOrganizer(organizer); + } + } + + + @Override + public void performAction() { + popup.show(dropDownButton, 0, dropDownButton.getHeight()); + } + + public String getName() { + return "Structured View"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/customLeftWsmode.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/customLeftWsmode.xml new file mode 100644 index 00000000000..2655e46a14b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/customLeftWsmode.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/diff.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/diff.gif new file mode 100644 index 00000000000..6e49c314adf Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/diff.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/folder.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/folder.gif new file mode 100644 index 00000000000..2d3ca05fb33 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/folder.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/graph.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/graph.gif new file mode 100644 index 00000000000..7a4e5fc8cd7 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/graph.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/import.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/import.gif new file mode 100644 index 00000000000..c0b2ca24af5 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/import.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/remove.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/remove.gif new file mode 100644 index 00000000000..9dc08247b8f Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/remove.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/removeall.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/removeall.gif new file mode 100644 index 00000000000..9eeab3cad6d Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/removeall.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/save.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/save.gif new file mode 100644 index 00000000000..954f1accde6 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/save.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/saveall.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/saveall.gif new file mode 100644 index 00000000000..2d31c8b2ccd Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/saveall.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structure.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structure.gif new file mode 100644 index 00000000000..2be84874874 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structure.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structured.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structured.gif new file mode 100644 index 00000000000..71aa946d539 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/images/structured.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/layer.xml new file mode 100644 index 00000000000..999997db9f6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Coordinator/src/com/sun/hotspot/igv/coordinator/layer.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Data/build.xml new file mode 100644 index 00000000000..dd626066c85 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.data. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Data/manifest.mf new file mode 100644 index 00000000000..702ae8764a2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.data +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/data/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/build-impl.xml new file mode 100644 index 00000000000..942d7a628fc --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/genfiles.properties new file mode 100644 index 00000000000..621e413c962 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a403efd8 +build.xml.script.CRC32=b87f73ba +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=a403efd8 +nbproject/build-impl.xml.script.CRC32=cc649146 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.xml new file mode 100644 index 00000000000..dce4d28a7c3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/project.xml @@ -0,0 +1,16 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.data + + + + com.sun.hotspot.igv.data + com.sun.hotspot.igv.data.serialization + com.sun.hotspot.igv.data.services + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Bundle.properties new file mode 100644 index 00000000000..f17788c7ff4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=Data diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEvent.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEvent.java new file mode 100644 index 00000000000..18a8cedbabf --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEvent.java @@ -0,0 +1,44 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class ChangedEvent extends Event> { + + private T object; + + public ChangedEvent() { + } + + public ChangedEvent(T object) { + this.object = object; + } + + protected void fire(ChangedListener l) { + l.changed(object); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEventProvider.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEventProvider.java new file mode 100644 index 00000000000..5e2978e8260 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedEventProvider.java @@ -0,0 +1,34 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public interface ChangedEventProvider { + + public ChangedEvent getChangedEvent(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedListener.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedListener.java new file mode 100644 index 00000000000..806b339be17 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/ChangedListener.java @@ -0,0 +1,33 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public interface ChangedListener { + + public void changed(T source); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Event.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Event.java new file mode 100644 index 00000000000..c31e5935a12 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Event.java @@ -0,0 +1,57 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public abstract class Event { + + private List listener; + + public Event() { + listener = new ArrayList(); + } + + public void addListener(L l) { + listener.add(l); + } + + public void removeListener(L l) { + listener.remove(l); + } + + public void fire() { + List tmpList = new ArrayList(listener); + for (L l : tmpList) { + fire(l); + } + } + + protected abstract void fire(L l); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java new file mode 100644 index 00000000000..27d09c38f71 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/GraphDocument.java @@ -0,0 +1,91 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class GraphDocument extends Properties.Object implements ChangedEventProvider { + + private List groups; + private ChangedEvent changedEvent; + + public GraphDocument() { + groups = new ArrayList(); + changedEvent = new ChangedEvent(this); + } + + public void clear() { + groups.clear(); + getChangedEvent().fire(); + } + + public ChangedEvent getChangedEvent() { + return changedEvent; + } + + public List getGroups() { + return Collections.unmodifiableList(groups); + } + + public void addGroup(Group group) { + group.setDocument(this); + groups.add(group); + getChangedEvent().fire(); + } + + public void removeGroup(Group group) { + if (groups.contains(group)) { + group.setDocument(null); + groups.remove(group); + getChangedEvent().fire(); + } + } + + public void addGraphDocument(GraphDocument document) { + for (Group g : document.groups) { + this.addGroup(g); + } + document.clear(); + getChangedEvent().fire(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + + sb.append("GraphDocument: " + getProperties().toString() + " \n\n"); + for (Group g : getGroups()) { + sb.append(g.toString()); + sb.append("\n\n"); + } + + return sb.toString(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java new file mode 100644 index 00000000000..8f0aa15e992 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Group.java @@ -0,0 +1,141 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.ChangedEventProvider; +import com.sun.hotspot.igv.data.Properties; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Group extends Properties.Object implements ChangedEventProvider { + + private List graphs; + private transient ChangedEvent changedEvent; + private GraphDocument document; + private InputMethod method; + private String assembly; + + public Group() { + graphs = new ArrayList(); + init(); + } + + private void init() { + changedEvent = new ChangedEvent(this); + } + + public void fireChangedEvent() { + changedEvent.fire(); + } + + public void setAssembly(String s) { + this.assembly = s; + } + + public String getAssembly() { + return assembly; + } + + public void setMethod(InputMethod method) { + this.method = method; + } + + public InputMethod getMethod() { + return method; + } + + void setDocument(GraphDocument document) { + this.document = document; + } + + public GraphDocument getDocument() { + return document; + } + + public ChangedEvent getChangedEvent() { + return changedEvent; + } + + public List getGraphs() { + return Collections.unmodifiableList(graphs); + } + + public void addGraph(InputGraph g) { + assert g != null; + assert !graphs.contains(g); + graphs.add(g); + changedEvent.fire(); + } + + public void removeGraph(InputGraph g) { + int index = graphs.indexOf(g); + if (index != -1) { + graphs.remove(g); + changedEvent.fire(); + } + } + + public Set getAllNodes() { + Set result = new HashSet(); + for (InputGraph g : graphs) { + Set ids = g.getNodesAsSet(); + result.addAll(g.getNodesAsSet()); + for (Integer i : ids) { + result.add(-i); + } + } + return result; + } + + public InputGraph getLastAdded() { + if (graphs.size() == 0) { + return null; + } + return graphs.get(graphs.size() - 1); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Group " + getProperties().toString() + "\n"); + for (InputGraph g : graphs) { + sb.append(g.toString()); + sb.append("\n"); + } + return sb.toString(); + } + + public String getName() { + return getProperties().get("name"); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlock.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlock.java new file mode 100644 index 00000000000..1c1367738af --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlock.java @@ -0,0 +1,140 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputBlock { + + private List nodes; + private List successorNames; + private String name; + private InputGraph graph; + private Rectangle bounds; + private Set successors; + private Set predecessors; + private Set inputs; + private Set outputs; + + public InputBlock(InputGraph graph, String name) { + this.graph = graph; + this.name = name; + nodes = new ArrayList(); + successorNames = new ArrayList(); + successors = new HashSet(); + predecessors = new HashSet(); + inputs = new HashSet(); + outputs = new HashSet(); + } + + public void removeSuccessor(InputBlock b) { + if (successors.contains(b)) { + successors.remove(b); + b.predecessors.remove(this); + InputBlockEdge e = new InputBlockEdge(this, b); + assert outputs.contains(e); + outputs.remove(e); + assert b.inputs.contains(e); + b.inputs.remove(e); + } + } + + public String getName() { + return name; + } + + public void setName(String s) { + name = s; + } + + public List getNodes() { + return Collections.unmodifiableList(nodes); + } + + public void addNode(int id) { + InputNode n = graph.getNode(id); + assert n != null; + graph.setBlock(n, this); + addNode(graph.getNode(id)); + } + + public void addNode(InputNode node) { + assert !nodes.contains(node); + nodes.add(node); + } + + public Set getPredecessors() { + return Collections.unmodifiableSet(predecessors); + } + + public Set getSuccessors() { + return Collections.unmodifiableSet(successors); + } + + public Set getInputs() { + return Collections.unmodifiableSet(inputs); + } + + public Set getOutputs() { + return Collections.unmodifiableSet(outputs); + } + + // resolveBlockLinks must be called afterwards + public void addSuccessor(String name) { + successorNames.add(name); + } + + public void resolveBlockLinks() { + for (String s : successorNames) { + InputBlock b = graph.getBlock(s); + addSuccessor(b); + } + + successorNames.clear(); + } + + public void addSuccessor(InputBlock b) { + if (!successors.contains(b)) { + successors.add(b); + b.predecessors.add(this); + InputBlockEdge e = new InputBlockEdge(this, b); + outputs.add(e); + b.inputs.add(e); + } + } + + @Override + public String toString() { + return this.getName(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlockEdge.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlockEdge.java new file mode 100644 index 00000000000..10cac158a4a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBlockEdge.java @@ -0,0 +1,65 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputBlockEdge { + + private InputBlock from; + private InputBlock to; + + public InputBlockEdge(InputBlock from, InputBlock to) { + assert from != null; + assert to != null; + this.from = from; + this.to = to; + } + + public InputBlock getFrom() { + return from; + } + + public InputBlock getTo() { + return to; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof InputBlockEdge && obj != null) { + InputBlockEdge e = (InputBlockEdge) obj; + return e.from.equals(from) && e.to.equals(to); + } + return super.equals(obj); + } + + @Override + public int hashCode() { + int hash = from.hashCode(); + hash = 59 * hash + to.hashCode(); + return hash; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBytecode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBytecode.java new file mode 100644 index 00000000000..14ab1f34059 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputBytecode.java @@ -0,0 +1,56 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputBytecode { + + private int bci; + private String name; + private InputMethod inlined; + + public InputBytecode(int bci, String name) { + this.bci = bci; + this.name = name; + } + + public InputMethod getInlined() { + return inlined; + } + + public void setInlined(InputMethod inlined) { + this.inlined = inlined; + } + + public int getBci() { + return bci; + } + + public String getName() { + return name; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputEdge.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputEdge.java new file mode 100644 index 00000000000..d1c440ec09a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputEdge.java @@ -0,0 +1,92 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputEdge { + + public enum State { + + SAME, + NEW, + DELETED + } + private char toIndex; + private int from; + private int to; + private State state; + + public InputEdge(char toIndex, int from, int to) { + this.toIndex = toIndex; + this.from = from; + this.to = to; + this.state = State.SAME; + } + + public State getState() { + return state; + } + + public void setState(State x) { + this.state = x; + } + + public char getToIndex() { + return toIndex; + } + + public String getName() { + return "in" + toIndex; + } + + public int getFrom() { + return from; + } + + public int getTo() { + return to; + } + + @Override + public boolean equals(Object o) { + if (o == null || !(o instanceof InputEdge)) { + return false; + } + InputEdge conn2 = (InputEdge) o; + return conn2.toIndex == toIndex && conn2.from == from && conn2.to == to; + } + + @Override + public String toString() { + return "Edge from " + from + " to " + to + "(" + (int) toIndex + ") "; + } + + @Override + public int hashCode() { + return (from << 20 | to << 8 | toIndex); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java new file mode 100644 index 00000000000..b929fd627c6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputGraph.java @@ -0,0 +1,249 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import com.sun.hotspot.igv.data.Properties; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputGraph extends Properties.Object { + + private Map nodes; + private Set edges; + private Group parent; + private Map blocks; + private Map nodeToBlock; + private boolean isDifferenceGraph; + + public InputGraph(Group parent) { + this(parent, null); + } + + public InputGraph(Group parent, InputGraph last) { + this(parent, last, ""); + } + + private void clearBlocks() { + blocks.clear(); + nodeToBlock.clear(); + } + + public InputGraph(Group parent, InputGraph last, String name) { + this.parent = parent; + setName(name); + nodes = new Hashtable(); + edges = new HashSet(); + blocks = new Hashtable(); + nodeToBlock = new Hashtable(); + if (last != null) { + + for (InputNode n : last.getNodes()) { + addNode(n); + } + + for (InputEdge c : last.getEdges()) { + addEdge(c); + } + } + } + + public void schedule(Collection newBlocks) { + clearBlocks(); + InputBlock noBlock = new InputBlock(this, "no block"); + Set scheduledNodes = new HashSet(); + + for (InputBlock b : newBlocks) { + for (InputNode n : b.getNodes()) { + assert !scheduledNodes.contains(n); + scheduledNodes.add(n); + } + } + + for (InputNode n : this.getNodes()) { + assert nodes.get(n.getId()) == n; + if (!scheduledNodes.contains(n)) { + noBlock.addNode(n.getId()); + } + } + + if (noBlock.getNodes().size() != 0) { + newBlocks.add(noBlock); + } + for (InputBlock b : newBlocks) { + addBlock(b); + } + + for (InputNode n : this.getNodes()) { + assert this.getBlock(n) != null; + } + } + + public void setBlock(InputNode node, InputBlock block) { + nodeToBlock.put(node.getId(), block); + } + + public InputBlock getBlock(int nodeId) { + return nodeToBlock.get(nodeId); + } + + public InputBlock getBlock(InputNode node) { + return getBlock(node.getId()); + } + + public InputGraph getNext() { + List list = parent.getGraphs(); + if (!list.contains(this)) { + return null; + } + int index = list.indexOf(this); + if (index == list.size() - 1) { + return null; + } else { + return list.get(index + 1); + } + } + + public InputGraph getPrev() { + List list = parent.getGraphs(); + if (!list.contains(this)) { + return null; + } + int index = list.indexOf(this); + if (index == 0) { + return null; + } else { + return list.get(index - 1); + } + } + + public String getName() { + return getProperties().get("name"); + } + + public String getAbsoluteName() { + String result = getName(); + if (this.parent != null) { + result = parent.getName() + ": " + result; + } + return result; + } + + public Collection getNodes() { + return Collections.unmodifiableCollection(nodes.values()); + } + + public Set getNodesAsSet() { + return Collections.unmodifiableSet(nodes.keySet()); + } + + public Collection getBlocks() { + return Collections.unmodifiableCollection(blocks.values()); + } + + public void addNode(InputNode node) { + nodes.put(node.getId(), node); + } + + public InputNode getNode(int id) { + return nodes.get(id); + } + + public InputNode removeNode(int index) { + return nodes.remove(index); + } + + public Set getEdges() { + return Collections.unmodifiableSet(edges); + } + + public void removeEdge(InputEdge c) { + assert edges.contains(c); + edges.remove(c); + assert !edges.contains(c); + } + + public void addEdge(InputEdge c) { + assert !edges.contains(c); + edges.add(c); + assert edges.contains(c); + } + + public Group getGroup() { + return parent; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Graph " + getName() + " " + getProperties().toString() + "\n"); + for (InputNode n : nodes.values()) { + sb.append(n.toString()); + sb.append("\n"); + } + + for (InputEdge c : edges) { + sb.append(c.toString()); + sb.append("\n"); + } + return sb.toString(); + } + + public void addBlock(InputBlock b) { + blocks.put(b.getName(), b); + for (InputNode n : b.getNodes()) { + this.nodeToBlock.put(n.getId(), b); + } + } + + public void resolveBlockLinks() { + for (InputBlock b : blocks.values()) { + b.resolveBlockLinks(); + } + } + + public void setName(String s) { + getProperties().setProperty("name", s); + } + + public InputBlock getBlock(String s) { + return blocks.get(s); + } + + public boolean isDifferenceGraph() { + return this.isDifferenceGraph; + } + + public void setIsDifferenceGraph(boolean b) { + isDifferenceGraph = b; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java new file mode 100644 index 00000000000..eac6b1a0308 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputMethod.java @@ -0,0 +1,127 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import com.sun.hotspot.igv.data.Properties; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputMethod extends Properties.Object { + + private String name; + private int bci; + private String shortName; + private List inlined; + private InputMethod parentMethod; + private Group group; + private List bytecodes; + + /** Creates a new instance of InputMethod */ + public InputMethod(Group parent, String name, String shortName, int bci) { + this.group = parent; + this.name = name; + this.bci = bci; + this.shortName = shortName; + inlined = new ArrayList(); + bytecodes = new ArrayList(); + } + + public List getBytecodes() { + return Collections.unmodifiableList(bytecodes); + } + + public List getInlined() { + return Collections.unmodifiableList(inlined); + } + + public void addInlined(InputMethod m) { + + // assert bci unique + for (InputMethod m2 : inlined) { + assert m2.getBci() != m.getBci(); + } + + inlined.add(m); + assert m.parentMethod == null; + m.parentMethod = this; + + for (InputBytecode bc : bytecodes) { + if (bc.getBci() == m.getBci()) { + bc.setInlined(m); + } + } + } + + public Group getGroup() { + return group; + } + + public String getShortName() { + return shortName; + } + + public void setBytecodes(String text) { + + String[] strings = text.split("\n"); + int oldNumber = -1; + for (String s : strings) { + + if (s.length() > 0 && Character.isDigit(s.charAt(0))) { + s = s.trim(); + int spaceIndex = s.indexOf(' '); + String numberString = s.substring(0, spaceIndex); + String tmpName = s.substring(spaceIndex + 1, s.length()); + + int number = -1; + number = Integer.parseInt(numberString); + + // assert correct order of bytecodes + assert number > oldNumber; + + InputBytecode bc = new InputBytecode(number, tmpName); + bytecodes.add(bc); + + for (InputMethod m : inlined) { + if (m.getBci() == number) { + bc.setInlined(m); + break; + } + } + } + } + } + + public String getName() { + return name; + } + + public int getBci() { + return bci; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java new file mode 100644 index 00000000000..ad15d141ac9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/InputNode.java @@ -0,0 +1,73 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputNode extends Properties.Object { + + private int id; + + public InputNode(InputNode n) { + super(n); + setId(n.id); + } + + public InputNode(int id) { + setId(id); + } + + public void setId(int id) { + this.id = id; + getProperties().setProperty("id", "" + id); + } + + public int getId() { + return id; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof InputNode)) { + return false; + } + InputNode n = (InputNode) o; + if (n.id != id) { + return false; + } + return getProperties().equals(n.getProperties()); + } + + @Override + public int hashCode() { + return id; + } + + @Override + public String toString() { + return "Node " + id + " " + getProperties().toString(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Pair.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Pair.java new file mode 100644 index 00000000000..3becd18cbc5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Pair.java @@ -0,0 +1,72 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +/** + * + * @author Thomas Wuerthinger + */ +public class Pair { + + private L l; + private R r; + + public Pair() { + } + + public Pair(L l, R r) { + this.l = l; + this.r = r; + } + + public L getLeft() { + return l; + } + + public void setLeft(L l) { + this.l = l; + } + + public R getRight() { + return r; + } + + public void setRight(R r) { + this.r = r; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof Pair)) { + return false; + } + Pair obj = (Pair) o; + return l.equals(obj.l) && r.equals(obj.r); + } + + @Override + public int hashCode() { + return l.hashCode() * 71 + r.hashCode(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java new file mode 100644 index 00000000000..07a29962f9f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Properties.java @@ -0,0 +1,288 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author Thomas Wuerthinger + */ +public class Properties implements Serializable { + + public static final long serialVersionUID = 1L; + private Map map; + + public Properties() { + map = new HashMap(5); + } + + @Override + public boolean equals(java.lang.Object o) { + if (!(o instanceof Properties)) { + return false; + } + + Properties p = (Properties) o; + + if (getProperties().size() != p.getProperties().size()) { + return false; + } + for (Property prop : getProperties()) { + String value = p.get(prop.getName()); + if (value == null || !value.equals(prop.getValue())) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + int hash = 5; + hash = 83 * hash + (this.map != null ? this.map.hashCode() : 0); + return hash; + } + + public Properties(String name, String value) { + this(); + this.add(new Property(name, value)); + } + + public Properties(String name, String value, String name1, String value1) { + this(name, value); + this.add(new Property(name1, value1)); + } + + public Properties(String name, String value, String name1, String value1, String name2, String value2) { + this(name, value, name1, value1); + this.add(new Property(name2, value2)); + } + + public Properties(Properties p) { + map = new HashMap(p.map); + } + + public static class Object implements Provider { + + private Properties properties; + + public Object() { + properties = new Properties(); + } + + public Object(Properties.Object object) { + properties = new Properties(object.getProperties()); + } + + public Properties getProperties() { + return properties; + } + } + + public interface PropertyMatcher { + + String getName(); + + boolean match(String value); + } + + public static class InvertPropertyMatcher implements PropertyMatcher { + + private PropertyMatcher matcher; + + public InvertPropertyMatcher(PropertyMatcher matcher) { + this.matcher = matcher; + } + + public String getName() { + return matcher.getName(); + } + + public boolean match(String p) { + return !matcher.match(p); + } + } + + public static class StringPropertyMatcher implements PropertyMatcher { + + private String name; + private String value; + + public StringPropertyMatcher(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public boolean match(String p) { + return p.equals(value); + } + } + + public static class RegexpPropertyMatcher implements PropertyMatcher { + + private String name; + private Pattern valuePattern; + + public RegexpPropertyMatcher(String name, String value) { + this.name = name; + valuePattern = Pattern.compile(value); + } + + public String getName() { + return name; + } + + public boolean match(String p) { + Matcher m = valuePattern.matcher(p); + return m.matches(); + } + } + + public Property selectSingle(PropertyMatcher matcher) { + + Property p = this.map.get(matcher.getName()); + if (p == null) { + return null; + } + if (matcher.match(p.getValue())) { + return p; + } else { + return null; + } + } + + public interface Provider { + + public Properties getProperties(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("["); + for (Property p : map.values()) { + sb.append(p.toString()); + } + return sb.append("]").toString(); + } + + public static class PropertySelector { + + private Collection objects; + + public PropertySelector(Collection objects) { + this.objects = objects; + } + + public T selectSingle(final String name, final String value) { + return selectSingle(new StringPropertyMatcher(name, value)); + } + + public T selectSingle(PropertyMatcher matcher) { + + for (T t : objects) { + Property p = t.getProperties().selectSingle(matcher); + if (p != null) { + return t; + } + } + + return null; + } + + public List selectMultiple(final String name, final String value) { + return selectMultiple(new StringPropertyMatcher(name, value)); + } + + public List selectMultiple(PropertyMatcher matcher) { + List result = new ArrayList(); + for (T t : objects) { + Property p = t.getProperties().selectSingle(matcher); + if (p != null) { + result.add(t); + } + } + return result; + } + } + + public String get(String key) { + Property p = map.get(key); + if (p == null) { + return null; + } else { + return p.getValue(); + } + } + + public String getProperty(String string) { + return get(string); + } + + public Property setProperty(String name, String value) { + + if (value == null) { + // remove this property + return map.remove(name); + } else { + Property p = map.get(name); + if (p == null) { + p = new Property(name, value); + map.put(name, p); + } else { + p.setValue(value); + } + return p; + } + } + + public Collection getProperties() { + return Collections.unmodifiableCollection(map.values()); + } + + public void add(Properties properties) { + for (Property p : properties.getProperties()) { + add(p); + } + } + + public void add(Property property) { + assert property.getName() != null; + assert property.getValue() != null; + map.put(property.getName(), property); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java new file mode 100644 index 00000000000..6694153d3b7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/Property.java @@ -0,0 +1,75 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data; + +import java.io.Serializable; + +/** + * + * @author Thomas Wuerthinger + */ +public class Property implements Serializable { + + public static final long serialVersionUID = 1L; + private String name; + private String value; + + public Property() { + this(null, null); + } + + public Property(Property p) { + this(p.getName(), p.getValue()); + } + + public Property(String name) { + this(name, null); + } + + public Property(String name, String value) { + this.name = name; + this.value = value; + } + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public void setName(String s) { + this.name = s; + } + + public void setValue(String s) { + this.value = s; + } + + @Override + public String toString() { + return name + " = " + value + "; "; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java new file mode 100644 index 00000000000..410ee7c41a8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Parser.java @@ -0,0 +1,422 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.serialization; + +import com.sun.hotspot.igv.data.GraphDocument; +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputMethod; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Property; +import com.sun.hotspot.igv.data.services.GroupCallback; +import com.sun.hotspot.igv.data.serialization.XMLParser.ElementHandler; +import com.sun.hotspot.igv.data.serialization.XMLParser.HandoverElementHandler; +import com.sun.hotspot.igv.data.serialization.XMLParser.ParseMonitor; +import com.sun.hotspot.igv.data.serialization.XMLParser.TopElementHandler; +import java.io.IOException; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +/** + * + * @author Thomas Wuerthinger + */ +public class Parser { + + public static final String INDENT = " "; + public static final String TOP_ELEMENT = "graphDocument"; + public static final String GROUP_ELEMENT = "group"; + public static final String GRAPH_ELEMENT = "graph"; + public static final String ROOT_ELEMENT = "graphDocument"; + public static final String PROPERTIES_ELEMENT = "properties"; + public static final String EDGES_ELEMENT = "edges"; + public static final String PROPERTY_ELEMENT = "p"; + public static final String EDGE_ELEMENT = "edge"; + public static final String NODE_ELEMENT = "node"; + public static final String NODES_ELEMENT = "nodes"; + public static final String REMOVE_EDGE_ELEMENT = "removeEdge"; + public static final String REMOVE_NODE_ELEMENT = "removeNode"; + public static final String METHOD_NAME_PROPERTY = "name"; + public static final String METHOD_IS_PUBLIC_PROPERTY = "public"; + public static final String METHOD_IS_STATIC_PROPERTY = "static"; + public static final String TRUE_VALUE = "true"; + public static final String NODE_NAME_PROPERTY = "name"; + public static final String EDGE_NAME_PROPERTY = "name"; + public static final String NODE_ID_PROPERTY = "id"; + public static final String FROM_PROPERTY = "from"; + public static final String TO_PROPERTY = "to"; + public static final String PROPERTY_NAME_PROPERTY = "name"; + public static final String GRAPH_NAME_PROPERTY = "name"; + public static final String TO_INDEX_PROPERTY = "index"; + public static final String METHOD_ELEMENT = "method"; + public static final String INLINE_ELEMENT = "inline"; + public static final String BYTECODES_ELEMENT = "bytecodes"; + public static final String METHOD_BCI_PROPERTY = "bci"; + public static final String METHOD_SHORT_NAME_PROPERTY = "shortName"; + public static final String CONTROL_FLOW_ELEMENT = "controlFlow"; + public static final String BLOCK_NAME_PROPERTY = "name"; + public static final String BLOCK_ELEMENT = "block"; + public static final String SUCCESSORS_ELEMENT = "successors"; + public static final String SUCCESSOR_ELEMENT = "successor"; + public static final String ASSEMBLY_ELEMENT = "assembly"; + public static final String DIFFERENCE_PROPERTY = "difference"; + private TopElementHandler xmlDocument = new TopElementHandler(); + private boolean difference; + private GroupCallback groupCallback; + // + private ElementHandler topHandler = new ElementHandler(TOP_ELEMENT) { + + @Override + protected GraphDocument start() throws SAXException { + return new GraphDocument(); + } + }; + // + private ElementHandler groupHandler = new XMLParser.ElementHandler(GROUP_ELEMENT) { + + @Override + protected Group start() throws SAXException { + Group group = new Group(); + Parser.this.difference = false; + String differenceProperty = this.readAttribute(DIFFERENCE_PROPERTY); + if (differenceProperty != null && (differenceProperty.equals("1") || differenceProperty.equals("true"))) { + Parser.this.difference = true; + } + + ParseMonitor monitor = getMonitor(); + if (monitor != null) { + monitor.setState(group.getName()); + } + + return group; + } + + @Override + protected void end(String text) throws SAXException { + if (groupCallback == null) { + getParentObject().addGroup(getObject()); + } + } + }; + private HandoverElementHandler assemblyHandler = new XMLParser.HandoverElementHandler(ASSEMBLY_ELEMENT, true) { + + @Override + protected void end(String text) throws SAXException { + getParentObject().setAssembly(text); + } + }; + // + private ElementHandler methodHandler = new XMLParser.ElementHandler(METHOD_ELEMENT) { + + @Override + protected InputMethod start() throws SAXException { + + InputMethod method = parseMethod(this, getParentObject()); + getParentObject().setMethod(method); + return method; + } + }; + + private InputMethod parseMethod(XMLParser.ElementHandler handler, Group group) throws SAXException { + String s = handler.readRequiredAttribute(METHOD_BCI_PROPERTY); + int bci = 0; + try { + bci = Integer.parseInt(s); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + InputMethod method = new InputMethod(group, handler.readRequiredAttribute(METHOD_NAME_PROPERTY), handler.readRequiredAttribute(METHOD_SHORT_NAME_PROPERTY), bci); + return method; + } + // + private HandoverElementHandler bytecodesHandler = new XMLParser.HandoverElementHandler(BYTECODES_ELEMENT, true) { + + @Override + protected void end(String text) throws SAXException { + getParentObject().setBytecodes(text); + } + }; + // + private HandoverElementHandler inlinedHandler = new XMLParser.HandoverElementHandler(INLINE_ELEMENT); + // + private ElementHandler inlinedMethodHandler = new XMLParser.ElementHandler(METHOD_ELEMENT) { + + @Override + protected InputMethod start() throws SAXException { + InputMethod method = parseMethod(this, getParentObject().getGroup()); + getParentObject().addInlined(method); + return method; + } + }; + // + private ElementHandler graphHandler = new XMLParser.ElementHandler(GRAPH_ELEMENT) { + + private InputGraph graph; + + @Override + protected InputGraph start() throws SAXException { + + String name = readAttribute(GRAPH_NAME_PROPERTY); + InputGraph previous = getParentObject().getLastAdded(); + if (!difference) { + previous = null; + } + InputGraph curGraph = new InputGraph(getParentObject(), previous, name); + getParentObject().addGraph(curGraph); + this.graph = curGraph; + return curGraph; + } + + @Override + protected void end(String text) throws SAXException { + graph.resolveBlockLinks(); + } + }; + // + private HandoverElementHandler nodesHandler = new HandoverElementHandler(NODES_ELEMENT); + // + private HandoverElementHandler controlFlowHandler = new HandoverElementHandler(CONTROL_FLOW_ELEMENT); + // + private ElementHandler blockHandler = new ElementHandler(BLOCK_ELEMENT) { + + @Override + protected InputBlock start() throws SAXException { + InputGraph graph = getParentObject(); + String name = readRequiredAttribute(BLOCK_NAME_PROPERTY); + InputBlock b = new InputBlock(getParentObject(), name); + graph.addBlock(b); + return b; + } + }; + // + private HandoverElementHandler blockNodesHandler = new HandoverElementHandler(NODES_ELEMENT); + // + private ElementHandler blockNodeHandler = new ElementHandler(NODE_ELEMENT) { + + @Override + protected InputBlock start() throws SAXException { + String s = readRequiredAttribute(NODE_ID_PROPERTY); + + int id = 0; + try { + id = Integer.parseInt(s); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + getParentObject().addNode(id); + return getParentObject(); + } + }; + // + private HandoverElementHandler successorsHandler = new HandoverElementHandler(SUCCESSORS_ELEMENT); + // + private ElementHandler successorHandler = new ElementHandler(SUCCESSOR_ELEMENT) { + + @Override + protected InputBlock start() throws SAXException { + String name = readRequiredAttribute(BLOCK_NAME_PROPERTY); + getParentObject().addSuccessor(name); + return getParentObject(); + } + }; + // + private ElementHandler nodeHandler = new ElementHandler(NODE_ELEMENT) { + + @Override + protected InputNode start() throws SAXException { + String s = readRequiredAttribute(NODE_ID_PROPERTY); + int id = 0; + try { + id = Integer.parseInt(s); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + InputNode node = new InputNode(id); + getParentObject().addNode(node); + return node; + } + }; + // + private ElementHandler removeNodeHandler = new ElementHandler(REMOVE_NODE_ELEMENT) { + + @Override + protected InputNode start() throws SAXException { + String s = readRequiredAttribute(NODE_ID_PROPERTY); + int id = 0; + try { + id = Integer.parseInt(s); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + return getParentObject().removeNode(id); + } + }; + // + private HandoverElementHandler edgesHandler = new HandoverElementHandler(EDGES_ELEMENT); + + // Local class for edge elements + private static class EdgeElementHandler extends ElementHandler { + + public EdgeElementHandler(String name) { + super(name); + } + + @Override + protected InputEdge start() throws SAXException { + int toIndex = 0; + int from = -1; + int to = -1; + + try { + String toIndexString = readAttribute(TO_INDEX_PROPERTY); + if (toIndexString != null) { + toIndex = Integer.parseInt(toIndexString); + } + + from = Integer.parseInt(readRequiredAttribute(FROM_PROPERTY)); + to = Integer.parseInt(readRequiredAttribute(TO_PROPERTY)); + } catch (NumberFormatException e) { + throw new SAXException(e); + } + + + InputEdge conn = new InputEdge((char) toIndex, from, to); + return start(conn); + } + + protected InputEdge start(InputEdge conn) throws SAXException { + return conn; + } + } + // + private EdgeElementHandler edgeHandler = new EdgeElementHandler(EDGE_ELEMENT) { + + @Override + protected InputEdge start(InputEdge conn) throws SAXException { + getParentObject().addEdge(conn); + return conn; + } + }; + // + private EdgeElementHandler removeEdgeHandler = new EdgeElementHandler(REMOVE_EDGE_ELEMENT) { + + @Override + protected InputEdge start(InputEdge conn) throws SAXException { + getParentObject().removeEdge(conn); + return conn; + } + }; + // + private HandoverElementHandler propertiesHandler = new HandoverElementHandler(PROPERTIES_ELEMENT); + // + private HandoverElementHandler groupPropertiesHandler = new HandoverElementHandler(PROPERTIES_ELEMENT) { + + @Override + public void end(String text) throws SAXException { + if (groupCallback != null) { + groupCallback.started(getParentObject()); + } + } + }; + // + private ElementHandler propertyHandler = new XMLParser.ElementHandler(PROPERTY_ELEMENT, true) { + + @Override + public Property start() throws SAXException { + String value = ""; + String name = readRequiredAttribute(PROPERTY_NAME_PROPERTY).intern(); + return getParentObject().getProperties().setProperty(name, value); + } + + @Override + public void end(String text) { + getObject().setValue(text.trim().intern()); + } + }; + + public Parser() { + this(null); + } + + public Parser(GroupCallback groupCallback) { + + this.groupCallback = groupCallback; + + // Initialize dependencies + xmlDocument.addChild(topHandler); + topHandler.addChild(groupHandler); + + groupHandler.addChild(methodHandler); + groupHandler.addChild(assemblyHandler); + groupHandler.addChild(graphHandler); + + methodHandler.addChild(inlinedHandler); + methodHandler.addChild(bytecodesHandler); + + inlinedHandler.addChild(inlinedMethodHandler); + inlinedMethodHandler.addChild(bytecodesHandler); + inlinedMethodHandler.addChild(inlinedHandler); + + graphHandler.addChild(nodesHandler); + graphHandler.addChild(edgesHandler); + graphHandler.addChild(controlFlowHandler); + + controlFlowHandler.addChild(blockHandler); + + blockHandler.addChild(successorsHandler); + successorsHandler.addChild(successorHandler); + blockHandler.addChild(blockNodesHandler); + blockNodesHandler.addChild(blockNodeHandler); + + nodesHandler.addChild(nodeHandler); + nodesHandler.addChild(removeNodeHandler); + edgesHandler.addChild(edgeHandler); + edgesHandler.addChild(removeEdgeHandler); + + methodHandler.addChild(propertiesHandler); + inlinedMethodHandler.addChild(propertiesHandler); + topHandler.addChild(propertiesHandler); + groupHandler.addChild(groupPropertiesHandler); + graphHandler.addChild(propertiesHandler); + nodeHandler.addChild(propertiesHandler); + propertiesHandler.addChild(propertyHandler); + groupPropertiesHandler.addChild(propertyHandler); + } + + // Returns a new GraphDocument object deserialized from an XML input source. + public GraphDocument parse(XMLReader reader, InputSource source, XMLParser.ParseMonitor monitor) throws SAXException { + reader.setContentHandler(new XMLParser(xmlDocument, monitor)); + try { + reader.parse(source); + } catch (IOException ex) { + throw new SAXException(ex); + } + + return topHandler.getObject(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java new file mode 100644 index 00000000000..c5b794fce2f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/Printer.java @@ -0,0 +1,217 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.serialization; + +import com.sun.hotspot.igv.data.GraphDocument; +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputBytecode; +import com.sun.hotspot.igv.data.InputEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputMethod; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Property; +import java.io.IOException; +import java.io.Writer; +import java.util.HashSet; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Printer { + + public void export(Writer writer, GraphDocument document) { + + XMLWriter xmlWriter = new XMLWriter(writer); + + try { + export(xmlWriter, document); + } catch (IOException ex) { + } + } + + private void export(XMLWriter xmlWriter, GraphDocument document) throws IOException { + xmlWriter.startTag(Parser.ROOT_ELEMENT); + xmlWriter.writeProperties(document.getProperties()); + for (Group g : document.getGroups()) { + export(xmlWriter, g); + } + + xmlWriter.endTag(); + xmlWriter.flush(); + } + + private void export(XMLWriter writer, Group g) throws IOException { + Properties attributes = new Properties(); + attributes.add(new Property("difference", Boolean.toString(true))); + writer.startTag(Parser.GROUP_ELEMENT, attributes); + writer.writeProperties(g.getProperties()); + + if (g.getMethod() != null) { + export(writer, g.getMethod()); + } + + InputGraph previous = null; + for (InputGraph graph : g.getGraphs()) { + export(writer, graph, previous, true); + previous = graph; + } + + writer.endTag(); + } + + public void export(XMLWriter writer, InputGraph graph, InputGraph previous, boolean difference) throws IOException { + + writer.startTag(Parser.GRAPH_ELEMENT); + writer.writeProperties(graph.getProperties()); + writer.startTag(Parser.NODES_ELEMENT); + + Set removed = new HashSet(); + Set equal = new HashSet(); + + if (previous != null) { + for (InputNode n : previous.getNodes()) { + int id = n.getId(); + InputNode n2 = graph.getNode(id); + if (n2 == null) { + removed.add(n); + } else if (n.equals(n2)) { + equal.add(n); + } + } + } + + if (difference) { + for (InputNode n : removed) { + writer.simpleTag(Parser.REMOVE_NODE_ELEMENT, new Properties(Parser.NODE_ID_PROPERTY, Integer.toString(n.getId()))); + } + } + + for (InputNode n : graph.getNodes()) { + if (!difference || !equal.contains(n)) { + writer.startTag(Parser.NODE_ELEMENT, new Properties(Parser.NODE_ID_PROPERTY, Integer.toString(n.getId()))); + writer.writeProperties(n.getProperties()); + writer.endTag(); + } + } + + writer.endTag(); + + writer.startTag(Parser.EDGES_ELEMENT); + Set removedEdges = new HashSet(); + Set equalEdges = new HashSet(); + + if (previous != null) { + for (InputEdge e : previous.getEdges()) { + if (graph.getEdges().contains(e)) { + equalEdges.add(e); + } else { + removedEdges.add(e); + } + } + } + + if (difference) { + for (InputEdge e : removedEdges) { + writer.simpleTag(Parser.REMOVE_EDGE_ELEMENT, createProperties(e)); + } + } + + for (InputEdge e : graph.getEdges()) { + if (!difference || !equalEdges.contains(e)) { + if (!equalEdges.contains(e)) { + writer.simpleTag(Parser.EDGE_ELEMENT, createProperties(e)); + } + } + } + + writer.endTag(); + + writer.startTag(Parser.CONTROL_FLOW_ELEMENT); + for (InputBlock b : graph.getBlocks()) { + + writer.startTag(Parser.BLOCK_ELEMENT, new Properties(Parser.BLOCK_NAME_PROPERTY, b.getName())); + + writer.startTag(Parser.SUCCESSORS_ELEMENT); + for (InputBlock s : b.getSuccessors()) { + writer.simpleTag(Parser.SUCCESSOR_ELEMENT, new Properties(Parser.BLOCK_NAME_PROPERTY, s.getName())); + } + writer.endTag(); + + writer.startTag(Parser.NODES_ELEMENT); + for (InputNode n : b.getNodes()) { + writer.simpleTag(Parser.NODE_ELEMENT, new Properties(Parser.NODE_ID_PROPERTY, n.getId() + "")); + } + writer.endTag(); + + writer.endTag(); + + } + + writer.endTag(); + writer.endTag(); + } + + private void export(XMLWriter w, InputMethod method) throws IOException { + + w.startTag(Parser.METHOD_ELEMENT, new Properties(Parser.METHOD_BCI_PROPERTY, method.getBci() + "", Parser.METHOD_NAME_PROPERTY, method.getName(), Parser.METHOD_SHORT_NAME_PROPERTY, method.getShortName())); + + w.writeProperties(method.getProperties()); + + if (method.getInlined().size() > 0) { + w.startTag(Parser.INLINE_ELEMENT); + for (InputMethod m : method.getInlined()) { + export(w, m); + } + w.endTag(); + } + + w.startTag(Parser.BYTECODES_ELEMENT); + + StringBuilder b = new StringBuilder(); + b.append(""); + w.write(b.toString()); + w.endTag(); + w.endTag(); + } + + private Properties createProperties(InputEdge edge) { + Properties p = new Properties(); + p.setProperty(Parser.TO_INDEX_PROPERTY, Integer.toString(edge.getToIndex())); + p.setProperty(Parser.TO_PROPERTY, Integer.toString(edge.getTo())); + p.setProperty(Parser.FROM_PROPERTY, Integer.toString(edge.getFrom())); + return p; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java new file mode 100644 index 00000000000..1efcd06dec9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLParser.java @@ -0,0 +1,254 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.serialization; + +import com.sun.hotspot.igv.data.Property; +import com.sun.hotspot.igv.data.Properties; +import java.util.Hashtable; +import java.util.Stack; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; + +/** + * + * @author Thomas Wuerthinger + */ +public class XMLParser implements ContentHandler { + + public static interface ParseMonitor { + + public void setProgress(double d); + + public void setState(String state); + } + + public static class MissingAttributeException extends SAXException { + + private String name; + + public MissingAttributeException(String name) { + super("Missing attribute \"" + name + "\""); + this.name = name; + } + + public String getAttributeName() { + return this.getMessage(); + } + } + + public static class HandoverElementHandler

    extends ElementHandler { + + @Override + protected P start() throws SAXException { + return getParentObject(); + } + + public HandoverElementHandler(String name) { + super(name); + } + + public HandoverElementHandler(String name, boolean needsText) { + super(name, needsText); + } + } + + public static class TopElementHandler

    extends ElementHandler { + + public TopElementHandler() { + super(null); + } + } + + public static class ElementHandler { + + private String name; + private T object; + private Attributes attr; + private StringBuilder currentText; + private ParseMonitor monitor; + private Hashtable> hashtable; + private boolean needsText; + private ElementHandler parentElement; + + public ElementHandler(String name) { + this(name, false); + } + + public ElementHandler getParentElement() { + return parentElement; + } + + public P getParentObject() { + return getParentElement().getObject(); + } + + protected boolean needsText() { + return needsText; + } + + public ElementHandler(String name, boolean needsText) { + this.hashtable = new Hashtable>(); + this.name = name; + this.needsText = needsText; + } + + public ParseMonitor getMonitor() { + return monitor; + } + + public ElementHandler getChild(String name) { + return hashtable.get(name); + } + + public void addChild(ElementHandler handler) { + assert handler != null; + hashtable.put(handler.getName(), handler); + } + + public String getName() { + return name; + } + + public T getObject() { + return object; + } + + public String readAttribute(String name) { + return attr.getValue(name); + } + + public String readRequiredAttribute(String name) throws SAXException { + String s = readAttribute(name); + if (s == null) { + throw new MissingAttributeException(name); + } + return s; + } + + public void processAttributesAsProperties(Properties p) { + int length = attr.getLength(); + for (int i = 0; i < length; i++) { + String val = attr.getValue(i).intern(); + String localName = attr.getLocalName(i).intern(); + p.add(new Property(val, localName)); + } + } + + public void startElement(ElementHandler parentElement, Attributes attr, ParseMonitor monitor) throws SAXException { + this.currentText = new StringBuilder(); + this.attr = attr; + this.monitor = monitor; + this.parentElement = parentElement; + object = start(); + } + + protected T start() throws SAXException { + return null; + } + + protected void end(String text) throws SAXException { + + } + + public void endElement() throws SAXException { + end(currentText.toString()); + } + + protected void text(char[] c, int start, int length) { + assert currentText != null; + currentText.append(c, start, length); + } + } + private Stack stack; + private ParseMonitor monitor; + + public XMLParser(TopElementHandler rootHandler, ParseMonitor monitor) { + this.stack = new Stack(); + this.monitor = monitor; + this.stack.push(rootHandler); + } + + public void setDocumentLocator(Locator locator) { + if (monitor != null) { + monitor.setState("Starting parsing"); + } + } + + public void startDocument() throws SAXException { + } + + public void endDocument() throws SAXException { + } + + public void startPrefixMapping(String prefix, String uri) throws SAXException { + } + + public void endPrefixMapping(String prefix) throws SAXException { + } + + public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { + + assert !stack.isEmpty(); + ElementHandler parent = stack.peek(); + if (parent != null) { + ElementHandler child = parent.getChild(qName); + if (child != null) { + child.startElement(parent, atts, monitor); + stack.push(child); + return; + } + } + + stack.push(null); + } + + public void endElement(String uri, String localName, String qName) throws SAXException { + ElementHandler handler = stack.pop(); + if (handler != null) { + handler.endElement(); + } + } + + public void characters(char[] ch, int start, int length) throws SAXException { + + assert !stack.isEmpty(); + + + ElementHandler top = stack.peek(); + if (top != null && top.needsText()) { + top.text(ch, start, length); + } + } + + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { + } + + public void processingInstruction(String target, String data) throws SAXException { + } + + public void skippedEntity(String name) throws SAXException { + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java new file mode 100644 index 00000000000..e112dbf4f07 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/serialization/XMLWriter.java @@ -0,0 +1,128 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.data.serialization; + +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Property; +import java.io.IOException; +import java.io.Writer; +import java.util.Stack; + +/** + * + * @author Thomas Wuerthinger + */ +public class XMLWriter extends Writer { + + private Writer inner; + private Stack elementStack; + + public XMLWriter(Writer inner) { + this.inner = inner; + elementStack = new Stack(); + } + + @Override + public void write(char[] arr) throws IOException { + write(arr, 0, arr.length); + } + + public void write(char[] cbuf, int off, int len) throws IOException { + for (int i = off; i < off + len; i++) { + char c = cbuf[i]; + if (c == '>') { + inner.write(">"); + } else if (c == '<') { + inner.write("<"); + } else if (c == '&') { + inner.write("&"); + } else { + inner.write(c); + } + } + } + + public void flush() throws IOException { + inner.flush(); + } + + public void close() throws IOException { + inner.close(); + } + + public void endTag() throws IOException { + inner.write("\n"); + } + + public void startTag(String name) throws IOException { + inner.write("<" + name + ">\n"); + elementStack.push(name); + } + + public void simpleTag(String name) throws IOException { + inner.write("<" + name + "/>\n"); + } + + public void startTag(String name, Properties attributes) throws IOException { + inner.write("<" + name); + elementStack.push(name); + + for (Property p : attributes.getProperties()) { + inner.write(" " + p.getName() + "=\""); + write(p.getValue().toCharArray()); + inner.write("\""); + } + + inner.write(">\n"); + } + + public void simpleTag(String name, Properties attributes) throws IOException { + inner.write("<" + name); + + for (Property p : attributes.getProperties()) { + inner.write(" " + p.getName() + "=\""); + write(p.getValue().toCharArray()); + inner.write("\""); + } + + inner.write("/>\n"); + } + + public void writeProperties(Properties props) throws IOException { + if (props.getProperties().size() == 0) { + return; + } + + startTag(Parser.PROPERTIES_ELEMENT); + + for (Property p : props.getProperties()) { + startTag(Parser.PROPERTY_ELEMENT, new Properties(Parser.PROPERTY_NAME_PROPERTY, p.getName())); + this.write(p.getValue().toCharArray()); + endTag(); + } + + endTag(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GraphViewer.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GraphViewer.java new file mode 100644 index 00000000000..153221d55e5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GraphViewer.java @@ -0,0 +1,35 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.services; + +import com.sun.hotspot.igv.data.InputGraph; + +/** + * + * @author Thomas Wuerthinger + */ +public interface GraphViewer { + + public void view(InputGraph graph); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupCallback.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupCallback.java new file mode 100644 index 00000000000..8b0115e84b1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupCallback.java @@ -0,0 +1,36 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.data.services; + +import com.sun.hotspot.igv.data.Group; + +/** + * + * @author Thomas Wuerthinger + */ +public interface GroupCallback { + + public void started(Group g); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupOrganizer.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupOrganizer.java new file mode 100644 index 00000000000..90d61ebc10d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupOrganizer.java @@ -0,0 +1,39 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.services; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.Pair; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public interface GroupOrganizer { + + public String getName(); + + public List>> organize(List subFolders, List groups); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupReceiver.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupReceiver.java new file mode 100644 index 00000000000..8b730c3e291 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/GroupReceiver.java @@ -0,0 +1,35 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.data.services; + +import java.awt.Component; + +/** + * + * @author Thomas Wuerthinger + */ +public interface GroupReceiver { + + public Component init(GroupCallback callback); +} diff --git a/jdk/src/windows/native/sun/windows/awt_Unicode.cpp b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/InputGraphProvider.java similarity index 68% rename from jdk/src/windows/native/sun/windows/awt_Unicode.cpp rename to hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/InputGraphProvider.java index 669062e5dda..0006ec55a13 100644 --- a/jdk/src/windows/native/sun/windows/awt_Unicode.cpp +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/InputGraphProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -22,25 +22,19 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ +package com.sun.hotspot.igv.data.services; -#include "awt.h" +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import java.util.Set; -LPWSTR J2WHelper1(LPWSTR lpw, LPWSTR lpj, int offset, int nChars) { - memcpy(lpw, lpj + offset, nChars*2); - lpw[nChars] = '\0'; - return lpw; -} - -LPWSTR JNI_J2WHelper1(JNIEnv *env, LPWSTR lpwstr, jstring jstr) { - - int len = env->GetStringLength(jstr); - - env->GetStringRegion(jstr, 0, len, lpwstr); - lpwstr[len] = '\0'; - - return lpwstr; -} - -LPWSTR J2WHelper(LPWSTR lpw, LPWSTR lpj, int nChars) { - return J2WHelper1(lpw, lpj, 0, nChars); +/** + * + * @author Thomas Wuerthinger + */ +public interface InputGraphProvider { + + InputGraph getGraph(); + + void setSelectedNodes(Set nodes); } diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/Scheduler.java b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/Scheduler.java new file mode 100644 index 00000000000..18207df4c1f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Data/src/com/sun/hotspot/igv/data/services/Scheduler.java @@ -0,0 +1,38 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.data.services; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputGraph; +import java.util.Collection; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Scheduler { + + public Collection schedule(InputGraph graph); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/build.xml new file mode 100644 index 00000000000..bc11fd91f85 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.difference. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/manifest.mf new file mode 100644 index 00000000000..febe22452a0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.difference +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/difference/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/build-impl.xml new file mode 100644 index 00000000000..1c1b96a9dea --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/genfiles.properties new file mode 100644 index 00000000000..1c01a0733d1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=1657ecfe +build.xml.script.CRC32=03909051 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=1657ecfe +nbproject/build-impl.xml.script.CRC32=2208e770 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.xml new file mode 100644 index 00000000000..1225db62971 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.difference + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + + com.sun.hotspot.igv.difference + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Bundle.properties new file mode 100644 index 00000000000..5c4d7e177fb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=Difference diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java new file mode 100644 index 00000000000..335344eb77b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Difference/src/com/sun/hotspot/igv/difference/Difference.java @@ -0,0 +1,320 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.difference; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.InputEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Property; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Difference { + + public static final String PROPERTY_STATE = "state"; + public static final String VALUE_NEW = "new"; + public static final String VALUE_CHANGED = "changed"; + public static final String VALUE_SAME = "same"; + public static final String VALUE_DELETED = "deleted"; + public static final String OLD_PREFIX = "OLD_"; + public static final String MAIN_PROPERTY = "name"; + public static final double LIMIT = 100.0; + public static final String[] IGNORE_PROPERTIES = new String[]{"idx", "debug_idx"}; + + public static InputGraph createDiffGraph(InputGraph a, InputGraph b) { + if (a.getGroup() == b.getGroup()) { + return createDiffSameGroup(a, b); + } else { + return createDiff(a, b); + } + } + + private static InputGraph createDiffSameGroup(InputGraph a, InputGraph b) { + Map keyMapB = new HashMap(); + for (InputNode n : b.getNodes()) { + Integer key = n.getId(); + assert !keyMapB.containsKey(key); + keyMapB.put(key, n); + } + + Set pairs = new HashSet(); + + for (InputNode n : a.getNodes()) { + Integer key = n.getId(); + + + if (keyMapB.containsKey(key)) { + InputNode nB = keyMapB.get(key); + pairs.add(new Pair(n, nB)); + } + } + + return createDiff(a, b, pairs); + } + + private static InputGraph createDiff(InputGraph a, InputGraph b, Set pairs) { + Group g = new Group(); + g.setMethod(a.getGroup().getMethod()); + g.setAssembly(a.getGroup().getAssembly()); + g.getProperties().setProperty("name", "Difference"); + InputGraph graph = new InputGraph(g, null); + graph.setName(a.getName() + ", " + b.getName()); + graph.setIsDifferenceGraph(true); + + Set nodesA = new HashSet(a.getNodes()); + Set nodesB = new HashSet(b.getNodes()); + + Map inputNodeMap = new HashMap(); + for (Pair p : pairs) { + InputNode n = p.getN1(); + assert nodesA.contains(n); + InputNode nB = p.getN2(); + assert nodesB.contains(nB); + + nodesA.remove(n); + nodesB.remove(nB); + InputNode n2 = new InputNode(n); + inputNodeMap.put(n, n2); + inputNodeMap.put(nB, n2); + graph.addNode(n2); + markAsChanged(n2, n, nB); + } + + for (InputNode n : nodesA) { + InputNode n2 = new InputNode(n); + graph.addNode(n2); + markAsNew(n2); + inputNodeMap.put(n, n2); + } + + for (InputNode n : nodesB) { + InputNode n2 = new InputNode(n); + n2.setId(-n2.getId()); + graph.addNode(n2); + markAsDeleted(n2); + inputNodeMap.put(n, n2); + } + + Set edgesA = a.getEdges(); + Set edgesB = b.getEdges(); + + Set newEdges = new HashSet(); + + for (InputEdge e : edgesA) { + int from = e.getFrom(); + int to = e.getTo(); + InputNode nodeFrom = inputNodeMap.get(a.getNode(from)); + InputNode nodeTo = inputNodeMap.get(a.getNode(to)); + char index = e.getToIndex(); + + InputEdge newEdge = new InputEdge(index, nodeFrom.getId(), nodeTo.getId()); + if (!newEdges.contains(newEdge)) { + markAsNew(newEdge); + newEdges.add(newEdge); + graph.addEdge(newEdge); + } + } + + for (InputEdge e : edgesB) { + int from = e.getFrom(); + int to = e.getTo(); + InputNode nodeFrom = inputNodeMap.get(b.getNode(from)); + InputNode nodeTo = inputNodeMap.get(b.getNode(to)); + char index = e.getToIndex(); + + InputEdge newEdge = new InputEdge(index, nodeFrom.getId(), nodeTo.getId()); + if (!newEdges.contains(newEdge)) { + markAsDeleted(newEdge); + newEdges.add(newEdge); + graph.addEdge(newEdge); + } else { + newEdges.remove(newEdge); + graph.removeEdge(newEdge); + markAsSame(newEdge); + newEdges.add(newEdge); + graph.addEdge(newEdge); + } + } + + g.addGraph(graph); + return graph; + } + + private static class Pair { + + private InputNode n1; + private InputNode n2; + + public Pair(InputNode n1, InputNode n2) { + this.n1 = n1; + this.n2 = n2; + } + + public double getValue() { + + double result = 0.0; + for (Property p : n1.getProperties().getProperties()) { + double faktor = 1.0; + for (String forbidden : IGNORE_PROPERTIES) { + if (p.getName().equals(forbidden)) { + faktor = 0.1; + break; + } + } + String p2 = n2.getProperties().get(p.getName()); + result += evaluate(p.getValue(), p2) * faktor; + } + + return result; + } + + private double evaluate(String p, String p2) { + if (p2 == null) { + return 1.0; + } + if (p.equals(p2)) { + return 0.0; + } else { + return (double) (Math.abs(p.length() - p2.length())) / p.length() + 0.5; + } + } + + public InputNode getN1() { + return n1; + } + + public InputNode getN2() { + return n2; + } + } + + private static InputGraph createDiff(InputGraph a, InputGraph b) { + + Set matched = new HashSet(); + + Set pairs = new HashSet(); + for (InputNode n : a.getNodes()) { + String s = n.getProperties().get(MAIN_PROPERTY); + if (s == null) { + s = ""; + } + for (InputNode n2 : b.getNodes()) { + String s2 = n2.getProperties().get(MAIN_PROPERTY); + if (s2 == null) { + s2 = ""; + } + + if (s.equals(s2)) { + Pair p = new Pair(n, n2); + pairs.add(p); + } + } + } + + Set selectedPairs = new HashSet(); + while (pairs.size() > 0) { + + double min = Double.MAX_VALUE; + Pair minPair = null; + for (Pair p : pairs) { + double cur = p.getValue(); + if (cur < min) { + minPair = p; + min = cur; + } + } + + if (min > LIMIT) { + break; + } else { + selectedPairs.add(minPair); + + Set toRemove = new HashSet(); + for (Pair p : pairs) { + if (p.getN1() == minPair.getN1() || p.getN2() == minPair.getN2()) { + toRemove.add(p); + } + } + pairs.removeAll(toRemove); + } + } + + return createDiff(a, b, selectedPairs); + } + + private static void markAsNew(InputEdge e) { + e.setState(InputEdge.State.NEW); + } + + private static void markAsDeleted(InputEdge e) { + e.setState(InputEdge.State.DELETED); + + } + + private static void markAsSame(InputEdge e) { + e.setState(InputEdge.State.SAME); + } + + private static void markAsChanged(InputNode n, InputNode firstNode, InputNode otherNode) { + + boolean difference = false; + for (Property p : otherNode.getProperties().getProperties()) { + String s = firstNode.getProperties().getProperty(p.getName()); + if (!p.getValue().equals(s)) { + difference = true; + n.getProperties().add(new Property(OLD_PREFIX + p.getName(), p.getValue())); + } + } + + for (Property p : firstNode.getProperties().getProperties()) { + String s = otherNode.getProperties().getProperty(p.getName()); + if (s == null && p.getValue().length() > 0) { + difference = true; + n.getProperties().add(new Property(OLD_PREFIX + p.getName(), "")); + } + } + + if (difference) { + n.getProperties().add(new Property(PROPERTY_STATE, VALUE_CHANGED)); + } else { + n.getProperties().add(new Property(PROPERTY_STATE, VALUE_SAME)); + } + } + + private static void markAsDeleted(InputNode n) { + n.getProperties().add(new Property(PROPERTY_STATE, VALUE_DELETED)); + } + + private static void markAsNew(InputNode n) { + n.getProperties().add(new Property(PROPERTY_STATE, VALUE_NEW)); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/build.xml new file mode 100644 index 00000000000..2182f70466c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.filter. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf new file mode 100644 index 00000000000..185ff360536 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.filter +OpenIDE-Module-Layer: com/sun/hotspot/igv/filter/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/filter/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/build-impl.xml new file mode 100644 index 00000000000..363a56cc9d9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/genfiles.properties new file mode 100644 index 00000000000..0b45838e076 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=7c032ebf +build.xml.script.CRC32=3b022a25 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=7c032ebf +nbproject/build-impl.xml.script.CRC32=26513f91 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.xml new file mode 100644 index 00000000000..31414d5503e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/project.xml @@ -0,0 +1,80 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.filter + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + org.jdesktop.layout + + + + 1 + 1.4.1 + + + + org.openide.dialogs + + + + 7.5.1 + + + + org.openide.filesystems + + + + 7.3 + + + + org.openide.nodes + + + + 7.2.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.windows + + + + 6.16 + + + + + com.sun.hotspot.igv.filter + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction new file mode 100644 index 00000000000..4ebfb455217 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction @@ -0,0 +1 @@ +com.sun.hotspot.igv.filter.JavaSE6ScriptEngine \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/AbstractFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/AbstractFilter.java new file mode 100644 index 00000000000..d015e641895 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/AbstractFilter.java @@ -0,0 +1,60 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.filter; + +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.Properties; +import org.openide.cookies.OpenCookie; + +/** + * + * @author Thomas Wuerthinger + */ +public abstract class AbstractFilter implements Filter { + + private ChangedEvent changedEvent; + private Properties properties; + + public AbstractFilter() { + changedEvent = new ChangedEvent(this); + properties = new Properties(); + } + + public Properties getProperties() { + return properties; + } + + public OpenCookie getEditor() { + return null; + } + + public ChangedEvent getChangedEvent() { + return changedEvent; + } + + protected void fireChangedEvent() { + changedEvent.fire(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Bundle.properties new file mode 100644 index 00000000000..cd43cb80c2a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Bundle.properties @@ -0,0 +1,11 @@ +OpenIDE-Module-Name=Filter + +jLabel1.text=Name\: +jLabel2.text=Source\: + +nameTextField.text= + +jButton1.text=OK +jButton2.text=Cancel + +title=Edit Filter Dialog diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ColorFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ColorFilter.java new file mode 100644 index 00000000000..f0dd2ca95cb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ColorFilter.java @@ -0,0 +1,138 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Connection.ConnectionStyle; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Selector; +import com.sun.hotspot.igv.data.Properties; +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class ColorFilter extends AbstractFilter { + + private List colorRules; + private String name; + + public ColorFilter(String name) { + this.name = name; + colorRules = new ArrayList(); + } + + public String getName() { + return name; + } + + public void apply(Diagram diagram) { + + Properties.PropertySelector

    selector = new Properties.PropertySelector
    (diagram.getFigures()); + for (ColorRule rule : colorRules) { + if (rule.getSelector() != null) { + List
    figures = rule.getSelector().selected(diagram); + for (Figure f : figures) { + applyRule(rule, f); + if (rule.getColor() != null) { + f.setColor(rule.getColor()); + } + } + } else { + for (Figure f : diagram.getFigures()) { + applyRule(rule, f); + } + } + } + } + + private void applyRule(ColorRule rule, Figure f) { + if (rule.getColor() != null) { + f.setColor(rule.getColor()); + } + Color color = rule.getLineColor(); + ConnectionStyle style = rule.getLineStyle(); + + for (OutputSlot s : f.getOutputSlots()) { + for (Connection c : s.getConnections()) { + if (color != null) { + c.setColor(color); + } + + if (style != null) { + c.setStyle(style); + } + } + } + } + + public void addRule(ColorRule r) { + colorRules.add(r); + } + + public static class ColorRule { + + private Color color; + private Color lineColor; + private Connection.ConnectionStyle lineStyle; + private Selector selector; + + public ColorRule(Selector selector, Color c) { + this(selector, c, null, null); + } + + public ColorRule(Selector selector, Color c, Color lineColor, Connection.ConnectionStyle lineStyle) { + this.selector = selector; + this.color = c; + this.lineColor = lineColor; + this.lineStyle = lineStyle; + + } + + public ColorRule(Color c) { + this(null, c); + } + + public Color getColor() { + return color; + } + + public Selector getSelector() { + return selector; + } + + public Color getLineColor() { + return lineColor; + } + + public Connection.ConnectionStyle getLineStyle() { + return lineStyle; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CombineFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CombineFilter.java new file mode 100644 index 00000000000..613ca154cf4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CombineFilter.java @@ -0,0 +1,194 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.PropertyMatcher; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class CombineFilter extends AbstractFilter { + + private List rules; + private String name; + + public CombineFilter(String name) { + this.name = name; + rules = new ArrayList(); + } + + public String getName() { + return name; + } + + public void apply(Diagram diagram) { + + Properties.PropertySelector
    selector = new Properties.PropertySelector
    (diagram.getFigures()); + for (CombineRule r : rules) { + + List
    list = selector.selectMultiple(r.getFirstMatcher()); + Set
    figuresToRemove = new HashSet
    (); + for (Figure f : list) { + + List
    successors = new ArrayList
    (f.getSuccessors()); + if (r.isReversed()) { + if (successors.size() == 1) { + Figure succ = successors.get(0); + InputSlot slot = null; + + for (InputSlot s : succ.getInputSlots()) { + for (Connection c : s.getConnections()) { + if (c.getOutputSlot().getFigure() == f) { + slot = s; + } + } + } + + assert slot != null; + slot.setName(f.getProperties().get("dump_spec")); + if (f.getProperties().get("short_name") != null) { + slot.setShortName(f.getProperties().get("short_name")); + } else { + String s = f.getProperties().get("dump_spec"); + if (s != null && s.length() <= 5) { + slot.setShortName(s); + } + + } + + for (InputSlot s : f.getInputSlots()) { + for (Connection c : s.getConnections()) { + Connection newConn = diagram.createConnection(slot, c.getOutputSlot()); + newConn.setColor(c.getColor()); + newConn.setStyle(c.getStyle()); + } + } + + figuresToRemove.add(f); + } + } else { + + for (Figure succ : successors) { + if (succ.getPredecessors().size() == 1) { + if (succ.getProperties().selectSingle(r.getSecondMatcher()) != null && succ.getOutputSlots().size() == 1) { + + + OutputSlot oldSlot = null; + for (OutputSlot s : f.getOutputSlots()) { + for (Connection c : s.getConnections()) { + if (c.getInputSlot().getFigure() == succ) { + oldSlot = s; + } + } + } + + assert oldSlot != null; + + OutputSlot nextSlot = succ.getOutputSlots().get(0); + int pos = 0; + if (succ.getProperties().get("con") != null) { + pos = Integer.parseInt(succ.getProperties().get("con")); + } + OutputSlot slot = f.createOutputSlot(pos); + slot.setName(succ.getProperties().get("dump_spec")); + if (succ.getProperties().get("short_name") != null) { + slot.setShortName(succ.getProperties().get("short_name")); + } else { + String s = succ.getProperties().get("dump_spec"); + if (s != null && s.length() <= 2) { + slot.setShortName(s); + } else { + String tmpName = succ.getProperties().get("name"); + if (tmpName != null && tmpName.length() > 0) { + slot.setShortName(tmpName.substring(0, 1)); + } + } + } + for (Connection c : nextSlot.getConnections()) { + Connection newConn = diagram.createConnection(c.getInputSlot(), slot); + newConn.setColor(c.getColor()); + newConn.setStyle(c.getStyle()); + } + + + figuresToRemove.add(succ); + + if (oldSlot.getConnections().size() == 0) { + f.removeSlot(oldSlot); + } + } + } + } + } + } + + diagram.removeAllFigures(figuresToRemove); + } + } + + public void addRule(CombineRule combineRule) { + rules.add(combineRule); + } + + public static class CombineRule { + + private PropertyMatcher first; + private PropertyMatcher second; + private boolean reversed; + + public CombineRule(PropertyMatcher first, PropertyMatcher second) { + this(first, second, false); + + } + + public CombineRule(PropertyMatcher first, PropertyMatcher second, boolean reversed) { + this.first = first; + this.second = second; + this.reversed = reversed; + } + + public boolean isReversed() { + return reversed; + } + + public PropertyMatcher getFirstMatcher() { + return first; + } + + public PropertyMatcher getSecondMatcher() { + return second; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ConnectionFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ConnectionFilter.java new file mode 100644 index 00000000000..d4057918483 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ConnectionFilter.java @@ -0,0 +1,106 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Selector; +import com.sun.hotspot.igv.data.Properties; +import java.awt.Color; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class ConnectionFilter extends AbstractFilter { + + private List connectionStyleRules; + private String name; + + public ConnectionFilter(String name) { + this.name = name; + connectionStyleRules = new ArrayList(); + } + + public String getName() { + return name; + } + + public void apply(Diagram diagram) { + + Properties.PropertySelector
    selector = new Properties.PropertySelector
    (diagram.getFigures()); + for (ConnectionStyleRule rule : connectionStyleRules) { + List
    figures = null; + if (rule.getSelector() != null) { + figures = rule.getSelector().selected(diagram); + } else { + figures = diagram.getFigures(); + } + + for (Figure f : figures) { + for (OutputSlot os : f.getOutputSlots()) { + for (Connection c : os.getConnections()) { + if (figures.contains(c.getInputSlot().getFigure())) { + c.setStyle(rule.getLineStyle()); + c.setColor(rule.getLineColor()); + } + } + } + } + } + } + + public void addRule(ConnectionStyleRule r) { + connectionStyleRules.add(r); + } + + public static class ConnectionStyleRule { + + private Color lineColor; + private Connection.ConnectionStyle lineStyle; + private Selector selector; + + public ConnectionStyleRule(Selector selector, Color lineColor, Connection.ConnectionStyle lineStyle) { + this.selector = selector; + this.lineColor = lineColor; + this.lineStyle = lineStyle; + } + + public Selector getSelector() { + return selector; + } + + public Color getLineColor() { + return lineColor; + } + + public Connection.ConnectionStyle getLineStyle() { + return lineStyle; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java new file mode 100644 index 00000000000..762d8d2a22e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/CustomFilter.java @@ -0,0 +1,159 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.data.Property; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.Collection; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.cookies.OpenCookie; +import org.openide.filesystems.Repository; +import org.openide.filesystems.FileSystem; +import org.openide.filesystems.FileObject; +import org.openide.util.Exceptions; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +public class CustomFilter extends AbstractFilter { + + public static final String JAVASCRIPT_HELPER_ID = "JavaScriptHelper"; + private static ScriptEngineAbstraction engine; + private String code; + private String name; + + public CustomFilter(String name, String code) { + this.name = name; + this.code = code; + getProperties().add(new Property("name", name)); + } + + public String getName() { + return name; + } + + public String getCode() { + return code; + } + + public void setName(String s) { + name = s; + fireChangedEvent(); + } + + public void setCode(String s) { + code = s; + fireChangedEvent(); + } + + @Override + public OpenCookie getEditor() { + return new OpenCookie() { + + public void open() { + openInEditor(); + } + }; + } + + public boolean openInEditor() { + EditFilterDialog dialog = new EditFilterDialog(CustomFilter.this); + dialog.setVisible(true); + return dialog.wasAccepted(); + } + + @Override + public String toString() { + return getName(); + } + + public static ScriptEngineAbstraction getEngine() { + if (engine == null) { + + ScriptEngineAbstraction chosen = null; + try { + Collection list = Lookup.getDefault().lookupAll(ScriptEngineAbstraction.class); + for (ScriptEngineAbstraction s : list) { + if (s.initialize(getJsHelperText())) { + if (chosen == null || !(chosen instanceof JavaSE6ScriptEngine)) { + chosen = s; + } + } + } + } catch (NoClassDefFoundError ncdfe) { + Logger.getLogger("global").log(Level.SEVERE, null, ncdfe); + } + + if (chosen == null) { + NotifyDescriptor message = new NotifyDescriptor.Message("Could not find a scripting engine. Please make sure that the Rhino scripting engine is available. Otherwise filter cannot be used.", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); + chosen = new NullScriptEngine(); + } + + engine = chosen; + } + + return engine; + } + + private static String getJsHelperText() { + InputStream is = null; + StringBuilder sb = new StringBuilder("importPackage(Packages.com.sun.hotspot.igv.filter);importPackage(Packages.com.sun.hotspot.igv.graph);importPackage(Packages.com.sun.hotspot.igv.data);importPackage(Packages.com.sun.hotspot.igv.util);importPackage(java.awt);"); + try { + FileSystem fs = Repository.getDefault().getDefaultFileSystem(); + FileObject fo = fs.getRoot().getFileObject(JAVASCRIPT_HELPER_ID); + is = fo.getInputStream(); + BufferedReader r = new BufferedReader(new InputStreamReader(is)); + String s; + while ((s = r.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + + } catch (IOException ex) { + Logger.getLogger("global").log(Level.SEVERE, null, ex); + } finally { + try { + is.close(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + return sb.toString(); + } + + public void apply(Diagram d) { + getEngine().execute(d, code); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.form b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.form new file mode 100644 index 00000000000..58a40cd1c8a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.form @@ -0,0 +1,133 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.java new file mode 100644 index 00000000000..7383e7f82e5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/EditFilterDialog.java @@ -0,0 +1,161 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.filter; + +import org.openide.windows.WindowManager; + +/** + * + * @author Thomas Wuerthinger + */ +public class EditFilterDialog extends javax.swing.JDialog { + + private CustomFilter customFilter; + private boolean accepted; + + /** Creates new form EditFilterDialog */ + public EditFilterDialog(CustomFilter customFilter) { + super(WindowManager.getDefault().getMainWindow(), true); + this.customFilter = customFilter; + initComponents(); + + sourceTextArea.setText(customFilter.getCode()); + nameTextField.setText(customFilter.getName()); + } + + public boolean wasAccepted() { + return accepted; + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + sourceTextArea = new javax.swing.JTextArea(); + nameTextField = new javax.swing.JTextField(); + nameLabel = new javax.swing.JLabel(); + sourceLabel = new javax.swing.JLabel(); + okButton = new javax.swing.JButton(); + cancelButton = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle(org.openide.util.NbBundle.getMessage(EditFilterDialog.class, "title")); // NOI18N + setResizable(false); + + sourceTextArea.setColumns(20); + sourceTextArea.setRows(5); + jScrollPane1.setViewportView(sourceTextArea); + + nameTextField.setText("null"); + + nameLabel.setText(org.openide.util.NbBundle.getMessage(EditFilterDialog.class, "jLabel1.text")); // NOI18N + + sourceLabel.setText(org.openide.util.NbBundle.getMessage(EditFilterDialog.class, "jLabel2.text")); // NOI18N + + okButton.setText(org.openide.util.NbBundle.getMessage(EditFilterDialog.class, "jButton1.text")); // NOI18N + okButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cancelButtonClicked(evt); + okButtonClicked(evt); + } + }); + + cancelButton.setText(org.openide.util.NbBundle.getMessage(EditFilterDialog.class, "jButton2.text")); // NOI18N + cancelButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cancelButtonClicked(evt); + } + }); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(sourceLabel) + .add(nameLabel)) + .add(25, 25, 25) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 695, Short.MAX_VALUE) + .add(nameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 695, Short.MAX_VALUE))) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() + .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(cancelButton))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(nameLabel) + .add(nameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(sourceLabel) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 337, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 16, Short.MAX_VALUE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(cancelButton) + .add(okButton)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + +private void okButtonClicked(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonClicked + this.customFilter.setName(this.nameTextField.getText()); + this.customFilter.setCode(this.sourceTextArea.getText()); + accepted = true; + setVisible(false); +}//GEN-LAST:event_okButtonClicked + +private void cancelButtonClicked(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonClicked + setVisible(false); +}//GEN-LAST:event_cancelButtonClicked + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton cancelButton; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JLabel nameLabel; + private javax.swing.JTextField nameTextField; + private javax.swing.JButton okButton; + private javax.swing.JLabel sourceLabel; + private javax.swing.JTextArea sourceTextArea; + // End of variables declaration//GEN-END:variables + +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Filter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Filter.java new file mode 100644 index 00000000000..2742ad28bb4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/Filter.java @@ -0,0 +1,45 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.ChangedEventProvider; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.graph.Diagram; +import org.openide.cookies.OpenCookie; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Filter extends Properties.Provider, ChangedEventProvider { + + public String getName(); + + public void apply(Diagram d); + + OpenCookie getEditor(); + + ChangedEvent getChangedEvent(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChain.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChain.java new file mode 100644 index 00000000000..340c7483c2f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChain.java @@ -0,0 +1,155 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.ChangedEventProvider; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class FilterChain implements ChangedEventProvider { + + private List filters; + private transient ChangedEvent changedEvent; + private boolean fireEvents; + + public FilterChain() { + filters = new ArrayList(); + changedEvent = new ChangedEvent(this); + this.fireEvents = true; + } + + public FilterChain(FilterChain f) { + this.filters = new ArrayList(f.filters); + changedEvent = new ChangedEvent(this); + this.fireEvents = true; + } + + public ChangedEvent getChangedEvent() { + return changedEvent; + } + + public Filter getFilterAt(int index) { + assert index >= 0 && index < filters.size(); + return filters.get(index); + } + + public void apply(Diagram d) { + for (Filter f : filters) { + f.apply(d); + } + } + + public void apply(Diagram d, FilterChain sequence) { + List applied = new ArrayList(); + for (Filter f : sequence.getFilters()) { + if (filters.contains(f)) { + f.apply(d); + applied.add(f); + } + } + + + for (Filter f : filters) { + if (!applied.contains(f)) { + f.apply(d); + } + } + } + + public void beginAtomic() { + this.fireEvents = false; + } + + public void endAtomic() { + this.fireEvents = true; + changedEvent.fire(); + } + + public void addFilter(Filter filter) { + assert filter != null; + filters.add(filter); + if (fireEvents) { + changedEvent.fire(); + } + } + + public void addFilterSameSequence(Filter filter) { + assert filter != null; + filters.add(filter); + if (fireEvents) { + changedEvent.fire(); + } + } + + public boolean containsFilter(Filter filter) { + return filters.contains(filter); + } + + public void removeFilter(Filter filter) { + assert filters.contains(filter); + filters.remove(filter); + if (fireEvents) { + changedEvent.fire(); + } + } + + public void moveFilterUp(Filter filter) { + assert filters.contains(filter); + int index = filters.indexOf(filter); + if (index != 0) { + filters.remove(index); + filters.add(index - 1, filter); + } + if (fireEvents) { + changedEvent.fire(); + } + } + + public void moveFilterDown(Filter filter) { + assert filters.contains(filter); + int index = filters.indexOf(filter); + if (index != filters.size() - 1) { + filters.remove(index); + filters.add(index + 1, filter); + } + if (fireEvents) { + changedEvent.fire(); + } + } + + public List getFilters() { + return Collections.unmodifiableList(filters); + } + + public void clear() { + filters.clear(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChainProvider.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChainProvider.java new file mode 100644 index 00000000000..d9ae82e0629 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterChainProvider.java @@ -0,0 +1,35 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +/** + * + * @author Thomas Wuerthinger + */ +public interface FilterChainProvider { + + public FilterChain getFilterChain(); + + public FilterChain getSequence(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterSetting.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterSetting.java new file mode 100644 index 00000000000..aadd4bb32ec --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/FilterSetting.java @@ -0,0 +1,82 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class FilterSetting { + + private Set filters; + private String name; + + public FilterSetting() { + this(null); + } + + public FilterSetting(String name) { + this.name = name; + filters = new HashSet(); + } + + public Set getFilters() { + return Collections.unmodifiableSet(filters); + } + + public void addFilter(Filter f) { + assert !filters.contains(f); + filters.add(f); + } + + public void removeFilter(Filter f) { + assert filters.contains(f); + filters.remove(f); + } + + public boolean containsFilter(Filter f) { + return filters.contains(f); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getFilterCount() { + return filters.size(); + } + + @Override + public String toString() { + return getName(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/JavaSE6ScriptEngine.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/JavaSE6ScriptEngine.java new file mode 100644 index 00000000000..1ba7fbc123a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/JavaSE6ScriptEngine.java @@ -0,0 +1,68 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Diagram; +import javax.script.Bindings; +import javax.script.ScriptContext; +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import org.openide.util.Exceptions; + +/** + * + * @author Thomas Wuerthinger + */ +public class JavaSE6ScriptEngine implements ScriptEngineAbstraction { + + private ScriptEngine engine; + private Bindings bindings; + + public boolean initialize(String jsHelperText) { + try { + ScriptEngineManager sem = new ScriptEngineManager(); + ScriptEngine e = sem.getEngineByName("ECMAScript"); + engine = e; + e.eval(jsHelperText); + Bindings b = e.getContext().getBindings(ScriptContext.ENGINE_SCOPE); + b.put("IO", System.out); + bindings = b; + return true; + } catch (Exception e) { + return false; + } + } + + public void execute(Diagram d, String code) { + try { + Bindings b = bindings; + b.put("graph", d); + engine.eval(code, b); + } catch (ScriptException ex) { + Exceptions.printStackTrace(ex); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/NullScriptEngine.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/NullScriptEngine.java new file mode 100644 index 00000000000..94f3848affb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/NullScriptEngine.java @@ -0,0 +1,40 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Diagram; + +/** + * + * @author Thomas Wuerthinger + */ +public class NullScriptEngine implements ScriptEngineAbstraction { + + public boolean initialize(String jsHelperText) { + return true; + } + + public void execute(Diagram d, String code) { + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveFilter.java new file mode 100644 index 00000000000..f43793ccffe --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveFilter.java @@ -0,0 +1,132 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.Selector; +import com.sun.hotspot.igv.data.Properties; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class RemoveFilter extends AbstractFilter { + + private List rules; + private String name; + + public RemoveFilter(String name) { + this.name = name; + rules = new ArrayList(); + } + + public String getName() { + return name; + } + + public void apply(Diagram diagram) { + + for (RemoveRule r : rules) { + + List
    list = r.getSelector().selected(diagram); + Set
    figuresToRemove = new HashSet
    (); + + List
    protectedFigures = null; + if (r.getRemoveAllWithoutPredecessor()) { + protectedFigures = diagram.getRootFigures(); + } + + for (Figure f : list) { + if (r.getRemoveOnlyInputs()) { + List inputSlots = new ArrayList(); + for (InputSlot is : f.getInputSlots()) { + inputSlots.add(is); + } + for (InputSlot is : inputSlots) { + f.removeSlot(is); + } + + f.createInputSlot(); + } else { + figuresToRemove.add(f); + } + } + + if (r.getRemoveAllWithoutPredecessor()) { + boolean progress = true; + while (progress) { + List
    rootFigures = diagram.getRootFigures(); + progress = false; + for (Figure f : rootFigures) { + if (!protectedFigures.contains(f)) { + figuresToRemove.add(f); + progress = true; + } + } + } + } + + diagram.removeAllFigures(figuresToRemove); + } + } + + public void addRule(RemoveRule rule) { + rules.add(rule); + } + + public static class RemoveRule { + + private Selector selector; + private boolean removeAllWithoutPredecessor; + private boolean removeOnlyInputs; + + public RemoveRule(Selector selector, boolean b) { + this(selector, b, false); + } + + public RemoveRule(Selector selector, boolean removeAllWithoutPredecessor, boolean removeOnlyInputs) { + this.selector = selector; + this.removeOnlyInputs = removeOnlyInputs; + this.removeAllWithoutPredecessor = removeAllWithoutPredecessor; + } + + public Selector getSelector() { + return selector; + } + + public boolean getRemoveOnlyInputs() { + return removeOnlyInputs; + } + + public boolean getRemoveAllWithoutPredecessor() { + return removeAllWithoutPredecessor; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveInputsFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveInputsFilter.java new file mode 100644 index 00000000000..61b21a0652c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveInputsFilter.java @@ -0,0 +1,143 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Selector; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class RemoveInputsFilter extends AbstractFilter { + + private List rules; + private String name; + + public RemoveInputsFilter(String name) { + this.name = name; + rules = new ArrayList(); + } + + public String getName() { + return name; + } + + public void apply(Diagram diagram) { + + for (RemoveInputsRule r : rules) { + + List
    list = r.getSelector().selected(diagram); + for (Figure f : list) { + int z = 0; + List last = new ArrayList(); + for (InputSlot is : f.getInputSlots()) { + if (z >= r.getStartingIndex() && z <= r.getEndIndex() && is.getConnections().size() > 0) { + StringBuilder sb = new StringBuilder(); + List conns = is.getConnections(); + for (int i = 0; i < conns.size(); i++) { + Connection c = conns.get(i); + OutputSlot os = c.getOutputSlot(); + Figure pred = os.getFigure(); + if (i != 0) { + sb.append("
    "); + } + sb.append(pred.getLines()[0]); + } + is.removeAllConnections(); + is.setShortName("X"); + is.setName(sb.toString()); + last.add(is); + } else { + last.clear(); + } + z++; + } + + if (last.size() > 3) { + InputSlot first = last.get(0); + first.setShortName("XX"); + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < last.size(); i++) { + InputSlot is2 = last.get(i); + if (i != 0) { + sb.append("
    "); + } + sb.append(is2.getName()); + } + + first.setName(sb.toString()); + + for (int i = 1; i < last.size(); i++) { + f.removeSlot(last.get(i)); + } + } + } + } + } + + public void addRule(RemoveInputsRule rule) { + rules.add(rule); + } + + public static class RemoveInputsRule { + + private Selector selector; + private int startingIndex; + private int endIndex; + + public RemoveInputsRule(Selector selector) { + this(selector, 0); + } + + public RemoveInputsRule(Selector selector, int startIndex) { + this(selector, startIndex, Integer.MAX_VALUE); + } + + public RemoveInputsRule(Selector selector, int startIndex, int endIndex) { + this.startingIndex = startIndex; + this.endIndex = endIndex; + this.selector = selector; + } + + public int getStartingIndex() { + return startingIndex; + } + + public int getEndIndex() { + return endIndex; + } + + public Selector getSelector() { + return selector; + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveSelfLoopsFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveSelfLoopsFilter.java new file mode 100644 index 00000000000..c8fd54b1156 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/RemoveSelfLoopsFilter.java @@ -0,0 +1,80 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class RemoveSelfLoopsFilter extends AbstractFilter { + + private String name; + + /** Creates a new instance of RemoveSelfLoops */ + public RemoveSelfLoopsFilter(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void apply(Diagram d) { + + for (Figure f : d.getFigures()) { + + for (InputSlot is : f.getInputSlots()) { + + List toRemove = new ArrayList(); + for (Connection c : is.getConnections()) { + + if (c.getOutputSlot().getFigure() == f) { + toRemove.add(c); + } + } + + for (Connection c : toRemove) { + + c.remove(); + + OutputSlot os = c.getOutputSlot(); + if (os.getConnections().size() == 0) { + f.removeSlot(os); + } + + c.getInputSlot().setShortName("O"); + c.getInputSlot().setName("Self Loop"); + } + } + } + } +} diff --git a/jdk/make/tools/winver/src/winver.cpp b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ScriptEngineAbstraction.java similarity index 65% rename from jdk/make/tools/winver/src/winver.cpp rename to hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ScriptEngineAbstraction.java index 6497b9e2ee6..065725ed3da 100644 --- a/jdk/make/tools/winver/src/winver.cpp +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ScriptEngineAbstraction.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -22,28 +22,17 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ +package com.sun.hotspot.igv.filter; -// getver.cpp : Defines the entry point for the console application. -// +import com.sun.hotspot.igv.graph.Diagram; -#include "stdafx.h" -#include +/** + * + * @author Thomas Wuerthinger + */ +public interface ScriptEngineAbstraction { -int main(int argc, char* argv[]) -{ - OSVERSIONINFO verInfo; + public boolean initialize(String jsHelperText); - memset(&verInfo,0,sizeof(verInfo)); - verInfo.dwOSVersionInfoSize = sizeof(verInfo); - - if (GetVersionEx(&verInfo)) - { - printf("%d %d %s",verInfo.dwMajorVersion,verInfo.dwMinorVersion,verInfo.szCSDVersion); - } - else - { - printf("No version info available"); - } - - return 0; + public void execute(Diagram d, String code); } diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java new file mode 100644 index 00000000000..e4c2554bda5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/SplitFilter.java @@ -0,0 +1,70 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filter; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Selector; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class SplitFilter extends AbstractFilter { + + private String name; + private Selector selector; + + public SplitFilter(String name, Selector selector) { + this.name = name; + this.selector = selector; + } + + public String getName() { + return name; + } + + public void apply(Diagram d) { + List
    list = selector.selected(d); + + for (Figure f : list) { + for (OutputSlot os : f.getOutputSlots()) { + for (Connection c : os.getConnections()) { + InputSlot is = c.getInputSlot(); + is.setName(f.getProperties().getProperty("dump_spec")); + String s = f.getProperties().getProperty("short_name"); + if (s != null) { + is.setShortName(s); + } + } + } + + d.removeFigure(f); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/helper.js b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/helper.js new file mode 100644 index 00000000000..d45f682d634 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/helper.js @@ -0,0 +1,71 @@ +/* + * Copyright 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. + * + * 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. + * + */ + + /** + * + * @author Thomas Wuerthinger + */ + +function colorize(property, regexp, color) { + var f = new ColorFilter(""); + f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), color)); + f.apply(graph); +} + +function remove(property, regexp) { + var f = new RemoveFilter(""); + f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), false, false)); + f.apply(graph); +} + +function split(property, regexp) { + var f = new SplitFilter("", new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp))); + f.apply(graph); +} + +function removeInputs(property, regexp, from, to) { + var f = new RemoveInputsFilter(""); + if(from == undefined && to == undefined) { + f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)))); + } else if(to == undefined) { + f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), from)); + } else { + f.addRule(new RemoveInputsFilter.RemoveInputsRule(new MatcherSelector(new Properties.RegexpPropertyMatcher(property, regexp)), from, to)); + } + f.apply(graph); +} + +var black = Color.black; +var blue = Color.blue; +var cyan = Color.cyan; +var darkGray = Color.darkGray; +var gray = Color.gray; +var green = Color.green; +var lightGray = Color.lightGray; +var magenta = Color.magenta; +var orange = Color.orange; +var pink = Color.pink +var red = Color.red; +var yellow = Color.yellow; +var white = Color.white; diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/layer.xml new file mode 100644 index 00000000000..32fe79fc1a8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/layer.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/build.xml new file mode 100644 index 00000000000..e604ea7bcba --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.filterwindow. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/manifest.mf new file mode 100644 index 00000000000..ba1485636f6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.filterwindow +OpenIDE-Module-Layer: com/sun/hotspot/igv/filterwindow/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/filterwindow/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/build-impl.xml new file mode 100644 index 00000000000..01265560daa --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/genfiles.properties new file mode 100644 index 00000000000..b9832d5e596 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=401b2654 +build.xml.script.CRC32=9c158403 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=401b2654 +nbproject/build-impl.xml.script.CRC32=19fb08e0 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.xml new file mode 100644 index 00000000000..7740f12aef9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/project.xml @@ -0,0 +1,109 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.filterwindow + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.filter + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + com.sun.hotspot.igv.util + + + + 1.0 + + + + org.openide.actions + + + + 6.6.1.1 + + + + org.openide.dialogs + + + + 7.5.1 + + + + org.openide.explorer + + + + 6.12.1 + + + + org.openide.filesystems + + + + 7.3.1 + + + + org.openide.loaders + + + + 6.7.1 + + + + org.openide.nodes + + + + 7.2.1.1 + + + + org.openide.util + + + + 7.10.1.1 + + + + org.openide.windows + + + + 6.18.1 + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/META-INF/services/com.sun.hotspot.igv.filter.FilterChainProvider b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/META-INF/services/com.sun.hotspot.igv.filter.FilterChainProvider new file mode 100644 index 00000000000..a3cdc882cca --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/META-INF/services/com.sun.hotspot.igv.filter.FilterChainProvider @@ -0,0 +1 @@ +com.sun.hotspot.igv.filterwindow.FilterChainProviderImplementation diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/Bundle.properties new file mode 100644 index 00000000000..c7f2ba7357f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/Bundle.properties @@ -0,0 +1,3 @@ +OpenIDE-Module-Name=FilterWindow +CTL_FilterTopComponent=Filter Window +HINT_FilterTopComponent=This is a Filter window diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckListView.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckListView.java new file mode 100644 index 00000000000..911a7c7e535 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckListView.java @@ -0,0 +1,52 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import javax.swing.JList; +import org.openide.explorer.view.ListView; +import org.openide.explorer.view.NodeListModel; + +/** + * + * @author Thomas Wuerthinger + */ +public class CheckListView extends ListView { + + @Override + public void showSelection(int[] indices) { + super.showSelection(indices); + } + + @Override + protected NodeListModel createModel() { + return new CheckNodeListModel(); + } + + @Override + protected JList createList() { + JList tmpList = super.createList(); + tmpList.setCellRenderer(new CheckRenderer(tmpList)); + return tmpList; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNode.java new file mode 100644 index 00000000000..d8f2e04abe0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNode.java @@ -0,0 +1,70 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import com.sun.hotspot.igv.data.ChangedEvent; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +public class CheckNode extends AbstractNode { + + private ChangedEvent selectionChangedEvent; + public boolean selected; + public boolean enabled; + + public CheckNode(Children c, Lookup lookup) { + super(c, lookup); + selectionChangedEvent = new ChangedEvent(this); + selected = false; + enabled = true; + } + + public ChangedEvent getSelectionChangedEvent() { + return selectionChangedEvent; + } + + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean b) { + if (b != selected) { + selected = b; + selectionChangedEvent.fire(); + } + } + + public void setEnabled(boolean b) { + enabled = b; + } + + public boolean isEnabled() { + return enabled; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNodeListModel.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNodeListModel.java new file mode 100644 index 00000000000..caf75023000 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckNodeListModel.java @@ -0,0 +1,46 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import org.openide.explorer.view.NodeListModel; +import org.openide.nodes.Node; + +/** + * + * @author Thomas Wuerthinger + */ +public class CheckNodeListModel extends NodeListModel { + + private Node rootNode; + + @Override + public void setNode(Node rootNode) { + this.rootNode = rootNode; + super.setNode(rootNode); + } + + public CheckNode getCheckNodeAt(int index) { + return (CheckNode) rootNode.getChildren().getNodes()[index]; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckRenderer.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckRenderer.java new file mode 100644 index 00000000000..f37716ff049 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/CheckRenderer.java @@ -0,0 +1,88 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JCheckBox; +import javax.swing.JList; +import javax.swing.ListCellRenderer; + +/** + * @author Thomas Wuerthinger + */ +public class CheckRenderer extends JCheckBox implements ListCellRenderer { + + private JList list; + private Color startBackground; + + public CheckRenderer(final JList list) { + this.list = list; + list.addMouseListener( + new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + int index = list.locationToIndex(e.getPoint()); + Point p2 = list.indexToLocation(index); + Rectangle r = new Rectangle(p2.x, p2.y, getPreferredSize().height, getPreferredSize().height); + if (r.contains(e.getPoint())) { + CheckNode node = ((CheckNodeListModel) list.getModel()).getCheckNodeAt(index); + node.setSelected(!node.isSelected()); + list.repaint(); + e.consume(); + } + } + }); + + this.setPreferredSize(new Dimension(getPreferredSize().width, getPreferredSize().height - 5)); + startBackground = this.getBackground(); + } + + public Component getListCellRendererComponent(final JList list, Object value, final int index, boolean isSelected, boolean cellHasFocus) { + setText(value.toString()); + CheckNode node = ((CheckNodeListModel) list.getModel()).getCheckNodeAt(index); + this.setSelected(node.isSelected()); + this.setEnabled(list.isEnabled()); + + if (isSelected && list.hasFocus()) { + this.setBackground(list.getSelectionBackground()); + this.setForeground(list.getSelectionForeground()); + } else if (isSelected) { + assert !list.hasFocus(); + this.setBackground(startBackground); + this.setForeground(list.getForeground()); + + } else { + this.setBackground(list.getBackground()); + this.setForeground(list.getForeground()); + } + return this; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterChainProviderImplementation.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterChainProviderImplementation.java new file mode 100644 index 00000000000..407ce3989ab --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterChainProviderImplementation.java @@ -0,0 +1,42 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.filter.FilterChainProvider; + +/** + * + * @author Thomas Wuerthinger + */ +public class FilterChainProviderImplementation implements FilterChainProvider { + + public FilterChain getFilterChain() { + return FilterTopComponent.findInstance().getFilterChain(); + } + + public FilterChain getSequence() { + return FilterTopComponent.findInstance().getSequence(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterNode.java new file mode 100644 index 00000000000..962651327b3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterNode.java @@ -0,0 +1,112 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import com.sun.hotspot.igv.filterwindow.actions.MoveFilterDownAction; +import com.sun.hotspot.igv.filterwindow.actions.MoveFilterUpAction; +import com.sun.hotspot.igv.filterwindow.actions.RemoveFilterAction; +import com.sun.hotspot.igv.filter.Filter; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.util.PropertiesSheet; +import javax.swing.Action; +import org.openide.actions.OpenAction; +import org.openide.nodes.Children; +import org.openide.nodes.Sheet; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.Utilities; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; + +/** + * + * @author Thomas Wuerthinger + */ +public class FilterNode extends CheckNode implements LookupListener, ChangedListener { + + private Filter filter; + private Lookup.Result result; + + public FilterNode(Filter filter) { + this(filter, new InstanceContent()); + } + + private FilterNode(Filter filter, InstanceContent content) { + super(Children.LEAF, new AbstractLookup(content)); + content.add(filter); + + content.add(filter.getEditor()); + this.filter = filter; + filter.getChangedEvent().addListener(new ChangedListener() { + + public void changed(Filter source) { + update(); + } + }); + + update(); + + Lookup.Template tpl = new Lookup.Template(FilterChain.class); + result = Utilities.actionsGlobalContext().lookup(tpl); + result.addLookupListener(this); + + FilterTopComponent.findInstance().getFilterSettingsChangedEvent().addListener(this); + resultChanged(null); + } + + private void update() { + this.setDisplayName(filter.getName()); + } + + public Filter getFilter() { + return filter; + } + + @Override + protected Sheet createSheet() { + Sheet s = super.createSheet(); + PropertiesSheet.initializeSheet(getFilter().getProperties(), s); + return s; + } + + @Override + public Action[] getActions(boolean b) { + return new Action[]{(Action) OpenAction.findObject(OpenAction.class, true), (Action) MoveFilterUpAction.findObject(MoveFilterUpAction.class, true), (Action) MoveFilterDownAction.findObject(MoveFilterDownAction.class, true), (Action) RemoveFilterAction.findObject(RemoveFilterAction.class, true)}; + } + + @Override + public Action getPreferredAction() { + return OpenAction.get(OpenAction.class).createContextAwareInstance(Utilities.actionsGlobalContext()); + } + + public void resultChanged(LookupEvent lookupEvent) { + changed(FilterTopComponent.findInstance()); + } + + public void changed(FilterTopComponent source) { + setSelected(source.getFilterChain().containsFilter(filter)); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.form b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.form new file mode 100644 index 00000000000..f3fc524ebe3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.form @@ -0,0 +1,16 @@ + + +
    + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java new file mode 100644 index 00000000000..7cd32e8f6ef --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java @@ -0,0 +1,689 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow; + +import com.sun.hotspot.igv.filterwindow.actions.MoveFilterDownAction; +import com.sun.hotspot.igv.filterwindow.actions.MoveFilterUpAction; +import com.sun.hotspot.igv.filterwindow.actions.NewFilterAction; +import com.sun.hotspot.igv.filterwindow.actions.RemoveFilterAction; +import com.sun.hotspot.igv.filterwindow.actions.RemoveFilterSettingsAction; +import com.sun.hotspot.igv.filterwindow.actions.SaveFilterSettingsAction; +import com.sun.hotspot.igv.filter.CustomFilter; +import com.sun.hotspot.igv.filter.Filter; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.filter.FilterSetting; +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.data.ChangedListener; +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Serializable; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.swing.JComboBox; +import javax.swing.UIManager; +import javax.swing.border.Border; +import org.openide.DialogDisplayer; +import org.openide.ErrorManager; +import org.openide.NotifyDescriptor; +import org.openide.awt.ToolbarPool; +import org.openide.explorer.ExplorerManager; +import org.openide.explorer.ExplorerUtils; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.util.Exceptions; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.awt.Toolbar; +import org.openide.filesystems.FileLock; +import org.openide.util.actions.SystemAction; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; +import org.openide.filesystems.Repository; +import org.openide.filesystems.FileSystem; +import org.openide.filesystems.FileObject; + +/** + * + * @author Thomas Wuerthinger + */ +public final class FilterTopComponent extends TopComponent implements LookupListener, ExplorerManager.Provider { + + private static FilterTopComponent instance; + public static final String FOLDER_ID = "Filters"; + public static final String AFTER_ID = "after"; + public static final String ENABLED_ID = "enabled"; + public static final String PREFERRED_ID = "FilterTopComponent"; + private CheckListView view; + private ExplorerManager manager; + private FilterChain filterChain; + private FilterChain sequence; + private Lookup.Result result; + private JComboBox comboBox; + private List filterSettings; + private FilterSetting customFilterSetting = new FilterSetting("-- Custom --"); + private ChangedEvent filterSettingsChangedEvent; + private ActionListener comboBoxActionListener = new ActionListener() { + + public void actionPerformed(ActionEvent e) { + comboBoxSelectionChanged(); + } + }; + + public ChangedEvent getFilterSettingsChangedEvent() { + return filterSettingsChangedEvent; + } + + public FilterChain getSequence() { + return sequence; + } + + public void updateSelection() { + Node[] nodes = this.getExplorerManager().getSelectedNodes(); + int[] arr = new int[nodes.length]; + for (int i = 0; i < nodes.length; i++) { + int index = sequence.getFilters().indexOf(((FilterNode) nodes[i]).getFilter()); + arr[i] = index; + } + view.showSelection(arr); + } + + private void comboBoxSelectionChanged() { + + Object o = comboBox.getSelectedItem(); + if (o == null) { + return; + } + assert o instanceof FilterSetting; + FilterSetting s = (FilterSetting) o; + + if (s != customFilterSetting) { + FilterChain chain = getFilterChain(); + chain.beginAtomic(); + List toRemove = new ArrayList(); + for (Filter f : chain.getFilters()) { + if (!s.containsFilter(f)) { + toRemove.add(f); + } + } + for (Filter f : toRemove) { + chain.removeFilter(f); + } + + for (Filter f : s.getFilters()) { + if (!chain.containsFilter(f)) { + chain.addFilter(f); + } + } + + chain.endAtomic(); + filterSettingsChangedEvent.fire(); + } else { + this.updateComboBoxSelection(); + } + + SystemAction.get(RemoveFilterSettingsAction.class).setEnabled(comboBox.getSelectedItem() != this.customFilterSetting); + SystemAction.get(SaveFilterSettingsAction.class).setEnabled(comboBox.getSelectedItem() == this.customFilterSetting); + } + + private void updateComboBox() { + comboBox.removeAllItems(); + comboBox.addItem(customFilterSetting); + for (FilterSetting s : filterSettings) { + comboBox.addItem(s); + } + + this.updateComboBoxSelection(); + } + + public void addFilterSetting() { + NotifyDescriptor.InputLine l = new NotifyDescriptor.InputLine("Enter a name:", "Filter"); + if (DialogDisplayer.getDefault().notify(l) == NotifyDescriptor.OK_OPTION) { + String name = l.getInputText(); + + FilterSetting toRemove = null; + for (FilterSetting s : filterSettings) { + if (s.getName().equals(name)) { + NotifyDescriptor.Confirmation conf = new NotifyDescriptor.Confirmation("Filter \"" + name + "\" already exists, to you want to overwrite?", "Filter"); + if (DialogDisplayer.getDefault().notify(conf) == NotifyDescriptor.YES_OPTION) { + toRemove = s; + break; + } else { + return; + } + } + } + + if (toRemove != null) { + filterSettings.remove(toRemove); + } + FilterSetting setting = createFilterSetting(name); + filterSettings.add(setting); + + // Sort alphabetically + Collections.sort(filterSettings, new Comparator() { + + public int compare(FilterSetting o1, FilterSetting o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + + updateComboBox(); + } + } + + public boolean canRemoveFilterSetting() { + return comboBox.getSelectedItem() != customFilterSetting; + } + + public void removeFilterSetting() { + if (canRemoveFilterSetting()) { + Object o = comboBox.getSelectedItem(); + assert o instanceof FilterSetting; + FilterSetting f = (FilterSetting) o; + assert f != customFilterSetting; + assert filterSettings.contains(f); + NotifyDescriptor.Confirmation l = new NotifyDescriptor.Confirmation("Do you really want to remove filter \"" + f + "\"?", "Filter"); + if (DialogDisplayer.getDefault().notify(l) == NotifyDescriptor.YES_OPTION) { + filterSettings.remove(f); + updateComboBox(); + } + } + } + + private FilterSetting createFilterSetting(String name) { + FilterSetting s = new FilterSetting(name); + FilterChain chain = this.getFilterChain(); + for (Filter f : chain.getFilters()) { + s.addFilter(f); + } + return s; + } + + private void updateComboBoxSelection() { + List filters = this.getFilterChain().getFilters(); + boolean found = false; + for (FilterSetting s : filterSettings) { + if (s.getFilterCount() == filters.size()) { + boolean ok = true; + for (Filter f : filters) { + if (!s.containsFilter(f)) { + ok = false; + } + } + + if (ok) { + if (comboBox.getSelectedItem() != s) { + comboBox.setSelectedItem(s); + } + found = true; + break; + } + } + } + + if (!found && comboBox.getSelectedItem() != customFilterSetting) { + comboBox.setSelectedItem(customFilterSetting); + } + } + + private class FilterChildren extends Children.Keys implements ChangedListener { + + //private Node[] oldSelection; + //private ArrayList newSelection; + private HashMap nodeHash = new HashMap(); + + protected Node[] createNodes(Object object) { + if (nodeHash.containsKey(object)) { + return new Node[]{nodeHash.get(object)}; + } + + assert object instanceof Filter; + Filter filter = (Filter) object; + com.sun.hotspot.igv.filterwindow.FilterNode node = new com.sun.hotspot.igv.filterwindow.FilterNode(filter); + node.getSelectionChangedEvent().addListener(this); + nodeHash.put(object, node); + return new Node[]{node}; + } + + public FilterChildren() { + sequence.getChangedEvent().addListener(new ChangedListener() { + + public void changed(FilterChain source) { + addNotify(); + } + }); + + setBefore(false); + } + + protected void addNotify() { + setKeys(sequence.getFilters()); + updateSelection(); + } + + public void changed(CheckNode source) { + FilterNode node = (FilterNode) source; + Filter f = node.getFilter(); + FilterChain chain = getFilterChain(); + if (node.isSelected()) { + if (!chain.containsFilter(f)) { + chain.addFilter(f); + } + } else { + if (chain.containsFilter(f)) { + chain.removeFilter(f); + } + } + view.revalidate(); + view.repaint(); + updateComboBoxSelection(); + } + } + + public FilterChain getFilterChain() { + return filterChain;/* + EditorTopComponent tc = EditorTopComponent.getActive(); + if (tc == null) { + return filterChain; + } + return tc.getFilterChain();*/ + } + + private FilterTopComponent() { + filterSettingsChangedEvent = new ChangedEvent(this); + initComponents(); + setName(NbBundle.getMessage(FilterTopComponent.class, "CTL_FilterTopComponent")); + setToolTipText(NbBundle.getMessage(FilterTopComponent.class, "HINT_FilterTopComponent")); + // setIcon(Utilities.loadImage(ICON_PATH, true)); + + sequence = new FilterChain(); + filterChain = new FilterChain(); + initFilters(); + manager = new ExplorerManager(); + manager.setRootContext(new AbstractNode(new FilterChildren())); + associateLookup(ExplorerUtils.createLookup(manager, getActionMap())); + view = new CheckListView(); + + ToolbarPool.getDefault().setPreferredIconSize(16); + Toolbar toolBar = new Toolbar(); + Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N + toolBar.setBorder(b); + comboBox = new JComboBox(); + toolBar.add(comboBox); + this.add(toolBar, BorderLayout.NORTH); + toolBar.add(SaveFilterSettingsAction.get(SaveFilterSettingsAction.class)); + toolBar.add(RemoveFilterSettingsAction.get(RemoveFilterSettingsAction.class)); + toolBar.addSeparator(); + toolBar.add(MoveFilterUpAction.get(MoveFilterUpAction.class).createContextAwareInstance(this.getLookup())); + toolBar.add(MoveFilterDownAction.get(MoveFilterDownAction.class).createContextAwareInstance(this.getLookup())); + toolBar.add(RemoveFilterAction.get(RemoveFilterAction.class).createContextAwareInstance(this.getLookup())); + toolBar.add(NewFilterAction.get(NewFilterAction.class)); + this.add(view, BorderLayout.CENTER); + + filterSettings = new ArrayList(); + updateComboBox(); + + comboBox.addActionListener(comboBoxActionListener); + setChain(filterChain); + } + + public void newFilter() { + CustomFilter cf = new CustomFilter("My custom filter", ""); + if (cf.openInEditor()) { + sequence.addFilter(cf); + FileObject fo = getFileObject(cf); + FilterChangedListener listener = new FilterChangedListener(fo, cf); + listener.changed(cf); + cf.getChangedEvent().addListener(listener); + } + } + + public void removeFilter(Filter f) { + com.sun.hotspot.igv.filter.CustomFilter cf = (com.sun.hotspot.igv.filter.CustomFilter) f; + + sequence.removeFilter(cf); + try { + getFileObject(cf).delete(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + + } + + private static class FilterChangedListener implements ChangedListener { + + private FileObject fileObject; + private CustomFilter filter; + + public FilterChangedListener(FileObject fo, CustomFilter cf) { + fileObject = fo; + filter = cf; + } + + public void changed(Filter source) { + try { + if (!fileObject.getName().equals(filter.getName())) { + FileLock lock = fileObject.lock(); + fileObject.move(lock, fileObject.getParent(), filter.getName(), ""); + lock.releaseLock(); + FileObject newFileObject = fileObject.getParent().getFileObject(filter.getName()); + fileObject = newFileObject; + + } + + FileLock lock = fileObject.lock(); + OutputStream os = fileObject.getOutputStream(lock); + Writer w = new OutputStreamWriter(os); + String s = filter.getCode(); + w.write(s); + w.close(); + lock.releaseLock(); + + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + + public void initFilters() { + + FileSystem fs = Repository.getDefault().getDefaultFileSystem(); + FileObject folder = fs.getRoot().getFileObject(FOLDER_ID); + FileObject[] children = folder.getChildren(); + + List customFilters = new ArrayList(); + HashMap afterMap = new HashMap(); + Set enabledSet = new HashSet(); + HashMap map = new HashMap(); + + for (final FileObject fo : children) { + InputStream is = null; + + String code = ""; + FileLock lock = null; + try { + lock = fo.lock(); + is = fo.getInputStream(); + BufferedReader r = new BufferedReader(new InputStreamReader(is)); + String s; + StringBuffer sb = new StringBuffer(); + while ((s = r.readLine()) != null) { + sb.append(s); + sb.append("\n"); + } + code = sb.toString(); + + } catch (FileNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } finally { + try { + is.close(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + lock.releaseLock(); + } + + String displayName = fo.getName(); + + + final CustomFilter cf = new CustomFilter(displayName, code); + map.put(displayName, cf); + + String after = (String) fo.getAttribute(AFTER_ID); + afterMap.put(cf, after); + + Boolean enabled = (Boolean) fo.getAttribute(ENABLED_ID); + if (enabled != null && (boolean) enabled) { + enabledSet.add(cf); + } + + cf.getChangedEvent().addListener(new FilterChangedListener(fo, cf)); + + customFilters.add(cf); + } + + for (int j = 0; j < customFilters.size(); j++) { + for (int i = 0; i < customFilters.size(); i++) { + List copiedList = new ArrayList(customFilters); + for (CustomFilter cf : copiedList) { + + String after = afterMap.get(cf); + + if (map.containsKey(after)) { + CustomFilter afterCf = map.get(after); + int index = customFilters.indexOf(afterCf); + int currentIndex = customFilters.indexOf(cf); + + if (currentIndex < index) { + customFilters.remove(currentIndex); + customFilters.add(index, cf); + } + } + } + } + } + + for (CustomFilter cf : customFilters) { + sequence.addFilter(cf); + if (enabledSet.contains(cf)) { + filterChain.addFilter(cf); + } + } + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + setLayout(new java.awt.BorderLayout()); + + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + /** + * Gets default instance. Do not use directly: reserved for *.settings files only, + * i.e. deserialization routines; otherwise you could get a non-deserialized instance. + * To obtain the singleton instance, use {@link findInstance}. + */ + public static synchronized FilterTopComponent getDefault() { + if (instance == null) { + instance = new FilterTopComponent(); + } + return instance; + } + + /** + * Obtain the FilterTopComponent instance. Never call {@link #getDefault} directly! + */ + public static synchronized FilterTopComponent findInstance() { + TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); + if (win == null) { + ErrorManager.getDefault().log(ErrorManager.WARNING, "Cannot find Filter component. It will not be located properly in the window system."); + return getDefault(); + } + if (win instanceof FilterTopComponent) { + return (FilterTopComponent) win; + } + ErrorManager.getDefault().log(ErrorManager.WARNING, "There seem to be multiple components with the '" + PREFERRED_ID + "' ID. That is a potential source of errors and unexpected behavior."); + return getDefault(); + } + + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_ALWAYS; + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + @Override + public ExplorerManager getExplorerManager() { + return manager; + } + + @Override + public void componentOpened() { + Lookup.Template tpl = new Lookup.Template(FilterChain.class); + result = Utilities.actionsGlobalContext().lookup(tpl); + result.addLookupListener(this); + } + + @Override + public void componentClosed() { + result.removeLookupListener(this); + result = null; + } + + public void resultChanged(LookupEvent lookupEvent) { + setChain(Utilities.actionsGlobalContext().lookup(FilterChain.class)); + /* + EditorTopComponent tc = EditorTopComponent.getActive(); + if (tc != null) { + setChain(tc.getFilterChain()); + }*/ + } + + public void setChain(FilterChain chain) { + updateComboBoxSelection(); + } + + private FileObject getFileObject(CustomFilter cf) { + FileObject fo = Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject(FOLDER_ID + "/" + cf.getName()); + if (fo == null) { + try { + fo = org.openide.filesystems.Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject(FOLDER_ID).createData(cf.getName()); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + return fo; + } + + @Override + public void writeExternal(ObjectOutput out) throws IOException { + super.writeExternal(out); + + out.writeInt(filterSettings.size()); + for (FilterSetting f : filterSettings) { + out.writeUTF(f.getName()); + + out.writeInt(f.getFilterCount()); + for (Filter filter : f.getFilters()) { + CustomFilter cf = (CustomFilter) filter; + out.writeUTF(cf.getName()); + } + } + + CustomFilter prev = null; + for (Filter f : this.sequence.getFilters()) { + CustomFilter cf = (CustomFilter) f; + FileObject fo = getFileObject(cf); + if (getFilterChain().containsFilter(cf)) { + fo.setAttribute(ENABLED_ID, true); + } else { + fo.setAttribute(ENABLED_ID, false); + } + + if (prev == null) { + fo.setAttribute(AFTER_ID, null); + } else { + fo.setAttribute(AFTER_ID, prev.getName()); + } + + prev = cf; + } + } + + public CustomFilter findFilter(String name) { + for (Filter f : sequence.getFilters()) { + + CustomFilter cf = (CustomFilter) f; + if (cf.getName().equals(name)) { + return cf; + } + } + + return null; + } + + @Override + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + super.readExternal(in); + + int filterSettingsCount = in.readInt(); + for (int i = 0; i < filterSettingsCount; i++) { + String name = in.readUTF(); + FilterSetting s = new FilterSetting(name); + int filterCount = in.readInt(); + for (int j = 0; j < filterCount; j++) { + String filterName = in.readUTF(); + CustomFilter filter = findFilter(filterName); + if (filter != null) { + s.addFilter(filter); + } + } + + filterSettings.add(s); + } + updateComboBox(); + } + + final static class ResolvableHelper implements Serializable { + + private static final long serialVersionUID = 1L; + + public Object readResolve() { + return FilterTopComponent.getDefault(); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentSettings.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentSettings.xml new file mode 100644 index 00000000000..6ae22f0fcd8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentSettings.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentWstcref.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentWstcref.xml new file mode 100644 index 00000000000..cc493bc5d6d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponentWstcref.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/Bundle.properties new file mode 100644 index 00000000000..8cf238dc8c3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/Bundle.properties @@ -0,0 +1,10 @@ +# To change this template, choose Tools | Templates +# and open the template in the editor. + +CTL_FilterAction=Open Filter Window +CTL_MoveFilterDownAction=Move downwards +CTL_MoveFilterUpAction=Move upwards +CTL_NewFilterAction=New filter... +CTL_RemoveFilterAction=Remove +CTL_RemoveFilterSettingsAction=Remove filter setting +CTL_SaveFilterSettingsAction=Save filter settings... diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/FilterAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/FilterAction.java new file mode 100644 index 00000000000..ad2d1e435b1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/FilterAction.java @@ -0,0 +1,47 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.*; +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import org.openide.util.NbBundle; +import org.openide.windows.TopComponent; + +/** + * + * @author Thomas Wuerthinger + */ +public class FilterAction extends AbstractAction { + + public FilterAction() { + super(NbBundle.getMessage(FilterAction.class, "CTL_FilterAction")); + } + + public void actionPerformed(ActionEvent evt) { + TopComponent win = FilterTopComponent.findInstance(); + win.open(); + win.requestActive(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterDownAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterDownAction.java new file mode 100644 index 00000000000..c2849fc1163 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterDownAction.java @@ -0,0 +1,85 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import com.sun.hotspot.igv.filter.Filter; +import javax.swing.Action; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class MoveFilterDownAction extends CookieAction { + + protected void performAction(Node[] activatedNodes) { + for (Node n : activatedNodes) { + Filter c = n.getLookup().lookup(Filter.class); + FilterTopComponent.findInstance().getSequence().moveFilterDown(c); + } + } + + protected int mode() { + return CookieAction.MODE_EXACTLY_ONE; + } + + public MoveFilterDownAction() { + + putValue(Action.SHORT_DESCRIPTION, "Move filter downwards"); + } + + public String getName() { + return NbBundle.getMessage(MoveFilterUpAction.class, "CTL_MoveFilterDownAction"); + } + + protected Class[] cookieClasses() { + return new Class[]{ + Filter.class + }; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/down.gif"; + } + + @Override + protected void initialize() { + super.initialize(); + putValue("noIconInMenu", Boolean.TRUE); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterUpAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterUpAction.java new file mode 100644 index 00000000000..c75238ba05c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/MoveFilterUpAction.java @@ -0,0 +1,84 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import com.sun.hotspot.igv.filter.Filter; +import javax.swing.Action; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class MoveFilterUpAction extends CookieAction { + + protected void performAction(Node[] activatedNodes) { + for (Node n : activatedNodes) { + Filter c = n.getLookup().lookup(Filter.class); + FilterTopComponent.findInstance().getSequence().moveFilterUp(c); + } + } + + protected int mode() { + return CookieAction.MODE_EXACTLY_ONE; + } + + public MoveFilterUpAction() { + putValue(Action.SHORT_DESCRIPTION, "Move filter upwards"); + } + + public String getName() { + return NbBundle.getMessage(MoveFilterUpAction.class, "CTL_MoveFilterUpAction"); + } + + protected Class[] cookieClasses() { + return new Class[]{ + Filter.class + }; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/up.gif"; + } + + @Override + protected void initialize() { + super.initialize(); + putValue("noIconInMenu", Boolean.TRUE); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/NewFilterAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/NewFilterAction.java new file mode 100644 index 00000000000..22bb760613d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/NewFilterAction.java @@ -0,0 +1,68 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import javax.swing.Action; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class NewFilterAction extends CallableSystemAction { + + public NewFilterAction() { + putValue(Action.SHORT_DESCRIPTION, "Create new filter"); + } + + public void performAction() { + FilterTopComponent.findInstance().newFilter(); + } + + public String getName() { + return NbBundle.getMessage(SaveFilterSettingsAction.class, "CTL_NewFilterAction"); + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/plus.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterAction.java new file mode 100644 index 00000000000..86d8577f2c8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterAction.java @@ -0,0 +1,99 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import com.sun.hotspot.igv.filter.Filter; +import javax.swing.Action; +import javax.swing.JOptionPane; +import org.openide.nodes.Node; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CookieAction; +import org.openide.windows.WindowManager; + +/** + * + * @author Thomas Wuerthinger + */ +public final class RemoveFilterAction extends CookieAction { + + protected void performAction(Node[] activatedNodes) { + Object[] options = {"Yes", + "No", + "Cancel" + }; + int n = JOptionPane.showOptionDialog(WindowManager.getDefault().getMainWindow(), + "Do you really want to delete " + activatedNodes.length + " filter/s?", "Delete?", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, + options, + options[2]); + + if (n == JOptionPane.YES_OPTION) { + for (int i = 0; i < activatedNodes.length; i++) { + FilterTopComponent.findInstance().removeFilter(activatedNodes[i].getLookup().lookup(Filter.class)); + } + } + } + + protected int mode() { + return CookieAction.MODE_ALL; + } + + public String getName() { + return NbBundle.getMessage(RemoveFilterAction.class, "CTL_RemoveFilterAction"); + } + + public RemoveFilterAction() { + putValue(Action.SHORT_DESCRIPTION, "Remove filter"); + } + + protected Class[] cookieClasses() { + return new Class[]{ + Filter.class + }; + } + + @Override + protected void initialize() { + super.initialize(); + putValue("noIconInMenu", Boolean.TRUE); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/minus.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterSettingsAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterSettingsAction.java new file mode 100644 index 00000000000..ead48f27cde --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/RemoveFilterSettingsAction.java @@ -0,0 +1,68 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import javax.swing.Action; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class RemoveFilterSettingsAction extends CallableSystemAction { + + public void performAction() { + FilterTopComponent.findInstance().removeFilterSetting(); + } + + public String getName() { + return NbBundle.getMessage(RemoveFilterSettingsAction.class, "CTL_RemoveFilterSettingsAction"); + } + + public RemoveFilterSettingsAction() { + putValue(Action.SHORT_DESCRIPTION, "Remove filter profile"); + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/delete.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/SaveFilterSettingsAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/SaveFilterSettingsAction.java new file mode 100644 index 00000000000..59d5b789594 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/actions/SaveFilterSettingsAction.java @@ -0,0 +1,68 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.filterwindow.actions; + +import com.sun.hotspot.igv.filterwindow.FilterTopComponent; +import javax.swing.Action; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class SaveFilterSettingsAction extends CallableSystemAction { + + public void performAction() { + FilterTopComponent.findInstance().addFilterSetting(); + } + + public String getName() { + return NbBundle.getMessage(SaveFilterSettingsAction.class, "CTL_SaveFilterSettingsAction"); + } + + @Override + protected void initialize() { + super.initialize(); + } + + public SaveFilterSettingsAction() { + putValue(Action.SHORT_DESCRIPTION, "Create new filter profile"); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/filterwindow/images/add.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/customRightTopWsmode.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/customRightTopWsmode.xml new file mode 100644 index 00000000000..ca1b2772e89 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/customRightTopWsmode.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/add.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/add.gif new file mode 100644 index 00000000000..0fc47e193cf Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/add.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/delete.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/delete.gif new file mode 100644 index 00000000000..3f83fce4b9a Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/delete.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/down.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/down.gif new file mode 100644 index 00000000000..6123422ddde Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/down.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/minus.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/minus.gif new file mode 100644 index 00000000000..ba0d281cf90 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/minus.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/plus.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/plus.gif new file mode 100644 index 00000000000..5e2274da3fc Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/plus.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/up.gif b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/up.gif new file mode 100644 index 00000000000..277f5bb492b Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/images/up.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/layer.xml new file mode 100644 index 00000000000..8d1367e773a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/layer.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/build.xml new file mode 100644 index 00000000000..7843b57f1d5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.graph. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/manifest.mf new file mode 100644 index 00000000000..aee3b0e8ec5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.graph +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/graph/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/build-impl.xml new file mode 100644 index 00000000000..d4b873896f2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/genfiles.properties new file mode 100644 index 00000000000..473f81981cd --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=b2bc2f02 +build.xml.script.CRC32=486d5dab +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=b2bc2f02 +nbproject/build-impl.xml.script.CRC32=17fa0f49 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.xml new file mode 100644 index 00000000000..c8fbe3c294f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/project.xml @@ -0,0 +1,31 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.graph + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.layout + + + + 1.0 + + + + + com.sun.hotspot.igv.graph + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/AndSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/AndSelector.java new file mode 100644 index 00000000000..d15ed8d152d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/AndSelector.java @@ -0,0 +1,54 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class AndSelector implements Selector { + + private Selector selector1; + private Selector selector2; + + public AndSelector(Selector s1, Selector s2) { + this.selector1 = s1; + this.selector2 = s2; + } + + public List
    selected(Diagram d) { + List
    l1 = selector1.selected(d); + List
    l2 = selector2.selected(d); + List
    result = new ArrayList
    (); + for (Figure f : l2) { + if (l1.contains(f)) { + result.add(f); + } + } + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Block.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Block.java new file mode 100644 index 00000000000..eaa73b70519 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Block.java @@ -0,0 +1,82 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.layout.Cluster; +import java.awt.Rectangle; +import java.util.HashSet; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Block implements Cluster { + + private InputBlock inputBlock; + private Rectangle bounds; + private Diagram diagram; + + public Block(InputBlock inputBlock, Diagram diagram) { + this.inputBlock = inputBlock; + this.diagram = diagram; + } + + public Cluster getOuter() { + return null; + } + + public InputBlock getInputBlock() { + return inputBlock; + } + + public Set getSuccessors() { + Set succs = new HashSet(); + for (InputBlock b : inputBlock.getSuccessors()) { + succs.add(diagram.getBlock(b)); + } + return succs; + } + + public Set getPredecessors() { + Set succs = new HashSet(); + for (InputBlock b : inputBlock.getPredecessors()) { + succs.add(diagram.getBlock(b)); + } + return succs; + } + + public void setBounds(Rectangle r) { + this.bounds = r; + } + + public Rectangle getBounds() { + return bounds; + } + + public int compareTo(Cluster o) { + return toString().compareTo(o.toString()); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Bundle.properties new file mode 100644 index 00000000000..b7434e09e98 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=Graph diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java new file mode 100644 index 00000000000..8c027b0b3c3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java @@ -0,0 +1,123 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Color; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class Connection implements Source.Provider, Link { + + public enum ConnectionStyle { + + NORMAL, + DASHED, + BOLD + } + private InputSlot inputSlot; + private OutputSlot outputSlot; + private Source source; + private Color color; + private ConnectionStyle style; + private List controlPoints; + + protected Connection(InputSlot inputSlot, OutputSlot outputSlot) { + this.inputSlot = inputSlot; + this.outputSlot = outputSlot; + this.inputSlot.connections.add(this); + this.outputSlot.connections.add(this); + controlPoints = new ArrayList(); + Figure sourceFigure = this.outputSlot.getFigure(); + Figure destFigure = this.inputSlot.getFigure(); + sourceFigure.addSuccessor(destFigure); + destFigure.addPredecessor(sourceFigure); + source = new Source(); + + this.color = Color.BLACK; + this.style = ConnectionStyle.NORMAL; + } + + public InputSlot getInputSlot() { + return inputSlot; + } + + public OutputSlot getOutputSlot() { + return outputSlot; + } + + public Color getColor() { + return color; + } + + public ConnectionStyle getStyle() { + return style; + } + + public void setColor(Color c) { + color = c; + } + + public void setStyle(ConnectionStyle s) { + style = s; + } + + public Source getSource() { + return source; + } + + public void remove() { + inputSlot.getFigure().removePredecessor(outputSlot.getFigure()); + inputSlot.connections.remove(this); + outputSlot.getFigure().removeSuccessor(inputSlot.getFigure()); + outputSlot.connections.remove(this); + } + + @Override + public String toString() { + return "Connection(" + getFrom().getVertex() + " to " + getTo().getVertex() + ")"; + } + + public Port getFrom() { + return outputSlot; + } + + public Port getTo() { + return inputSlot; + } + + public List getControlPoints() { + return controlPoints; + } + + public void setControlPoints(List list) { + controlPoints = list; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java new file mode 100644 index 00000000000..00d48f6e926 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Diagram.java @@ -0,0 +1,294 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.Properties; +import java.awt.Font; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Diagram { + + private List
    figures; + private Map blocks; + private InputGraph graph; + private int curId; + private String nodeText; + private Font font; + + public Font getFont() { + return font; + } + + private Diagram() { + figures = new ArrayList
    (); + blocks = new HashMap(); + this.nodeText = ""; + this.font = new Font("Serif", Font.PLAIN, 14); + } + + public Block getBlock(InputBlock b) { + return blocks.get(b); + } + + public String getNodeText() { + return nodeText; + } + + public void schedule(Collection newBlocks) { + graph.schedule(newBlocks); + updateBlocks(); + } + + private void updateBlocks() { + blocks.clear(); + for (InputBlock b : graph.getBlocks()) { + Block curBlock = new Block(b, this); + blocks.put(b, curBlock); + } + } + + public Diagram getNext() { + return Diagram.createDiagram(graph.getNext(), nodeText); + } + + public Collection getBlocks() { + return Collections.unmodifiableCollection(blocks.values()); + } + + public Diagram getPrev() { + return Diagram.createDiagram(graph.getPrev(), nodeText); + } + + public List
    getFigures() { + return Collections.unmodifiableList(figures); + } + + public Figure createFigure() { + Figure f = new Figure(this, curId); + curId++; + this.figures.add(f); + return f; + } + + public Connection createConnection(InputSlot inputSlot, OutputSlot outputSlot) { + assert inputSlot.getFigure().getDiagram() == this; + assert outputSlot.getFigure().getDiagram() == this; + return new Connection(inputSlot, outputSlot); + } + + public static Diagram createDiagram(InputGraph graph, String nodeText) { + if (graph == null) { + return null; + } + + Diagram d = new Diagram(); + d.graph = graph; + d.nodeText = nodeText; + + d.updateBlocks(); + + Collection nodes = graph.getNodes(); + Hashtable figureHash = new Hashtable(); + for (InputNode n : nodes) { + Figure f = d.createFigure(); + f.getSource().addSourceNode(n); + f.getProperties().add(n.getProperties()); + figureHash.put(n.getId(), f); + } + + for (InputEdge e : graph.getEdges()) { + + int from = e.getFrom(); + int to = e.getTo(); + Figure fromFigure = figureHash.get(from); + Figure toFigure = figureHash.get(to); + assert fromFigure != null && toFigure != null; + + int toIndex = e.getToIndex(); + + while (fromFigure.getOutputSlots().size() <= 0) { + fromFigure.createOutputSlot(); + } + + OutputSlot outputSlot = fromFigure.getOutputSlots().get(0); + + while (toFigure.getInputSlots().size() <= toIndex) { + toFigure.createInputSlot(); + } + + InputSlot inputSlot = toFigure.getInputSlots().get(toIndex); + + Connection c = d.createConnection(inputSlot, outputSlot); + + if (e.getState() == InputEdge.State.NEW) { + c.setStyle(Connection.ConnectionStyle.BOLD); + } else if (e.getState() == InputEdge.State.DELETED) { + c.setStyle(Connection.ConnectionStyle.DASHED); + } + } + + + return d; + } + + public void removeAllFigures(Set
    figuresToRemove) { + for (Figure f : figuresToRemove) { + freeFigure(f); + } + + ArrayList
    newFigures = new ArrayList
    (); + for (Figure f : this.figures) { + if (!figuresToRemove.contains(f)) { + newFigures.add(f); + } + } + figures = newFigures; + } + + private void freeFigure(Figure succ) { + + List inputSlots = new ArrayList(succ.getInputSlots()); + for (InputSlot s : inputSlots) { + succ.removeInputSlot(s); + } + + List outputSlots = new ArrayList(succ.getOutputSlots()); + for (OutputSlot s : outputSlots) { + succ.removeOutputSlot(s); + } + + assert succ.getInputSlots().size() == 0; + assert succ.getOutputSlots().size() == 0; + assert succ.getPredecessors().size() == 0; + assert succ.getSuccessors().size() == 0; + + } + + public void removeFigure(Figure succ) { + + assert this.figures.contains(succ); + freeFigure(succ); + this.figures.remove(succ); + } + + public String getName() { + return graph.getName(); + } + + public InputGraph getGraph() { + return graph; + } + + public Set getConnections() { + + Set connections = new HashSet(); + for (Figure f : figures) { + + for (InputSlot s : f.getInputSlots()) { + connections.addAll(s.getConnections()); + } + } + + return connections; + } + + public Figure getRootFigure() { + Properties.PropertySelector
    selector = new Properties.PropertySelector
    (figures); + Figure root = selector.selectSingle("name", "Root"); + if (root == null) { + root = selector.selectSingle("name", "Start"); + } + if (root == null) { + List
    rootFigures = getRootFigures(); + if (rootFigures.size() > 0) { + root = rootFigures.get(0); + } else if (figures.size() > 0) { + root = figures.get(0); + } + } + + return root; + } + + public void printStatistics() { + System.out.println("============================================================="); + System.out.println("Diagram statistics"); + + List
    tmpFigures = getFigures(); + Set connections = getConnections(); + + System.out.println("Number of figures: " + tmpFigures.size()); + System.out.println("Number of connections: " + connections.size()); + + List
    figuresSorted = new ArrayList
    (tmpFigures); + Collections.sort(figuresSorted, new Comparator
    () { + + public int compare(Figure a, Figure b) { + return b.getPredecessors().size() + b.getSuccessors().size() - a.getPredecessors().size() - a.getSuccessors().size(); + } + }); + + final int COUNT = 10; + int z = 0; + for (Figure f : figuresSorted) { + + z++; + int sum = f.getPredecessors().size() + f.getSuccessors().size(); + System.out.println("#" + z + ": " + f + ", predCount=" + f.getPredecessors().size() + " succCount=" + f.getSuccessors().size()); + if (sum < COUNT) { + break; + } + + } + + System.out.println("============================================================="); + } + + public List
    getRootFigures() { + ArrayList
    rootFigures = new ArrayList
    (); + for (Figure f : figures) { + if (f.getPredecessors().size() == 0) { + rootFigures.add(f); + } + } + return rootFigures; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java new file mode 100644 index 00000000000..cfb913ca318 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Figure.java @@ -0,0 +1,328 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.Vertex; +import com.sun.hotspot.igv.data.Properties; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Point; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Figure extends Properties.Object implements Source.Provider, Vertex { + + public static final int INSET = 6; + public static final int SLOT_WIDTH = 10; + public static final int SLOT_START = 3; + public static final boolean VERTICAL_LAYOUT = true; + protected List inputSlots; + protected List outputSlots; + private Source source; + private Diagram diagram; + private Point position; + private List
    predecessors; + private List
    successors; + private Color color; + private int id; + private String idString; + private String[] lines; + private int heightCash = -1; + private int widthCash = -1; + + public int getHeight() { + if (heightCash == -1) { + BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + Graphics g = image.getGraphics(); + g.setFont(diagram.getFont()); + FontMetrics metrics = g.getFontMetrics(); + String nodeText = diagram.getNodeText(); + heightCash = nodeText.split("\n").length * metrics.getHeight() + INSET; + } + return heightCash; + } + + public int getWidth() { + if (widthCash == -1) { + int max = 0; + BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); + Graphics g = image.getGraphics(); + g.setFont(diagram.getFont()); + FontMetrics metrics = g.getFontMetrics(); + for (String s : lines) { + int cur = metrics.stringWidth(s); + if (cur > max) { + max = cur; + } + } + widthCash = max + INSET; + } + return widthCash; + } + + protected Figure(Diagram diagram, int id) { + this.diagram = diagram; + this.source = new Source(); + inputSlots = new ArrayList(5); + outputSlots = new ArrayList(1); + predecessors = new ArrayList
    (6); + successors = new ArrayList
    (6); + this.id = id; + idString = Integer.toString(id); + + this.position = new Point(0, 0); + this.color = Color.WHITE; + } + + public int getId() { + return id; + } + + public void setColor(Color color) { + this.color = color; + } + + public Color getColor() { + return color; + } + + public List
    getPredecessors() { + return Collections.unmodifiableList(predecessors); + } + + public Set
    getPredecessorSet() { + Set
    result = new HashSet
    (); + for (Figure f : getPredecessors()) { + result.add(f); + } + return Collections.unmodifiableSet(result); + } + + public Set
    getSuccessorSet() { + Set
    result = new HashSet
    (); + for (Figure f : getSuccessors()) { + result.add(f); + } + return Collections.unmodifiableSet(result); + } + + public List
    getSuccessors() { + return Collections.unmodifiableList(successors); + } + + protected void addPredecessor(Figure f) { + this.predecessors.add(f); + } + + protected void addSuccessor(Figure f) { + this.successors.add(f); + } + + protected void removePredecessor(Figure f) { + assert predecessors.contains(f); + predecessors.remove(f); + } + + protected void removeSuccessor(Figure f) { + assert successors.contains(f); + successors.remove(f); + } + + public void setPosition(Point p) { + this.position = p; + } + + public Point getPosition() { + return position; + } + + public Diagram getDiagram() { + return diagram; + } + + public Source getSource() { + return source; + } + + public InputSlot createInputSlot() { + InputSlot slot = new InputSlot(this, -1); + inputSlots.add(slot); + return slot; + } + + public InputSlot createInputSlot(int index) { + InputSlot slot = new InputSlot(this, index); + inputSlots.add(slot); + Collections.sort(inputSlots, Slot.slotIndexComparator); + return slot; + } + + public void removeSlot(Slot s) { + + assert inputSlots.contains(s) || outputSlots.contains(s); + + List connections = new ArrayList(s.getConnections()); + for (Connection c : connections) { + c.remove(); + } + + if (inputSlots.contains(s)) { + inputSlots.remove(s); + } else if (outputSlots.contains(s)) { + outputSlots.remove(s); + } + } + + public OutputSlot createOutputSlot() { + OutputSlot slot = new OutputSlot(this, -1); + outputSlots.add(slot); + return slot; + } + + public OutputSlot createOutputSlot(int index) { + OutputSlot slot = new OutputSlot(this, index); + outputSlots.add(slot); + Collections.sort(outputSlots, Slot.slotIndexComparator); + return slot; + } + + public List getInputSlots() { + return Collections.unmodifiableList(inputSlots); + } + + public List getOutputSlots() { + return Collections.unmodifiableList(outputSlots); + } + + void removeInputSlot(InputSlot s) { + s.removeAllConnections(); + inputSlots.remove(s); + } + + void removeOutputSlot(OutputSlot s) { + s.removeAllConnections(); + outputSlots.remove(s); + } + + public String[] getLines() { + if (lines == null) { + updateLines(); + } + return lines; + } + + public void updateLines() { + String[] strings = diagram.getNodeText().split("\n"); + String[] result = new String[strings.length]; + + for (int i = 0; i < strings.length; i++) { + result[i] = resolveString(strings[i]); + } + + lines = result; + } + + private String resolveString(String string) { + + StringBuilder sb = new StringBuilder(); + boolean inBrackets = false; + StringBuilder curIdent = new StringBuilder(); + + for (int i = 0; i < string.length(); i++) { + char c = string.charAt(i); + if (inBrackets) { + if (c == ']') { + String value = getProperties().get(curIdent.toString()); + if (value == null) { + value = ""; + } + sb.append(value); + inBrackets = false; + } else { + curIdent.append(c); + } + } else { + if (c == '[') { + inBrackets = true; + curIdent = new StringBuilder(); + } else { + sb.append(c); + } + } + } + + return sb.toString(); + } + + public Dimension getSize() { + if (VERTICAL_LAYOUT) { + int width = Math.max(getWidth(), Figure.SLOT_WIDTH * (Math.max(inputSlots.size(), outputSlots.size()) + 1)); + int height = getHeight() + 2 * Figure.SLOT_WIDTH; + return new Dimension(width, height); + } else { + int width = getWidth() + 2 * Figure.SLOT_WIDTH; + int height = Figure.SLOT_WIDTH * (Math.max(inputSlots.size(), outputSlots.size()) + 1); + return new Dimension(width, height); + } + } + + @Override + public String toString() { + return idString; + } + + public Cluster getCluster() { + if (getSource().getSourceNodes().size() == 0) { + assert false : "Should never reach here, every figure must have at least one source node!"; + return null; + } else { + Cluster result = diagram.getBlock(diagram.getGraph().getBlock(getSource().getSourceNodes().get(0))); + assert result != null; + return result; + } + } + + public boolean isRoot() { + if (source.getSourceNodes().size() > 0 && source.getSourceNodes().get(0).getProperties().get("name").equals("Root")) { + return true; + } else { + return false; + } + } + + public int compareTo(Vertex f) { + return toString().compareTo(f.toString()); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InputSlot.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InputSlot.java new file mode 100644 index 00000000000..9ffa077cddd --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InputSlot.java @@ -0,0 +1,57 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.awt.Point; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputSlot extends Slot { + + protected InputSlot(Figure figure, int wantedIndex) { + super(figure, wantedIndex); + } + + public int getPosition() { + return getFigure().getInputSlots().indexOf(this); + } + + public void setPosition(int position) { + List inputSlots = getFigure().inputSlots; + InputSlot s = inputSlots.remove(position); + inputSlots.add(position, s); + } + + public Point getRelativePosition() { + return new Point(getFigure().getWidth() * (getPosition() + 1) / (getFigure().getInputSlots().size() + 1), Figure.SLOT_WIDTH - Figure.SLOT_START); + } + + @Override + public String toString() { + return "InputSlot[figure=" + this.getFigure().toString() + ", position=" + getPosition() + "]"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InvertSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InvertSelector.java new file mode 100644 index 00000000000..8cd8e467bf7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/InvertSelector.java @@ -0,0 +1,53 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class InvertSelector implements Selector { + + private Selector selector; + + public InvertSelector(Selector selector) { + this.selector = selector; + } + + public List
    selected(Diagram d) { + + List
    result = new ArrayList
    (); + List
    otherResult = selector.selected(d); + for (Figure f : d.getFigures()) { + if (!otherResult.contains(f)) { + result.add(f); + } + } + + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/MatcherSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/MatcherSelector.java new file mode 100644 index 00000000000..7ad17dd40a1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/MatcherSelector.java @@ -0,0 +1,47 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.PropertyMatcher; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class MatcherSelector implements Selector { + + private PropertyMatcher matcher; + + public MatcherSelector(PropertyMatcher matcher) { + this.matcher = matcher; + } + + public List
    selected(Diagram d) { + Properties.PropertySelector
    selector = new Properties.PropertySelector
    (d.getFigures()); + List
    list = selector.selectMultiple(matcher); + return list; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OrSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OrSelector.java new file mode 100644 index 00000000000..3a7e8299cc2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OrSelector.java @@ -0,0 +1,56 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class OrSelector implements Selector { + + private Selector selector1; + private Selector selector2; + + /** Creates a new instance of OrSelector */ + public OrSelector(Selector s1, Selector s2) { + this.selector1 = s1; + this.selector2 = s2; + } + + public List
    selected(Diagram d) { + + List
    l1 = selector1.selected(d); + List
    l2 = selector2.selected(d); + + for (Figure f : l2) { + if (!l1.contains(f)) { + l1.add(f); + } + } + + return l1; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OutputSlot.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OutputSlot.java new file mode 100644 index 00000000000..b85f3d37cfd --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/OutputSlot.java @@ -0,0 +1,55 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.awt.Point; + +/** + * + * @author Thomas Wuerthinger + */ +public class OutputSlot extends Slot { + + protected OutputSlot(Figure figure, int wantedIndex) { + super(figure, wantedIndex); + } + + public int getPosition() { + return getFigure().getOutputSlots().indexOf(this); + } + + public void setPosition(int position) { + OutputSlot s = getFigure().outputSlots.remove(position); + getFigure().outputSlots.add(position, s); + } + + public Point getRelativePosition() { + return new Point(getFigure().getWidth() * (getPosition() + 1) / (getFigure().getOutputSlots().size() + 1), getFigure().getSize().height - Figure.SLOT_WIDTH + Figure.SLOT_START); + } + + @Override + public String toString() { + return "OutputSlot[figure=" + this.getFigure().toString() + ", position=" + getPosition() + "]"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/PredecessorSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/PredecessorSelector.java new file mode 100644 index 00000000000..ab069325e06 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/PredecessorSelector.java @@ -0,0 +1,59 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class PredecessorSelector implements Selector { + + private Selector innerSelector; + + public PredecessorSelector(Selector innerSelector) { + this.innerSelector = innerSelector; + } + + public List
    selected(Diagram d) { + List
    inner = innerSelector.selected(d); + List
    result = new ArrayList
    (); + for (Figure f : d.getFigures()) { + boolean saved = false; + for (Figure f2 : f.getSuccessors()) { + if (inner.contains(f2)) { + saved = true; + } + } + + if (saved) { + result.add(f); + } + } + + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Selector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Selector.java new file mode 100644 index 00000000000..9b47d89eb7f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Selector.java @@ -0,0 +1,35 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Selector { + + List
    selected(Diagram d); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Slot.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Slot.java new file mode 100644 index 00000000000..d525dbfe857 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Slot.java @@ -0,0 +1,125 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Comparator; + +/** + * + * @author Thomas Wuerthinger + */ +public abstract class Slot implements Port, Source.Provider { + + private int wantedIndex; + private String name; + private String shortName; // 1 - 2 characters + private Source source; + protected List connections; + private Figure figure; + + protected Slot(Figure figure, int wantedIndex) { + this.figure = figure; + connections = new ArrayList(2); + source = new Source(); + this.wantedIndex = wantedIndex; + name = ""; + shortName = ""; + assert figure != null; + } + public static final Comparator slotIndexComparator = new Comparator() { + + public int compare(Slot o1, Slot o2) { + return o1.wantedIndex - o2.wantedIndex; + } + }; + public static final Comparator slotFigureComparator = new Comparator() { + + public int compare(Slot o1, Slot o2) { + return o1.figure.getId() - o2.figure.getId(); + } + }; + + public int getWantedIndex() { + return wantedIndex; + } + + public Source getSource() { + return source; + } + + public String getName() { + return name; + } + + public void setShortName(String s) { + assert s != null; + assert s.length() <= 2; + this.shortName = s; + + } + + public String getShortName() { + return shortName; + } + + public boolean getShowName() { + return getShortName() != null && getShortName().length() > 0; + } + + public void setName(String s) { + if (s == null) { + s = ""; + } + this.name = s; + } + + public Figure getFigure() { + assert figure != null; + return figure; + } + + public List getConnections() { + return Collections.unmodifiableList(connections); + } + + public void removeAllConnections() { + List connectionsCopy = new ArrayList(this.connections); + for (Connection c : connectionsCopy) { + c.remove(); + } + } + + public Vertex getVertex() { + return figure; + } + + public abstract int getPosition(); + + public abstract void setPosition(int position); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Source.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Source.java new file mode 100644 index 00000000000..a43b905d242 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Source.java @@ -0,0 +1,100 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class Source { + + private List sourceNodes; + private Set set; + + public Source() { + sourceNodes = new ArrayList(1); + } + + public List getSourceNodes() { + return Collections.unmodifiableList(sourceNodes); + } + + public Set getSourceNodesAsSet() { + if (set == null) { + set = new HashSet(); + for (InputNode n : sourceNodes) { + int id = n.getId(); + //if(id < 0) id = -id; + set.add(id); + } + } + return set; + } + + public void addSourceNode(InputNode n) { + sourceNodes.add(n); + set = null; + } + + public void removeSourceNode(InputNode n) { + sourceNodes.remove(n); + set = null; + } + + public interface Provider { + + public Source getSource(); + } + + public void setSourceNodes(List sourceNodes) { + this.sourceNodes = sourceNodes; + set = null; + } + + public void addSourceNodes(Source s) { + for (InputNode n : s.getSourceNodes()) { + sourceNodes.add(n); + } + set = null; + } + + public boolean isInBlock(InputGraph g, InputBlock blockNode) { + + for (InputNode n : this.getSourceNodes()) { + if (g.getBlock(n) == blockNode) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/SuccessorSelector.java b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/SuccessorSelector.java new file mode 100644 index 00000000000..da95a1796d6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/SuccessorSelector.java @@ -0,0 +1,59 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.graph; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class SuccessorSelector implements Selector { + + private Selector innerSelector; + + public SuccessorSelector(Selector innerSelector) { + this.innerSelector = innerSelector; + } + + public List
    selected(Diagram d) { + List
    inner = innerSelector.selected(d); + List
    result = new ArrayList
    (); + for (Figure f : d.getFigures()) { + boolean saved = false; + for (Figure f2 : f.getPredecessors()) { + if (inner.contains(f2)) { + saved = true; + } + } + + if (saved) { + result.add(f); + } + } + + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/build.xml new file mode 100644 index 00000000000..8376e08d8a8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.hierarchicallayout. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/manifest.mf new file mode 100644 index 00000000000..723afd12fac --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.hierarchicallayout +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/hierarchicallayout/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/build-impl.xml new file mode 100644 index 00000000000..3257988a701 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/genfiles.properties new file mode 100644 index 00000000000..cb74676188a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=de087df9 +build.xml.script.CRC32=98977c36 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=de087df9 +nbproject/build-impl.xml.script.CRC32=0d734625 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.xml new file mode 100644 index 00000000000..fc4c20a9dad --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/project.xml @@ -0,0 +1,23 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.hierarchicallayout + + + + com.sun.hotspot.igv.layout + + + + 1.0 + + + + + com.sun.hotspot.igv.hierarchicallayout + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Bundle.properties new file mode 100644 index 00000000000..037223194d3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=HierarchicalLayout diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterEdge.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterEdge.java new file mode 100644 index 00000000000..343cc65f5c6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterEdge.java @@ -0,0 +1,63 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Point; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterEdge implements Link { + + private ClusterNode from; + private ClusterNode to; + private List points; + + public ClusterEdge(ClusterNode from, ClusterNode to) { + assert from != null; + assert to != null; + this.from = from; + this.to = to; + } + + public Port getTo() { + return to.getInputSlot(); + } + + public Port getFrom() { + return from.getInputSlot(); + } + + public void setControlPoints(List p) { + this.points = p; + } + + public List getControlPoints() { + return points; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterIngoingConnection.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterIngoingConnection.java new file mode 100644 index 00000000000..e6588771c5b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterIngoingConnection.java @@ -0,0 +1,76 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterIngoingConnection implements Link { + + private List controlPoints; + private ClusterInputSlotNode inputSlotNode; + private Link connection; + private Port inputSlot; + private Port outputSlot; + + public ClusterIngoingConnection(ClusterInputSlotNode inputSlotNode, Link c) { + this.inputSlotNode = inputSlotNode; + this.connection = c; + this.controlPoints = new ArrayList(); + + inputSlot = c.getTo(); + outputSlot = inputSlotNode.getOutputSlot(); + } + + public Link getConnection() { + return connection; + } + + public ClusterInputSlotNode getInputSlotNode() { + return inputSlotNode; + } + + public Port getTo() { + return inputSlot; + } + + public Port getFrom() { + return outputSlot; + } + + public void setControlPoints(List p) { + this.controlPoints = p; + } + + public List getControlPoints() { + return controlPoints; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterInputSlotNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterInputSlotNode.java new file mode 100644 index 00000000000..8458ed5afab --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterInputSlotNode.java @@ -0,0 +1,145 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Dimension; +import java.awt.Point; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterInputSlotNode implements Vertex { + + private final int SIZE = 0; + private Point position; + private Port inputSlot; + private Port outputSlot; + private ClusterNode blockNode; + private InterClusterConnection interBlockConnection; + private Cluster cluster; + private ClusterIngoingConnection conn; + + public void setIngoingConnection(ClusterIngoingConnection c) { + conn = c; + } + + public ClusterIngoingConnection getIngoingConnection() { + return conn; + } + private String id; + + @Override + public String toString() { + return id; + } + + public ClusterInputSlotNode(ClusterNode n, String id) { + this.blockNode = n; + this.id = id; + + n.addSubNode(this); + + final Vertex thisNode = this; + final ClusterNode thisBlockNode = blockNode; + + outputSlot = new Port() { + + public Point getRelativePosition() { + return new Point(0, 0); + } + + public Vertex getVertex() { + return thisNode; + } + + @Override + public String toString() { + return "OutPort of " + thisNode.toString(); + } + }; + + inputSlot = new Port() { + + public Point getRelativePosition() { + Point p = new Point(thisNode.getPosition()); + p.x += ClusterNode.BORDER; + p.y = 0; + return p; + } + + public Vertex getVertex() { + return thisBlockNode; + } + + @Override + public String toString() { + return "InPort of " + thisNode.toString(); + } + }; + } + + public Port getInputSlot() { + return inputSlot; + } + + public InterClusterConnection getInterBlockConnection() { + return interBlockConnection; + } + + public Port getOutputSlot() { + return outputSlot; + } + + public Dimension getSize() { + return new Dimension(SIZE, SIZE); + } + + public void setPosition(Point p) { + this.position = p; + } + + public Point getPosition() { + return position; + } + + public void setInterBlockConnection(InterClusterConnection interBlockConnection) { + this.interBlockConnection = interBlockConnection; + } + + public Cluster getCluster() { + return cluster; + } + + public boolean isRoot() { + return true; + } + + public int compareTo(Vertex o) { + return toString().compareTo(o.toString()); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterNode.java new file mode 100644 index 00000000000..315ff82ae6e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterNode.java @@ -0,0 +1,233 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Dimension; +import java.awt.Point; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterNode implements Vertex { + + private Cluster cluster; + private Port inputSlot; + private Port outputSlot; + private Set subNodes; + private Dimension size; + private Point position; + private Set subEdges; + private boolean dirty; + private boolean root; + private String name; + public static final int BORDER = 20; + + public ClusterNode(Cluster cluster, String name) { + this.subNodes = new HashSet(); + this.subEdges = new HashSet(); + this.cluster = cluster; + position = new Point(0, 0); + this.name = name; + } + + public void addSubNode(Vertex v) { + subNodes.add(v); + } + + public void addSubEdge(Link l) { + subEdges.add(l); + } + + public Set getSubEdges() { + return Collections.unmodifiableSet(subEdges); + } + + public void updateSize() { + + + calculateSize(); + + final ClusterNode widget = this; + inputSlot = new Port() { + + public Point getRelativePosition() { + return new Point(size.width / 2, 0); + } + + public Vertex getVertex() { + return widget; + } + }; + + outputSlot = new Port() { + + public Point getRelativePosition() { + return new Point(size.width / 2, size.height); + } + + public Vertex getVertex() { + return widget; + } + }; + } + + private void calculateSize() { + + if (subNodes.size() == 0) { + size = new Dimension(0, 0); + } + + int minX = Integer.MAX_VALUE; + int maxX = Integer.MIN_VALUE; + int minY = Integer.MAX_VALUE; + int maxY = Integer.MIN_VALUE; + + + for (Vertex n : subNodes) { + Point p = n.getPosition(); + minX = Math.min(minX, p.x); + minY = Math.min(minY, p.y); + maxX = Math.max(maxX, p.x + n.getSize().width); + maxY = Math.max(maxY, p.y + n.getSize().height); + } + + for (Link l : subEdges) { + List points = l.getControlPoints(); + for (Point p : points) { + if (p != null) { + minX = Math.min(minX, p.x); + maxX = Math.max(maxX, p.x); + minY = Math.min(minY, p.y); + maxY = Math.max(maxY, p.y); + } + } + } + + size = new Dimension(maxX - minX, maxY - minY); + + // Normalize coordinates + for (Vertex n : subNodes) { + n.setPosition(new Point(n.getPosition().x - minX, n.getPosition().y - minY)); + } + + for (Link l : subEdges) { + List points = new ArrayList(l.getControlPoints()); + for (Point p : points) { + p.x -= minX; + p.y -= minY; + } + l.setControlPoints(points); + + } + + size.width += 2 * BORDER; + size.height += 2 * BORDER; + } + + public Port getInputSlot() { + return inputSlot; + + } + + public Port getOutputSlot() { + return outputSlot; + } + + public Dimension getSize() { + return size; + } + + public Point getPosition() { + return position; + } + + public void setPosition(Point pos) { + + this.position = pos; + for (Vertex n : subNodes) { + Point cur = new Point(n.getPosition()); + cur.translate(pos.x + BORDER, pos.y + BORDER); + n.setPosition(cur); + } + + for (Link e : subEdges) { + List arr = e.getControlPoints(); + ArrayList newArr = new ArrayList(); + for (Point p : arr) { + if (p != null) { + Point p2 = new Point(p); + p2.translate(pos.x + BORDER, pos.y + BORDER); + newArr.add(p2); + } else { + newArr.add(null); + } + } + + e.setControlPoints(newArr); + } + } + + public Cluster getCluster() { + return cluster; + } + + public void setCluster(Cluster c) { + cluster = c; + } + + public void setDirty(boolean b) { + dirty = b; + } + + public void setRoot(boolean b) { + root = b; + } + + public boolean isRoot() { + return root; + } + + public int compareTo(Vertex o) { + return toString().compareTo(o.toString()); + } + + @Override + public String toString() { + return name; + } + + public Set getSubNodes() { + return subNodes; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutgoingConnection.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutgoingConnection.java new file mode 100644 index 00000000000..babf2f228b5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutgoingConnection.java @@ -0,0 +1,68 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterOutgoingConnection implements Link { + + private List intermediatePoints; + private ClusterOutputSlotNode outputSlotNode; + private Link connection; + private Port inputSlot; + private Port outputSlot; + + public ClusterOutgoingConnection(ClusterOutputSlotNode outputSlotNode, Link c) { + this.outputSlotNode = outputSlotNode; + this.connection = c; + this.intermediatePoints = new ArrayList(); + + outputSlot = c.getFrom(); + inputSlot = outputSlotNode.getInputSlot(); + } + + public Port getTo() { + return inputSlot; + } + + public Port getFrom() { + return outputSlot; + } + + public void setControlPoints(List p) { + this.intermediatePoints = p; + } + + public List getControlPoints() { + return intermediatePoints; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutputSlotNode.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutputSlotNode.java new file mode 100644 index 00000000000..924c9e0845c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/ClusterOutputSlotNode.java @@ -0,0 +1,145 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Dimension; +import java.awt.Point; + +/** + * + * @author Thomas Wuerthinger + */ +public class ClusterOutputSlotNode implements Vertex { + + private final int SIZE = 0; + private Point position; + private Port inputSlot; + private Port outputSlot; + private ClusterNode blockNode; + private boolean root; + private Cluster cluster; + private ClusterOutgoingConnection conn; + private String id; + + public void setOutgoingConnection(ClusterOutgoingConnection c) { + this.conn = c; + } + + public ClusterOutgoingConnection getOutgoingConnection() { + return conn; + } + + @Override + public String toString() { + return id; + } + + public ClusterOutputSlotNode(ClusterNode n, String id) { + this.blockNode = n; + this.id = id; + + n.addSubNode(this); + + final Vertex thisNode = this; + final ClusterNode thisBlockNode = blockNode; + + inputSlot = new Port() { + + public Point getRelativePosition() { + return new Point(0, 0); + } + + public Vertex getVertex() { + return thisNode; + } + + @Override + public String toString() { + return "InPort of " + thisNode.toString(); + } + }; + + outputSlot = new Port() { + + public Point getRelativePosition() { + Point p = new Point(thisNode.getPosition()); + p.x += ClusterNode.BORDER; + p.y = thisBlockNode.getSize().height; + return p; + } + + public Vertex getVertex() { + return thisBlockNode; + } + + @Override + public String toString() { + return "OutPort of " + thisNode.toString(); + } + }; + } + + public Dimension getSize() { + return new Dimension(SIZE, SIZE); + } + + public void setPosition(Point p) { + this.position = p; + } + + public Point getPosition() { + return position; + } + + public Port getInputSlot() { + return inputSlot; + } + + public Port getOutputSlot() { + return outputSlot; + } + + public void setCluster(Cluster c) { + cluster = c; + } + + public void setRoot(boolean b) { + root = b; + } + + public Cluster getCluster() { + return cluster; + } + + public boolean isRoot() { + return root; + } + + public int compareTo(Vertex o) { + return toString().compareTo(o.toString()); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Edge.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Edge.java new file mode 100644 index 00000000000..2c11ce67c75 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Edge.java @@ -0,0 +1,89 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +/** + * + * @author Thomas Wuerthinger + */ +public class Edge { + + private E data; + private Node source; + private Node dest; + + protected Edge(Graph graph, Node source, Node dest, E data) { + setData(data); + this.source = source; + this.dest = dest; + assert source != null; + assert dest != null; + assert source.getGraph() == dest.getGraph(); + assert source.getGraph() != null; + assert dest.getGraph() != null; + } + + public Node getSource() { + return source; + } + + public Node getDest() { + return dest; + } + + public E getData() { + return data; + } + + public void setData(E e) { + data = e; + } + + public void remove() { + source.getGraph().removeEdge(this, null); + } + + public boolean isSelfLoop() { + return source == dest; + } + + public void reverse() { + + // Remove from current source / dest + source.removeOutEdge(this); + dest.removeInEdge(this); + + Node tmp = source; + source = dest; + dest = tmp; + + // Add to new source / dest + source.addOutEdge(this); + dest.addInEdge(this); + } + + public String toString() { + return "Edge (" + source + " -- " + dest + "): " + data; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java new file mode 100644 index 00000000000..98dbe392c21 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Graph.java @@ -0,0 +1,298 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Hashtable; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +/** + * + * @author Thomas Wuerthinger + */ +public class Graph { + + private Hashtable> nodes; + private Hashtable> edges; + private List> nodeList; + + public Graph() { + nodes = new Hashtable>(); + edges = new Hashtable>(); + nodeList = new ArrayList>(); + } + + public Node createNode(N data, Object key) { + Node n = new Node(this, data); + assert key == null || !nodes.containsKey(key); + if (key != null) { + nodes.put(key, n); + } + nodeList.add(n); + return n; + } + + public Edge createEdge(Node source, Node dest, E data, Object key) { + Edge e = new Edge(this, source, dest, data); + source.addOutEdge(e); + dest.addInEdge(e); + if (key != null) { + edges.put(key, e); + } + return e; + } + + public Node getNode(Object key) { + return nodes.get(key); + } + + public Edge getEdge(Object key) { + return edges.get(key); + } + + public Collection> getEdges() { + return Collections.unmodifiableCollection(edges.values()); + } + + public Collection> getNodes() { + return Collections.unmodifiableList(nodeList); + } + + public void removeEdge(Edge e, Object key) { + assert key == null || edges.containsKey(key); + if (key != null) { + edges.remove(key); + } + e.getSource().removeOutEdge(e); + e.getDest().removeInEdge(e); + } + + public class DFSTraversalVisitor { + + public void visitNode(Node n) { + } + + public boolean visitEdge(Edge e, boolean backEdge) { + return true; + } + } + + public class BFSTraversalVisitor { + + public void visitNode(Node n, int depth) { + } + } + + public List> getNodesWithInDegree(int x) { + return getNodesWithInDegree(x, true); + } + + public List> getNodesWithInDegree(int x, boolean countSelfLoops) { + + List> result = new ArrayList>(); + for (Node n : getNodes()) { + if (n.getInDegree(countSelfLoops) == x) { + result.add(n); + } + } + + return result; + + } + + private void markReachable(Node startingNode) { + ArrayList> arr = new ArrayList>(); + arr.add(startingNode); + for (Node n : getNodes()) { + n.setReachable(false); + } + traverseDFS(arr, new DFSTraversalVisitor() { + + @Override + public void visitNode(Node n) { + n.setReachable(true); + } + }); + } + + public void traverseBFS(Node startingNode, BFSTraversalVisitor tv, boolean longestPath) { + + if (longestPath) { + markReachable(startingNode); + } + + for (Node n : getNodes()) { + n.setVisited(false); + n.setActive(false); + } + + Queue> queue = new LinkedList>(); + queue.add(startingNode); + startingNode.setVisited(true); + int layer = 0; + Node lastOfLayer = startingNode; + Node lastAdded = null; + + while (!queue.isEmpty()) { + + Node current = queue.poll(); + tv.visitNode(current, layer); + current.setActive(false); + + + for (Edge e : current.getOutEdges()) { + if (!e.getDest().isVisited()) { + + boolean allow = true; + if (longestPath) { + for (Node pred : e.getDest().getPredecessors()) { + if ((!pred.isVisited() || pred.isActive()) && pred.isReachable()) { + allow = false; + break; + } + } + } + + if (allow) { + queue.offer(e.getDest()); + lastAdded = e.getDest(); + e.getDest().setVisited(true); + e.getDest().setActive(true); + } + } + } + + if (current == lastOfLayer && !queue.isEmpty()) { + lastOfLayer = lastAdded; + layer++; + } + } + } + + public void traverseDFS(DFSTraversalVisitor tv) { + traverseDFS(getNodes(), tv); + } + + public void traverseDFS(Collection> startingNodes, DFSTraversalVisitor tv) { + + for (Node n : getNodes()) { + n.setVisited(false); + n.setActive(false); + } + + boolean result = false; + for (Node n : startingNodes) { + traverse(tv, n); + } + } + + private void traverse(DFSTraversalVisitor tv, Node n) { + + if (!n.isVisited()) { + n.setVisited(true); + n.setActive(true); + tv.visitNode(n); + + for (Edge e : n.getOutEdges()) { + + Node next = e.getDest(); + if (next.isActive()) { + tv.visitEdge(e, true); + } else { + if (tv.visitEdge(e, false)) { + traverse(tv, next); + } + } + } + + n.setActive(false); + } + + } + + public boolean hasCycles() { + + for (Node n : getNodes()) { + n.setVisited(false); + n.setActive(false); + } + + boolean result = false; + for (Node n : getNodes()) { + result |= checkCycles(n); + if (result) { + break; + } + } + return result; + } + + private boolean checkCycles(Node n) { + + if (n.isActive()) { + return true; + } + + if (!n.isVisited()) { + + n.setVisited(true); + n.setActive(true); + + for (Node succ : n.getSuccessors()) { + if (checkCycles(succ)) { + return true; + } + } + + n.setActive(false); + + } + + return false; + } + + @Override + public String toString() { + + StringBuilder s = new StringBuilder(); + s.append("Nodes: "); + for (Node n : getNodes()) { + s.append(n.toString()); + s.append("\n"); + } + + s.append("Edges: "); + + for (Edge e : getEdges()) { + s.append(e.toString()); + s.append("\n"); + } + + return s.toString(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java new file mode 100644 index 00000000000..1dc1b3691d7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalClusterLayoutManager.java @@ -0,0 +1,247 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import java.awt.Point; +import java.awt.Rectangle; +import java.util.Hashtable; +import java.util.List; +import java.util.Set; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.TreeSet; +import com.sun.hotspot.igv.layout.Cluster; +import com.sun.hotspot.igv.layout.LayoutGraph; +import com.sun.hotspot.igv.layout.LayoutManager; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; + +/** + * + * @author Thomas Wuerthinger + */ +public class HierarchicalClusterLayoutManager implements LayoutManager { + + private OldHierarchicalLayoutManager.Combine combine; + private LayoutManager subManager = new OldHierarchicalLayoutManager(combine); + private LayoutManager manager = new OldHierarchicalLayoutManager(combine, 150); + private static final boolean TRACE = false; + + public HierarchicalClusterLayoutManager(OldHierarchicalLayoutManager.Combine combine) { + this.combine = combine; + } + + public void doLayout(LayoutGraph graph) { + doLayout(graph, new HashSet(), new HashSet(), new HashSet()); + } + + public void setSubManager(LayoutManager manager) { + this.subManager = manager; + } + + public void setManager(LayoutManager manager) { + this.manager = manager; + } + + public void doLayout(LayoutGraph graph, Set firstLayerHint, Set lastLayerHint, Set importantLinks) { + + assert graph.verify(); + + Hashtable> lists = new Hashtable>(); + Hashtable> listsConnection = new Hashtable>(); + Hashtable> clusterInputSlotHash = new Hashtable>(); + Hashtable> clusterOutputSlotHash = new Hashtable>(); + + Hashtable clusterNodes = new Hashtable(); + Hashtable> clusterInputSlotSet = new Hashtable>(); + Hashtable> clusterOutputSlotSet = new Hashtable>(); + Set clusterEdges = new HashSet(); + Set interClusterEdges = new HashSet(); + Hashtable linkClusterOutgoingConnection = new Hashtable(); + Hashtable linkInterClusterConnection = new Hashtable(); + Hashtable linkClusterIngoingConnection = new Hashtable(); + Set clusterNodeSet = new HashSet(); + + Set cluster = graph.getClusters(); + int z = 0; + for (Cluster c : cluster) { + lists.put(c, new ArrayList()); + listsConnection.put(c, new ArrayList()); + clusterInputSlotHash.put(c, new Hashtable()); + clusterOutputSlotHash.put(c, new Hashtable()); + clusterOutputSlotSet.put(c, new TreeSet()); + clusterInputSlotSet.put(c, new TreeSet()); + ClusterNode cn = new ClusterNode(c, "" + z); + clusterNodes.put(c, cn); + clusterNodeSet.add(cn); + z++; + } + + // Add cluster edges + for (Cluster c : cluster) { + + ClusterNode start = clusterNodes.get(c); + + for (Cluster succ : c.getSuccessors()) { + ClusterNode end = clusterNodes.get(succ); + if (end != null && start != end) { + ClusterEdge e = new ClusterEdge(start, end); + clusterEdges.add(e); + interClusterEdges.add(e); + } + } + } + + for (Vertex v : graph.getVertices()) { + Cluster c = v.getCluster(); + assert c != null; + clusterNodes.get(c).addSubNode(v); + } + + for (Link l : graph.getLinks()) { + + Port fromPort = l.getFrom(); + Port toPort = l.getTo(); + Vertex fromVertex = fromPort.getVertex(); + Vertex toVertex = toPort.getVertex(); + Cluster fromCluster = fromVertex.getCluster(); + Cluster toCluster = toVertex.getCluster(); + + Port samePort = null; + if (combine == OldHierarchicalLayoutManager.Combine.SAME_INPUTS) { + samePort = toPort; + } else if (combine == OldHierarchicalLayoutManager.Combine.SAME_OUTPUTS) { + samePort = fromPort; + } + + assert listsConnection.containsKey(fromCluster); + assert listsConnection.containsKey(toCluster); + + if (fromCluster == toCluster) { + listsConnection.get(fromCluster).add(l); + clusterNodes.get(fromCluster).addSubEdge(l); + } else { + ClusterInputSlotNode inputSlotNode = null; + ClusterOutputSlotNode outputSlotNode = null; + + if (samePort != null) { + outputSlotNode = clusterOutputSlotHash.get(fromCluster).get(samePort); + inputSlotNode = clusterInputSlotHash.get(toCluster).get(samePort); + } + + if (outputSlotNode == null) { + outputSlotNode = new ClusterOutputSlotNode(clusterNodes.get(fromCluster), "Out " + fromCluster.toString() + " " + samePort.toString()); + clusterOutputSlotSet.get(fromCluster).add(outputSlotNode); + ClusterOutgoingConnection conn = new ClusterOutgoingConnection(outputSlotNode, l); + outputSlotNode.setOutgoingConnection(conn); + clusterNodes.get(fromCluster).addSubEdge(conn); + if (samePort != null) { + clusterOutputSlotHash.get(fromCluster).put(samePort, outputSlotNode); + } + + linkClusterOutgoingConnection.put(l, conn); + } else { + linkClusterOutgoingConnection.put(l, outputSlotNode.getOutgoingConnection()); + } + + if (inputSlotNode == null) { + inputSlotNode = new ClusterInputSlotNode(clusterNodes.get(toCluster), "In " + toCluster.toString() + " " + samePort.toString()); + clusterInputSlotSet.get(toCluster).add(inputSlotNode); + } + + ClusterIngoingConnection conn = new ClusterIngoingConnection(inputSlotNode, l); + inputSlotNode.setIngoingConnection(conn); + clusterNodes.get(toCluster).addSubEdge(conn); + if (samePort != null) { + clusterInputSlotHash.get(toCluster).put(samePort, inputSlotNode); + } + + linkClusterIngoingConnection.put(l, conn); + + + InterClusterConnection interConn = new InterClusterConnection(outputSlotNode, inputSlotNode); + linkInterClusterConnection.put(l, interConn); + clusterEdges.add(interConn); + } + } + + Timing t = null; + + if (TRACE) { + new Timing("Child timing"); + t.start(); + } + + for (Cluster c : cluster) { + ClusterNode n = clusterNodes.get(c); + subManager.doLayout(new LayoutGraph(n.getSubEdges(), n.getSubNodes()), clusterInputSlotSet.get(c), clusterOutputSlotSet.get(c), new HashSet()); + n.updateSize(); + } + + Set roots = new LayoutGraph(interClusterEdges).findRootVertices(); + for (Vertex v : roots) { + assert v instanceof ClusterNode; + ((ClusterNode) v).setRoot(true); + } + + manager.doLayout(new LayoutGraph(clusterEdges, clusterNodeSet), new HashSet(), new HashSet(), interClusterEdges); + + for (Cluster c : cluster) { + ClusterNode n = clusterNodes.get(c); + c.setBounds(new Rectangle(n.getPosition(), n.getSize())); + } + + // TODO: handle case where blocks are not fully connected + + if (TRACE) { + t.stop(); + t.print(); + } + + for (Link l : graph.getLinks()) { + + if (linkInterClusterConnection.containsKey(l)) { + ClusterOutgoingConnection conn1 = linkClusterOutgoingConnection.get(l); + InterClusterConnection conn2 = linkInterClusterConnection.get(l); + ClusterIngoingConnection conn3 = linkClusterIngoingConnection.get(l); + + assert conn1 != null; + assert conn2 != null; + assert conn3 != null; + + List points = new ArrayList(); + + points.addAll(conn1.getControlPoints()); + points.addAll(conn2.getControlPoints()); + points.addAll(conn3.getControlPoints()); + + l.setControlPoints(points); + } + } + } + + public void doRouting(LayoutGraph graph) { + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java new file mode 100644 index 00000000000..9e5656f489f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/HierarchicalLayoutManager.java @@ -0,0 +1,2110 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.LayoutGraph; +import com.sun.hotspot.igv.layout.LayoutManager; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Vertex; +import java.awt.Dimension; +import java.awt.Point; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import java.util.Set; +import java.util.SortedSet; +import java.util.Stack; +import java.util.TreeSet; + +/** + * + * @author Thomas Wuerthinger + */ +public class HierarchicalLayoutManager implements LayoutManager { + + public static final boolean TRACE = false; + public static final boolean CHECK = false; + public static final int SWEEP_ITERATIONS = 1; + public static final int CROSSING_ITERATIONS = 2; + public static final int DUMMY_HEIGHT = 1; + public static final int DUMMY_WIDTH = 1; + public static final int X_OFFSET = 9; + public static final int LAYER_OFFSET = 30; + public static final int MAX_LAYER_LENGTH = -1; + public static final int MIN_LAYER_DIFFERENCE = 1; + + public enum Combine { + + NONE, + SAME_INPUTS, + SAME_OUTPUTS + } + // Options + private Combine combine; + private int dummyWidth; + private int dummyHeight; + private int xOffset; + private int layerOffset; + private int maxLayerLength; + private int minLayerDifference; + // Algorithm global datastructures + private Set reversedLinks; + private List nodes; + private HashMap vertexToLayoutNode; + private HashMap> reversedLinkStartPoints; + private HashMap> reversedLinkEndPoints; + private HashMap bottomEdgeHash; + private HashMap> splitStartPoints; + private HashMap> splitEndPoints; + private LayoutGraph graph; + private List[] layers; + private int layerCount; + private Set firstLayerHint; + private Set lastLayerHint; + private Set importantLinks; + private Set linksToFollow; + + private class LayoutNode { + + public int x; + public int y; + public int width; + public int height; + public int layer = -1; + public int xOffset; + public int yOffset; + public int bottomYOffset; + public Vertex vertex; // Only used for non-dummy nodes, otherwise null + public List preds = new ArrayList(); + public List succs = new ArrayList(); + public HashMap outOffsets = new HashMap(); + public HashMap inOffsets = new HashMap(); + public int pos = -1; // Position within layer + public int crossingNumber; + + @Override + public String toString() { + return "Node " + vertex; + } + } + + private class LayoutEdge { + + public LayoutNode from; + public LayoutNode to; + public int relativeFrom; + public int relativeTo; + public Link link; + } + + private abstract class AlgorithmPart { + + public void start() { + if (CHECK) { + preCheck(); + } + + long start = 0; + if (TRACE) { + System.out.println("##################################################"); + System.out.println("Starting part " + this.getClass().getName()); + start = System.currentTimeMillis(); + } + run(); + if (TRACE) { + System.out.println("Timing for " + this.getClass().getName() + " is " + (System.currentTimeMillis() - start)); + printStatistics(); + } + + if (CHECK) { + postCheck(); + } + } + + protected abstract void run(); + + protected void printStatistics() { + } + + protected void postCheck() { + } + + protected void preCheck() { + } + } + + public HierarchicalLayoutManager() { + this(Combine.NONE); + } + + public HierarchicalLayoutManager(Combine b) { + this.combine = b; + this.dummyWidth = DUMMY_WIDTH; + this.dummyHeight = DUMMY_HEIGHT; + this.xOffset = X_OFFSET; + this.layerOffset = LAYER_OFFSET; + this.maxLayerLength = MAX_LAYER_LENGTH; + this.minLayerDifference = MIN_LAYER_DIFFERENCE; + this.linksToFollow = new HashSet(); + } + + public int getMaxLayerLength() { + return maxLayerLength; + } + + public void setMaxLayerLength(int v) { + maxLayerLength = v; + } + + public void setMinLayerDifference(int v) { + minLayerDifference = v; + } + + public void doLayout(LayoutGraph graph) { + doLayout(graph, new HashSet(), new HashSet(), new HashSet()); + + } + + public void doLayout(LayoutGraph graph, Set firstLayerHint, Set lastLayerHint, Set importantLinks) { + + this.importantLinks = importantLinks; + this.graph = graph; + this.firstLayerHint = firstLayerHint; + this.lastLayerHint = lastLayerHint; + + vertexToLayoutNode = new HashMap(); + reversedLinks = new HashSet(); + reversedLinkStartPoints = new HashMap>(); + reversedLinkEndPoints = new HashMap>(); + bottomEdgeHash = new HashMap(); + nodes = new ArrayList(); + splitStartPoints = new HashMap>(); + splitEndPoints = new HashMap>(); + + // ############################################################# + // Step 1: Build up data structure + new BuildDatastructure().start(); + + // ############################################################# + // STEP 2: Reverse edges, handle backedges + new ReverseEdges().start(); + + for (LayoutNode n : nodes) { + ArrayList tmpArr = new ArrayList(); + for (LayoutEdge e : n.succs) { + if (importantLinks.contains(e.link)) { + tmpArr.add(e); + } + } + + for (LayoutEdge e : tmpArr) { + //System.out.println("Removed " + e); + e.from.succs.remove(e); + e.to.preds.remove(e); + } + } + + // ############################################################# + // STEP 3: Assign layers + new AssignLayers().start(); + + // ############################################################# + // STEP 4: Create dummy nodes + new CreateDummyNodes().start(); + + // ############################################################# + // STEP 5: Crossing Reduction + new CrossingReduction().start(); + + // ############################################################# + // STEP 7: Assign X coordinates + //new AssignXCoordinates().start(); + new AssignXCoordinates2().start(); + + // ############################################################# + // STEP 6: Assign Y coordinates + new AssignYCoordinates().start(); + + // ############################################################# + // STEP 8: Write back to interface + new WriteResult().start(); + } + + private class WriteResult extends AlgorithmPart { + + private int pointCount; + + protected void run() { + + HashMap vertexPositions = new HashMap(); + HashMap> linkPositions = new HashMap>(); + for (Vertex v : graph.getVertices()) { + LayoutNode n = vertexToLayoutNode.get(v); + assert !vertexPositions.containsKey(v); + vertexPositions.put(v, new Point(n.x + n.xOffset, n.y + n.yOffset)); + } + + for (LayoutNode n : nodes) { + + for (LayoutEdge e : n.preds) { + if (e.link != null) { + ArrayList points = new ArrayList(); + + Point p = new Point(e.to.x + e.relativeTo, e.to.y + e.to.yOffset); + points.add(p); + if (e.to.inOffsets.containsKey(e.relativeTo)) { + points.add(new Point(p.x, p.y + e.to.inOffsets.get(e.relativeTo))); + } + + LayoutNode cur = e.from; + LayoutNode other = e.to; + LayoutEdge curEdge = e; + while (cur.vertex == null && cur.preds.size() != 0) { + if (points.size() > 1 && points.get(points.size() - 1).x == cur.x + cur.width / 2 && points.get(points.size() - 2).x == cur.x + cur.width / 2) { + points.remove(points.size() - 1); + } + points.add(new Point(cur.x + cur.width / 2, cur.y + cur.height)); + if (points.size() > 1 && points.get(points.size() - 1).x == cur.x + cur.width / 2 && points.get(points.size() - 2).x == cur.x + cur.width / 2) { + points.remove(points.size() - 1); + } + points.add(new Point(cur.x + cur.width / 2, cur.y)); + assert cur.preds.size() == 1; + curEdge = cur.preds.get(0); + cur = curEdge.from; + } + + p = new Point(cur.x + curEdge.relativeFrom, cur.y + cur.height - cur.bottomYOffset); + if (curEdge.from.outOffsets.containsKey(curEdge.relativeFrom)) { + points.add(new Point(p.x, p.y + curEdge.from.outOffsets.get(curEdge.relativeFrom))); + } + points.add(p); + + Collections.reverse(points); + + + + if (cur.vertex == null && cur.preds.size() == 0) { + + if (reversedLinkEndPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkEndPoints.get(e.link)) { + points.add(new Point(p1.x + e.to.x, p1.y + e.to.y)); + } + } + + if (splitStartPoints.containsKey(e.link)) { + points.add(0, null); + points.addAll(0, splitStartPoints.get(e.link)); + + //checkPoints(points); + if (reversedLinks.contains(e.link)) { + Collections.reverse(points); + } + assert !linkPositions.containsKey(e.link); + linkPositions.put(e.link, points); + } else { + splitEndPoints.put(e.link, points); + } + + } else { + if (reversedLinks.contains(e.link)) { + Collections.reverse(points); + } + if (reversedLinkStartPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkStartPoints.get(e.link)) { + points.add(new Point(p1.x + cur.x, p1.y + cur.y)); + } + } + + if (reversedLinkEndPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkEndPoints.get(e.link)) { + points.add(0, new Point(p1.x + other.x, p1.y + other.y)); + } + } + + assert !linkPositions.containsKey(e.link); + linkPositions.put(e.link, points); + } + pointCount += points.size(); + + // No longer needed! + e.link = null; + } + } + + for (LayoutEdge e : n.succs) { + if (e.link != null) { + ArrayList points = new ArrayList(); + Point p = new Point(e.from.x + e.relativeFrom, e.from.y + e.from.height - e.from.bottomYOffset); + points.add(p); + if (e.from.outOffsets.containsKey(e.relativeFrom)) { + points.add(new Point(p.x, p.y + e.from.outOffsets.get(e.relativeFrom))); + } + + LayoutNode cur = e.to; + LayoutNode other = e.from; + LayoutEdge curEdge = e; + while (cur.vertex == null && cur.succs.size() != 0) { + if (points.size() > 1 && points.get(points.size() - 1).x == cur.x + cur.width / 2 && points.get(points.size() - 2).x == cur.x + cur.width / 2) { + points.remove(points.size() - 1); + } + points.add(new Point(cur.x + cur.width / 2, cur.y)); + if (points.size() > 1 && points.get(points.size() - 1).x == cur.x + cur.width / 2 && points.get(points.size() - 2).x == cur.x + cur.width / 2) { + points.remove(points.size() - 1); + } + points.add(new Point(cur.x + cur.width / 2, cur.y + cur.height)); + if (cur.succs.size() == 0) { + break; + } + assert cur.succs.size() == 1; + curEdge = cur.succs.get(0); + cur = curEdge.to; + } + + + p = new Point(cur.x + curEdge.relativeTo, cur.y + cur.yOffset); + points.add(p); + if (curEdge.to.inOffsets.containsKey(curEdge.relativeTo)) { + points.add(new Point(p.x, p.y + curEdge.to.inOffsets.get(curEdge.relativeTo))); + } + + + if (cur.succs.size() == 0 && cur.vertex == null) { + if (reversedLinkStartPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkStartPoints.get(e.link)) { + points.add(0, new Point(p1.x + other.x, p1.y + other.y)); + } + } + + if (splitEndPoints.containsKey(e.link)) { + points.add(null); + points.addAll(splitEndPoints.get(e.link)); + + //checkPoints(points); + if (reversedLinks.contains(e.link)) { + Collections.reverse(points); + } + assert !linkPositions.containsKey(e.link); + linkPositions.put(e.link, points); + } else { + splitStartPoints.put(e.link, points); + } + } else { + + if (reversedLinkStartPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkStartPoints.get(e.link)) { + points.add(0, new Point(p1.x + other.x, p1.y + other.y)); + } + } + if (reversedLinkEndPoints.containsKey(e.link)) { + for (Point p1 : reversedLinkEndPoints.get(e.link)) { + points.add(new Point(p1.x + cur.x, p1.y + cur.y)); + } + } + if (reversedLinks.contains(e.link)) { + Collections.reverse(points); + } + //checkPoints(points); + assert !linkPositions.containsKey(e.link); + linkPositions.put(e.link, points); + } + + pointCount += points.size(); + e.link = null; + } + } + } + + int minX = Integer.MAX_VALUE; + int minY = Integer.MAX_VALUE; + for (Vertex v : vertexPositions.keySet()) { + Point p = vertexPositions.get(v); + minX = Math.min(minX, p.x); + minY = Math.min(minY, p.y); + } + + for (Link l : linkPositions.keySet()) { + List points = linkPositions.get(l); + for (Point p : points) { + if (p != null) { + minX = Math.min(minX, p.x); + minY = Math.min(minY, p.y); + } + } + + } + + for (Vertex v : vertexPositions.keySet()) { + Point p = vertexPositions.get(v); + p.x -= minX; + p.y -= minY; + v.setPosition(p); + } + + for (Link l : linkPositions.keySet()) { + List points = linkPositions.get(l); + for (Point p : points) { + if (p != null) { + p.x -= minX; + p.y -= minY; + } + } + l.setControlPoints(points); + + } + } + + @Override + protected void printStatistics() { + System.out.println("Number of nodes: " + nodes.size()); + int edgeCount = 0; + for (LayoutNode n : nodes) { + edgeCount += n.succs.size(); + } + System.out.println("Number of edges: " + edgeCount); + System.out.println("Number of points: " + pointCount); + } + } + + private static class Segment { + + public float d; + public int orderNumber = -1; + public ArrayList nodes = new ArrayList(); + public HashSet succs = new HashSet(); + public HashSet preds = new HashSet(); + public Region region; + } + private static final Comparator segmentComparator = new Comparator() { + + public int compare(Segment s1, Segment s2) { + return s1.orderNumber - s2.orderNumber; + } + }; + + private static class Region { + + public float d; + public int minOrderNumber; + public SortedSet segments = new TreeSet(segmentComparator); + public HashSet succs = new HashSet(4); + public HashSet preds = new HashSet(4); + } + private static final Comparator regionComparator = new Comparator() { + + public int compare(Region r1, Region r2) { + return r1.minOrderNumber - r2.minOrderNumber; + } + }; + private static final Comparator nodePositionComparator = new Comparator() { + + public int compare(LayoutNode n1, LayoutNode n2) { + return n1.pos - n2.pos; + } + }; + private static final Comparator nodeProcessingDownComparator = new Comparator() { + + public int compare(LayoutNode n1, LayoutNode n2) { + if (n1.vertex == null) { + return -1; + } + if (n2.vertex == null) { + return 1; + } + return n1.preds.size() - n2.preds.size(); + } + }; + private static final Comparator nodeProcessingUpComparator = new Comparator() { + + public int compare(LayoutNode n1, LayoutNode n2) { + if (n1.vertex == null) { + return -1; + } + if (n2.vertex == null) { + return 1; + } + return n1.succs.size() - n2.succs.size(); + } + }; + + private class AssignXCoordinates2 extends AlgorithmPart { + + private ArrayList[] space; + private ArrayList[] downProcessingOrder; + private ArrayList[] upProcessingOrder; + + private void initialPositions() { + for (LayoutNode n : nodes) { + n.x = space[n.layer].get(n.pos); + } + } + + protected void run() { + + space = new ArrayList[layers.length]; + downProcessingOrder = new ArrayList[layers.length]; + upProcessingOrder = new ArrayList[layers.length]; + + for (int i = 0; i < layers.length; i++) { + space[i] = new ArrayList(); + downProcessingOrder[i] = new ArrayList(); + upProcessingOrder[i] = new ArrayList(); + + int curX = 0; + for (LayoutNode n : layers[i]) { + space[i].add(curX); + curX += n.width + xOffset; + downProcessingOrder[i].add(n); + upProcessingOrder[i].add(n); + } + + Collections.sort(downProcessingOrder[i], nodeProcessingDownComparator); + Collections.sort(upProcessingOrder[i], nodeProcessingUpComparator); + } + + initialPositions(); + for (int i = 0; i < SWEEP_ITERATIONS; i++) { + sweepDown(); + sweepUp(); + } + + for (int i = 0; i < SWEEP_ITERATIONS; i++) { + doubleSweep(); + } + } + + private int calculateOptimalDown(LayoutNode n) { + + List values = new ArrayList(); + if (n.preds.size() == 0) { + return n.x; + } + for (LayoutEdge e : n.preds) { + int cur = e.from.x + e.relativeFrom - e.relativeTo; + values.add(cur); + } + return median(values); + } + + private int calculateOptimalBoth(LayoutNode n) { + + List values = new ArrayList(); + if (n.preds.size() == 0 + n.succs.size()) { + return n.x; + } + for (LayoutEdge e : n.preds) { + int cur = e.from.x + e.relativeFrom - e.relativeTo; + values.add(cur); + } + + for (LayoutEdge e : n.succs) { + int cur = e.to.x + e.relativeTo - e.relativeFrom; + values.add(cur); + } + + return median(values); + } + + private int calculateOptimalUp(LayoutNode n) { + + //List values = new ArrayList(); + int size = n.succs.size(); + if (size == 0) { + return n.x; + } else { + int result = 0; + for (LayoutEdge e : n.succs) { + int cur = e.to.x + e.relativeTo - e.relativeFrom; + result += cur; + } + return result / size; //median(values); + } + } + + private int median(List values) { + Collections.sort(values); + if (values.size() % 2 == 0) { + return (values.get(values.size() / 2 - 1) + values.get(values.size() / 2)) / 2; + } else { + return values.get(values.size() / 2); + } + } + + private void sweepUp() { + for (int i = layers.length - 1; i >= 0; i--) { + NodeRow r = new NodeRow(space[i]); + for (LayoutNode n : upProcessingOrder[i]) { + int optimal = calculateOptimalUp(n); + r.insert(n, optimal); + } + } + /* + for(int i=0; i= 0; i--) { + NodeRow r = new NodeRow(space[i]); + for (LayoutNode n : upProcessingOrder[i]) { + int optimal = calculateOptimalBoth(n); + r.insert(n, optimal); + } + } + } + + private void sweepDown() { + for (int i = 1; i < layers.length; i++) { + NodeRow r = new NodeRow(space[i]); + for (LayoutNode n : downProcessingOrder[i]) { + int optimal = calculateOptimalDown(n); + r.insert(n, optimal); + } + } + } + } + + private static class NodeRow { + + private TreeSet treeSet; + private ArrayList space; + + public NodeRow(ArrayList space) { + treeSet = new TreeSet(nodePositionComparator); + this.space = space; + } + + public int offset(LayoutNode n1, LayoutNode n2) { + int v1 = space.get(n1.pos) + n1.width; + int v2 = space.get(n2.pos); + return v2 - v1; + } + + public void insert(LayoutNode n, int pos) { + + SortedSet headSet = treeSet.headSet(n); + + LayoutNode leftNeighbor = null; + int minX = Integer.MIN_VALUE; + if (!headSet.isEmpty()) { + leftNeighbor = headSet.last(); + minX = leftNeighbor.x + leftNeighbor.width + offset(leftNeighbor, n); + } + + if (pos < minX) { + n.x = minX; + } else { + + LayoutNode rightNeighbor = null; + SortedSet tailSet = treeSet.tailSet(n); + int maxX = Integer.MAX_VALUE; + if (!tailSet.isEmpty()) { + rightNeighbor = tailSet.first(); + maxX = rightNeighbor.x - offset(n, rightNeighbor) - n.width; + } + + if (pos > maxX) { + n.x = maxX; + } else { + n.x = pos; + } + + assert minX <= maxX; + } + + treeSet.add(n); + } + } + + private class AssignXCoordinates extends AlgorithmPart { + + HashMap hashMap = new HashMap(); + ArrayList segments = new ArrayList(); + + private void generateSegments() { + + for (int i = 0; i < layerCount; i++) { + for (LayoutNode n : layers[i]) { + if (!hashMap.containsKey(n)) { + Segment s = new Segment(); + segments.add(s); + LayoutNode curNode = n; + + int maxLength = 0; + while (curNode.succs.size() == 1 && curNode.preds.size() == 1) { + s.nodes.add(curNode); + assert !hashMap.containsKey(curNode); + hashMap.put(curNode, s); + curNode = curNode.succs.get(0).to; + maxLength++; + //if(maxLength > 10) break; + } + + if (s.nodes.size() > 0 && curNode.preds.size() == 1 && curNode.vertex == null) { + s.nodes.add(curNode); + assert !hashMap.containsKey(curNode); + hashMap.put(curNode, s); + } + + if (s.nodes.size() == 0) { + // Simple segment with a single node + s.nodes.add(n); + hashMap.put(n, s); + } + } + } + } + } + + private void addEdges() { + + for (int i = 0; i < layerCount; i++) { + LayoutNode prev = null; + for (LayoutNode n : layers[i]) { + + if (prev != null) { + Segment s1 = hashMap.get(prev); + Segment s2 = hashMap.get(n); + + if (s1 != s2) { + s1.succs.add(s2); + s2.preds.add(s1); + } + } + prev = n; + + } + } + } + + private void topologicalSorting() { + + Queue queue = new LinkedList(); + + int index = 0; + ArrayList newList = new ArrayList(); + for (Segment s : segments) { + if (s.preds.size() == 0) { + s.orderNumber = index; + newList.add(s); + index++; + queue.add(s); + } + } + + while (!queue.isEmpty()) { + Segment s = queue.remove(); + + for (Segment succ : s.succs) { + succ.preds.remove(s); + if (succ.preds.size() == 0) { + queue.add(succ); + succ.orderNumber = index; + newList.add(succ); + index++; + } + } + } + + segments = newList; + } + + private void initialPositions() { + + int[] minPos = new int[layers.length]; + + for (Segment s : segments) { + int max = 0; + for (LayoutNode n : s.nodes) { + int x = minPos[n.layer]; + if (x > max) { + max = x; + } + } + + for (LayoutNode n : s.nodes) { + minPos[n.layer] = max + n.width + xOffset; + n.x = max; + } + } + } + + private int predSum(LayoutNode n) { + int sum = 0; + for (LayoutEdge e : n.preds) { + assert e.to == n; + //sum += (e.from.x + e.relativeFrom + (int)hashMap.get(e.from).d) - (e.to.x + e.relativeTo + (int)hashMap.get(e.to).d); + sum += (e.from.x + e.relativeFrom) - (e.to.x + e.relativeTo); + } + + return sum; + } + + private int succSum(LayoutNode n) { + int sum = 0; + for (LayoutEdge e : n.succs) { + + assert e.from == n; + sum += (e.to.x + e.relativeTo) - (e.from.x + e.relativeFrom); + //sum += (e.to.x + e.relativeTo + (int)hashMap.get(e.to).d) - (e.from.x + e.relativeFrom + (int)hashMap.get(e.from).d); + } + + return sum; + + } + + private void downValues() { + + for (Segment s : segments) { + downValues(s); + + } + + } + + private void downValues(Segment s) { + LayoutNode n = s.nodes.get(0); // Only first node needed, all other have same coordinate + + if (n.preds.size() == 0) { + // Value is 0.0; + if (n.succs.size() == 0) { + s.d = 0.0f; + } else { + s.d = (((float) succSum(n) / (float) n.succs.size())) / 2; + } + } else { + s.d = (float) predSum(n) / (float) n.preds.size(); + } + } + + private void upValues() { + for (Segment s : segments) { + upValues(s); + } + } + + private void upValues(Segment s) { + LayoutNode n = s.nodes.get(0); // Only first node needed, all other have same coordinate + + if (n.succs.size() == 0) { + // Value is 0.0; + if (n.preds.size() == 0) { + s.d = 0.0f; + } else { + s.d = (float) predSum(n) / (float) n.preds.size(); + } + } else { + s.d = ((float) succSum(n) / (float) n.succs.size()) / 2; + } + } + + private void sweep(boolean down) { + + if (down) { + downValues(); + } else { + upValues(); + } + + SortedSet regions = new TreeSet(regionComparator); + for (Segment s : segments) { + s.region = new Region(); + s.region.minOrderNumber = s.orderNumber; + s.region.segments.add(s); + s.region.d = s.d; + regions.add(s.region); + } + + for (Segment s : segments) { + for (LayoutNode n : s.nodes) { + if (n.pos != 0) { + LayoutNode prevNode = layers[n.layer].get(n.pos - 1); + if (prevNode.x + prevNode.width + xOffset == n.x) { + Segment other = hashMap.get(prevNode); + Region r1 = s.region; + Region r2 = other.region; + // They are close together + if (r1 != r2 && r2.d >= r1.d) { + + if (r2.segments.size() < r1.segments.size()) { + + r1.d = (r1.d * r1.segments.size() + r2.d * r2.segments.size()) / (r1.segments.size() + r2.segments.size()); + + for (Segment tempS : r2.segments) { + r1.segments.add(tempS); + tempS.region = r1; + r1.minOrderNumber = Math.min(r1.minOrderNumber, tempS.orderNumber); + } + + regions.remove(r2); + } else { + + r2.d = (r1.d * r1.segments.size() + r2.d * r2.segments.size()) / (r1.segments.size() + r2.segments.size()); + + for (Segment tempS : r1.segments) { + r2.segments.add(tempS); + tempS.region = r2; + r2.minOrderNumber = Math.min(r2.minOrderNumber, tempS.orderNumber); + } + + regions.remove(r1); + } + } + } + } + } + } + + + + ArrayList reversedRegions = new ArrayList(); + for (Region r : regions) { + if (r.d < 0) { + processRegion(r, down); + } else { + reversedRegions.add(0, r); + } + } + + for (Region r : reversedRegions) { + processRegion(r, down); + } + + } + + private void processRegion(Region r, boolean down) { + + // Do not move + if ((int) r.d == 0) { + return; + } + + ArrayList arr = new ArrayList(); + for (Segment s : r.segments) { + arr.add(s); + } + + if (r.d > 0) { + Collections.reverse(arr); + } + + for (Segment s : arr) { + + + int min = (int) r.d; + if (min < 0) { + min = -min; + } + + for (LayoutNode n : s.nodes) { + + int layer = n.layer; + int pos = n.pos; + + + if (r.d > 0) { + + if (pos != layers[layer].size() - 1) { + + int off = layers[layer].get(pos + 1).x - n.x - xOffset - n.width; + assert off >= 0; + if (off < min) { + min = off; + } + } + + } else { + + if (pos != 0) { + + int off = n.x - xOffset - layers[layer].get(pos - 1).x - layers[layer].get(pos - 1).width; + assert off >= 0; + if (off < min) { + min = off; + } + } + } + } + + assert min >= 0; + if (min != 0) { + for (LayoutNode n : s.nodes) { + if (r.d > 0) { + n.x += min; + } else { + n.x -= min; + } + + } + } + } + } + + protected void run() { + + generateSegments(); + addEdges(); + topologicalSorting(); + initialPositions(); + for (int i = 0; i < SWEEP_ITERATIONS; i++) { + + sweep(true); + sweep(true); + sweep(false); + sweep(false); + } + + sweep(true); + sweep(true); + } + } + private static Comparator crossingNodeComparator = new Comparator() { + + public int compare(LayoutNode n1, LayoutNode n2) { + return n1.crossingNumber - n2.crossingNumber; + } + }; + + private class CrossingReduction extends AlgorithmPart { + + @Override + public void preCheck() { + for (LayoutNode n : nodes) { + assert n.layer < layerCount; + } + } + + protected void run() { + + layers = new List[layerCount]; + + for (int i = 0; i < layerCount; i++) { + layers[i] = new ArrayList(); + } + + + // Generate initial ordering + HashSet visited = new HashSet(); + for (LayoutNode n : nodes) { + if (n.layer == 0) { + layers[0].add(n); + visited.add(n); + } else if (n.preds.size() == 0) { + layers[n.layer].add(n); + visited.add(n); + } + } + + for (int i = 0; i < layers.length - 1; i++) { + for (LayoutNode n : layers[i]) { + for (LayoutEdge e : n.succs) { + if (!visited.contains(e.to)) { + visited.add(e.to); + layers[i + 1].add(e.to); + } + } + } + } + + + updatePositions(); + + initX(); + + // Optimize + for (int i = 0; i < CROSSING_ITERATIONS; i++) { + downSweep(); + upSweep(); + } + + /*for(int i=0; i 0) { + sum /= n.preds.size(); + n.crossingNumber = sum; + //if(n.vertex == null) n.crossingNumber += layers[i].size(); + } + } + + + updateCrossingNumbers(i, true); + Collections.sort(layers[i], crossingNodeComparator); + updateXOfLayer(i); + + int z = 0; + for (LayoutNode n : layers[i]) { + n.pos = z; + z++; + } + } + } + + private void updateCrossingNumbers(int index, boolean down) { + for (int i = 0; i < layers[index].size(); i++) { + LayoutNode n = layers[index].get(i); + LayoutNode prev = null; + if (i > 0) { + prev = layers[index].get(i - 1); + } + LayoutNode next = null; + if (i < layers[index].size() - 1) { + next = layers[index].get(i + 1); + } + + boolean cond = (n.succs.size() == 0); + if (down) { + cond = (n.preds.size() == 0); + } + + if (cond) { + + if (prev != null && next != null) { + n.crossingNumber = (prev.crossingNumber + next.crossingNumber) / 2; + } else if (prev != null) { + n.crossingNumber = prev.crossingNumber; + } else if (next != null) { + n.crossingNumber = next.crossingNumber; + } + } + } + } + /* + private void doubleSweep() { + // Downsweep + for(int i=0; i= layerCount) { + index = 2*layerCount - i - 1; + } + for(LayoutNode n : layers[index]) { + float sum = 0.0f; + for(LayoutEdge e : n.preds) { + float cur = e.from.pos; + if(e.from.width != 0 && e.relativeFrom != 0) { + cur += (float)e.relativeFrom / (float)(e.from.width); + } + sum += cur; + } + for(LayoutEdge e : n.succs) { + float cur = e.to.pos; + if(e.to.width != 0 && e.relativeTo != 0) { + cur += (float)e.relativeTo / (float)(e.to.width); + } + sum += cur; + } + if(n.preds.size() + n.succs.size() > 0) { + sum /= n.preds.size() + n.succs.size(); + n.crossingNumber = sum; + } + } + Collections.sort(layers[index], crossingNodeComparator); + updateXOfLayer(index); + int z = 0; + for(LayoutNode n : layers[index]) { + n.pos = z; + z++; + } + } + }*/ + + private void upSweep() { + // Upsweep + for (int i = layerCount - 2; i >= 0; i--) { + + for (LayoutNode n : layers[i]) { + n.crossingNumber = 0; + } + + for (LayoutNode n : layers[i]) { + + int sum = 0; + for (LayoutEdge e : n.succs) { + int cur = e.to.x + e.relativeTo;//pos; + /* + if(e.to.width != 0 && e.relativeTo != 0) { + cur += (float)e.relativeTo / (float)(e.to.width); + }*/ + + sum += cur; + } + + if (n.succs.size() > 0) { + sum /= n.succs.size(); + n.crossingNumber = sum; + //if(n.vertex == null) n.crossingNumber += layers[i].size(); + } + + } + + updateCrossingNumbers(i, false); + Collections.sort(layers[i], crossingNodeComparator); + updateXOfLayer(i); + + int z = 0; + for (LayoutNode n : layers[i]) { + n.pos = z; + z++; + } + } + } + + private int evaluate() { + // TODO: Implement efficient evaluate / crossing min + return 0; + } + + @Override + public void postCheck() { + + HashSet visited = new HashSet(); + for (int i = 0; i < layers.length; i++) { + for (LayoutNode n : layers[i]) { + assert !visited.contains(n); + assert n.layer == i; + visited.add(n); + } + } + + } + } + + private class AssignYCoordinates extends AlgorithmPart { + + protected void run() { + int curY = 0; + //maxLayerHeight = new int[layers.length]; + for (int i = 0; i < layers.length; i++) { + int maxHeight = 0; + int baseLine = 0; + int bottomBaseLine = 0; + for (LayoutNode n : layers[i]) { + maxHeight = Math.max(maxHeight, n.height - n.yOffset - n.bottomYOffset); + baseLine = Math.max(baseLine, n.yOffset); + bottomBaseLine = Math.max(bottomBaseLine, n.bottomYOffset); + } + + int maxXOffset = 0; + for (LayoutNode n : layers[i]) { + if (n.vertex == null) { + // Dummy node + n.y = curY; + n.height = maxHeight + baseLine + bottomBaseLine; + + } else { + n.y = curY + baseLine + (maxHeight - (n.height - n.yOffset - n.bottomYOffset)) / 2 - n.yOffset; + } + + for (LayoutEdge e : n.succs) { + int curXOffset = Math.abs(n.x - e.to.x); + maxXOffset = Math.max(curXOffset, maxXOffset); + } + } + + //maxLayerHeight[i] = maxHeight + baseLine + bottomBaseLine; + + curY += maxHeight + baseLine + bottomBaseLine; + curY += layerOffset + (int) Math.sqrt(maxXOffset); + } + } + } + + private class CreateDummyNodes extends AlgorithmPart { + + private int oldNodeCount; + + @Override + protected void preCheck() { + for (LayoutNode n : nodes) { + for (LayoutEdge e : n.succs) { + assert e.from != null; + assert e.from == n; + assert e.from.layer < e.to.layer; + } + + for (LayoutEdge e : n.preds) { + assert e.to != null; + assert e.to == n; + } + } + } + + protected void run() { + oldNodeCount = nodes.size(); + + + if (combine == Combine.SAME_OUTPUTS) { + + Comparator comparator = new Comparator() { + + public int compare(LayoutEdge e1, LayoutEdge e2) { + return e1.to.layer - e2.to.layer; + } + }; + HashMap> portHash = new HashMap>(); + ArrayList currentNodes = new ArrayList(nodes); + for (LayoutNode n : currentNodes) { + portHash.clear(); + + ArrayList succs = new ArrayList(n.succs); + HashMap topNodeHash = new HashMap(); + HashMap> bottomNodeHash = new HashMap>(); + for (LayoutEdge e : succs) { + assert e.from.layer < e.to.layer; + if (e.from.layer != e.to.layer - 1) { + if (maxLayerLength != -1 && e.to.layer - e.from.layer > maxLayerLength/* && e.to.preds.size() > 1 && e.from.succs.size() > 1*/) { + assert maxLayerLength > 2; + e.to.preds.remove(e); + e.from.succs.remove(e); + + LayoutEdge topEdge = null; + + if (combine == Combine.SAME_OUTPUTS && topNodeHash.containsKey(e.relativeFrom)) { + LayoutNode topNode = topNodeHash.get(e.relativeFrom); + topEdge = new LayoutEdge(); + topEdge.relativeFrom = e.relativeFrom; + topEdge.from = e.from; + topEdge.relativeTo = topNode.width / 2; + topEdge.to = topNode; + topEdge.link = e.link; + e.from.succs.add(topEdge); + topNode.preds.add(topEdge); + } else { + + LayoutNode topNode = new LayoutNode(); + topNode.layer = e.from.layer + 1; + topNode.width = DUMMY_WIDTH; + topNode.height = DUMMY_HEIGHT; + nodes.add(topNode); + topEdge = new LayoutEdge(); + topEdge.relativeFrom = e.relativeFrom; + topEdge.from = e.from; + topEdge.relativeTo = topNode.width / 2; + topEdge.to = topNode; + topEdge.link = e.link; + e.from.succs.add(topEdge); + topNode.preds.add(topEdge); + topNodeHash.put(e.relativeFrom, topNode); + bottomNodeHash.put(e.relativeFrom, new HashMap()); + } + + HashMap hash = bottomNodeHash.get(e.relativeFrom); + + LayoutNode bottomNode = null; + if (hash.containsKey(e.to.layer)) { + bottomNode = hash.get(e.to.layer); + } else { + + bottomNode = new LayoutNode(); + bottomNode.layer = e.to.layer - 1; + bottomNode.width = DUMMY_WIDTH; + bottomNode.height = DUMMY_HEIGHT; + nodes.add(bottomNode); + hash.put(e.to.layer, bottomNode); + } + + LayoutEdge bottomEdge = new LayoutEdge(); + bottomEdge.relativeTo = e.relativeTo; + bottomEdge.to = e.to; + bottomEdge.relativeFrom = bottomNode.width / 2; + bottomEdge.from = bottomNode; + bottomEdge.link = e.link; + e.to.preds.add(bottomEdge); + bottomEdgeHash.put(topEdge, bottomEdge); + bottomNode.succs.add(bottomEdge); + + } else { + Integer i = e.relativeFrom; + if (!portHash.containsKey(i)) { + portHash.put(i, new ArrayList()); + } + + if (n.vertex.toString().equals("1012 CastPP")) { + int x = 0; + } + + portHash.get(i).add(e); + } + } + } + + succs = new ArrayList(n.succs); + for (LayoutEdge e : succs) { + + Integer i = e.relativeFrom; + if (portHash.containsKey(i)) { + + List list = portHash.get(i); + Collections.sort(list, comparator); + + if (list.size() == 1) { + processSingleEdge(list.get(0)); + } else { + + int maxLayer = list.get(0).to.layer; + for (LayoutEdge curEdge : list) { + maxLayer = Math.max(maxLayer, curEdge.to.layer); + } + + + int cnt = maxLayer - n.layer - 1; + LayoutEdge[] edges = new LayoutEdge[cnt]; + LayoutNode[] nodes = new LayoutNode[cnt]; + edges[0] = new LayoutEdge(); + edges[0].from = n; + edges[0].relativeFrom = i; + n.succs.add(edges[0]); + + nodes[0] = new LayoutNode(); + nodes[0].width = dummyWidth; + nodes[0].height = dummyHeight; + nodes[0].layer = n.layer + 1; + nodes[0].preds.add(edges[0]); + edges[0].to = nodes[0]; + edges[0].relativeTo = nodes[0].width / 2; + for (int j = 1; j < cnt; j++) { + edges[j] = new LayoutEdge(); + edges[j].from = nodes[j - 1]; + edges[j].relativeFrom = nodes[j - 1].width / 2; + nodes[j - 1].succs.add(edges[j]); + nodes[j] = new LayoutNode(); + nodes[j].width = dummyWidth; + nodes[j].height = dummyHeight; + nodes[j].layer = n.layer + j + 1; + nodes[j].preds.add(edges[j]); + edges[j].to = nodes[j]; + edges[j].relativeTo = nodes[j].width / 2; + } + + for (LayoutEdge curEdge : list) { + assert curEdge.to.layer - n.layer - 2 >= 0; + assert curEdge.to.layer - n.layer - 2 < cnt; + LayoutNode anchor = nodes[curEdge.to.layer - n.layer - 2]; + anchor.succs.add(curEdge); + curEdge.from = anchor; + curEdge.relativeFrom = anchor.width / 2; + n.succs.remove(curEdge); + } + + } + + portHash.remove(i); + } + } + } + } else if (combine == Combine.SAME_INPUTS) { + throw new UnsupportedOperationException("Currently not supported"); + } else { + ArrayList currentNodes = new ArrayList(nodes); + for (LayoutNode n : currentNodes) { + for (LayoutEdge e : n.succs) { + processSingleEdge(e); + } + } + } + } + + private void processSingleEdge(LayoutEdge e) { + LayoutNode n = e.from; + if (e.to.layer > n.layer + 1) { + LayoutEdge last = e; + for (int i = n.layer + 1; i < last.to.layer; i++) { + last = addBetween(last, i); + } + } + } + + private LayoutEdge addBetween(LayoutEdge e, int layer) { + LayoutNode n = new LayoutNode(); + n.width = dummyWidth; + n.height = dummyHeight; + n.layer = layer; + n.preds.add(e); + nodes.add(n); + LayoutEdge result = new LayoutEdge(); + n.succs.add(result); + result.from = n; + result.relativeFrom = n.width / 2; + result.to = e.to; + result.relativeTo = e.relativeTo; + e.relativeTo = n.width / 2; + e.to.preds.remove(e); + e.to.preds.add(result); + e.to = n; + return result; + } + + @Override + public void printStatistics() { + System.out.println("Dummy nodes created: " + (nodes.size() - oldNodeCount)); + } + + @Override + public void postCheck() { + ArrayList currentNodes = new ArrayList(nodes); + for (LayoutNode n : currentNodes) { + for (LayoutEdge e : n.succs) { + assert e.from.layer == e.to.layer - 1; + } + } + + for (int i = 0; i < layers.length; i++) { + assert layers[i].size() > 0; + for (LayoutNode n : layers[i]) { + assert n.layer == i; + } + } + } + } + + private class AssignLayers extends AlgorithmPart { + + @Override + public void preCheck() { + for (LayoutNode n : nodes) { + assert n.layer == -1; + } + } + + protected void run() { + HashSet set = new HashSet(); + for (LayoutNode n : nodes) { + if (n.preds.size() == 0) { + set.add(n); + n.layer = 0; + } + } + + int z = minLayerDifference; + HashSet newSet = new HashSet(); + HashSet failed = new HashSet(); + while (!set.isEmpty()) { + + newSet.clear(); + failed.clear(); + + for (LayoutNode n : set) { + + for (LayoutEdge se : n.succs) { + LayoutNode s = se.to; + if (!newSet.contains(s) && !failed.contains(s)) { + boolean ok = true; + for (LayoutEdge pe : s.preds) { + LayoutNode p = pe.from; + if (p.layer == -1) { + ok = false; + break; + } + } + + if (ok) { + newSet.add(s); + } else { + failed.add(s); + } + } + } + + } + + for (LayoutNode n : newSet) { + n.layer = z; + } + + // Swap sets + HashSet tmp = set; + set = newSet; + newSet = tmp; + z += minLayerDifference; + } + + optimize(set); + + layerCount = z - minLayerDifference; + + for (Vertex v : lastLayerHint) { + + LayoutNode n = vertexToLayoutNode.get(v); + assert n.succs.size() == 0; + n.layer = layerCount - 1; + } + + for (Vertex v : firstLayerHint) { + LayoutNode n = vertexToLayoutNode.get(v); + assert n.preds.size() == 0; + assert n.layer == 0; + } + } + + public void optimize(HashSet set) { + + for (LayoutNode n : set) { + if (n.preds.size() == 0 && n.succs.size() > 0) { + int minLayer = n.succs.get(0).to.layer; + for (LayoutEdge e : n.succs) { + minLayer = Math.min(minLayer, e.to.layer); + } + + n.layer = minLayer - 1; + } + } + + } + + @Override + public void postCheck() { + for (LayoutNode n : nodes) { + assert n.layer >= 0; + assert n.layer < layerCount; + for (LayoutEdge e : n.succs) { + assert e.from.layer < e.to.layer; + } + } + } + } + + private class ReverseEdges extends AlgorithmPart { + + private HashSet visited; + private HashSet active; + + protected void run() { + + // Remove self-edges, TODO: Special treatment + for (LayoutNode node : nodes) { + ArrayList succs = new ArrayList(node.succs); + for (LayoutEdge e : succs) { + assert e.from == node; + if (e.to == node) { + node.succs.remove(e); + node.preds.remove(e); + } + } + } + + // Reverse inputs of roots + for (LayoutNode node : nodes) { + if (node.vertex.isRoot()) { + boolean ok = true; + for (LayoutEdge e : node.preds) { + if (e.from.vertex.isRoot()) { + ok = false; + break; + } + } + if (ok) { + reverseAllInputs(node); + } + } + } + + + // Start DFS and reverse back edges + visited = new HashSet(); + active = new HashSet(); + for (LayoutNode node : nodes) { + DFS(node); + } + + + for (LayoutNode node : nodes) { + + SortedSet reversedDown = new TreeSet(); + + for (LayoutEdge e : node.succs) { + if (reversedLinks.contains(e.link)) { + reversedDown.add(e.relativeFrom); + } + } + + + SortedSet reversedUp = null; + if (reversedDown.size() == 0) { + reversedUp = new TreeSet(Collections.reverseOrder()); + } else { + reversedUp = new TreeSet(); + } + + for (LayoutEdge e : node.preds) { + if (reversedLinks.contains(e.link)) { + reversedUp.add(e.relativeTo); + } + } + + final int offset = X_OFFSET + DUMMY_WIDTH; + + int curX = 0; + int curWidth = node.width + reversedDown.size() * offset; + for (int pos : reversedDown) { + ArrayList reversedSuccs = new ArrayList(); + for (LayoutEdge e : node.succs) { + if (e.relativeFrom == pos && reversedLinks.contains(e.link)) { + reversedSuccs.add(e); + e.relativeFrom = curWidth; + } + } + + ArrayList startPoints = new ArrayList(); + startPoints.add(new Point(curWidth, curX)); + startPoints.add(new Point(pos, curX)); + startPoints.add(new Point(pos, reversedDown.size() * offset)); + for (LayoutEdge e : reversedSuccs) { + reversedLinkStartPoints.put(e.link, startPoints); + } + + node.inOffsets.put(pos, -curX); + curX += offset; + node.height += offset; + node.yOffset += offset; + curWidth -= offset; + } + node.width += reversedDown.size() * offset; + + if (reversedDown.size() == 0) { + curX = offset; + } else { + curX = -offset; + } + + curX = 0; + int minX = 0; + if (reversedDown.size() != 0) { + minX = -offset * reversedUp.size(); + } + + int oldNodeHeight = node.height; + for (int pos : reversedUp) { + ArrayList reversedPreds = new ArrayList(); + for (LayoutEdge e : node.preds) { + if (e.relativeTo == pos && reversedLinks.contains(e.link)) { + if (reversedDown.size() == 0) { + e.relativeTo = node.width + offset; + } else { + e.relativeTo = curX - offset; + } + + reversedPreds.add(e); + } + } + node.height += offset; + ArrayList endPoints = new ArrayList(); + + if (reversedDown.size() == 0) { + + curX += offset; + node.width += offset; + endPoints.add(new Point(node.width, node.height)); + + } else { + curX -= offset; + node.width += offset; + endPoints.add(new Point(curX, node.height)); + } + + node.outOffsets.put(pos - minX, curX); + curX += offset; + node.bottomYOffset += offset; + + + endPoints.add(new Point(pos, node.height)); + endPoints.add(new Point(pos, oldNodeHeight)); + for (LayoutEdge e : reversedPreds) { + reversedLinkEndPoints.put(e.link, endPoints); + } + } + + + if (minX < 0) { + for (LayoutEdge e : node.preds) { + e.relativeTo -= minX; + } + + for (LayoutEdge e : node.succs) { + e.relativeFrom -= minX; + } + + node.xOffset = -minX; + node.width += -minX; + } + } + + } + + private void DFS(LayoutNode startNode) { + if (visited.contains(startNode)) { + return; + } + + Stack stack = new Stack(); + stack.push(startNode); + + while (!stack.empty()) { + LayoutNode node = stack.pop(); + + if (visited.contains(node)) { + // Node no longer active + active.remove(node); + continue; + } + + // Repush immediately to know when no longer active + stack.push(node); + visited.add(node); + active.add(node); + + ArrayList succs = new ArrayList(node.succs); + for (LayoutEdge e : succs) { + if (active.contains(e.to)) { + assert visited.contains(e.to); + // Encountered back edge + reverseEdge(e); + } else if (!visited.contains(e.to) && (linksToFollow.size() == 0 || linksToFollow.contains(e.link))) { + stack.push(e.to); + } + } + } + } + + private void reverseAllInputs(LayoutNode node) { + for (LayoutEdge e : node.preds) { + assert !reversedLinks.contains(e.link); + reversedLinks.add(e.link); + node.succs.add(e); + e.from.preds.add(e); + e.from.succs.remove(e); + int oldRelativeFrom = e.relativeFrom; + int oldRelativeTo = e.relativeTo; + e.to = e.from; + e.from = node; + e.relativeFrom = oldRelativeTo; + e.relativeTo = oldRelativeFrom; + } + node.preds.clear(); + } + + private void reverseEdge(LayoutEdge e) { + assert !reversedLinks.contains(e.link); + reversedLinks.add(e.link); + + LayoutNode oldFrom = e.from; + LayoutNode oldTo = e.to; + int oldRelativeFrom = e.relativeFrom; + int oldRelativeTo = e.relativeTo; + + e.from = oldTo; + e.to = oldFrom; + e.relativeFrom = oldRelativeTo; + e.relativeTo = oldRelativeFrom; + + oldFrom.succs.remove(e); + oldFrom.preds.add(e); + oldTo.preds.remove(e); + oldTo.succs.add(e); + } + + @Override + public void postCheck() { + + for (LayoutNode n : nodes) { + + HashSet curVisited = new HashSet(); + Queue queue = new LinkedList(); + for (LayoutEdge e : n.succs) { + LayoutNode s = e.to; + queue.add(s); + curVisited.add(s); + } + + while (!queue.isEmpty()) { + LayoutNode curNode = queue.remove(); + + for (LayoutEdge e : curNode.succs) { + assert e.to != n; + if (!curVisited.contains(e.to)) { + queue.add(e.to); + curVisited.add(e.to); + } + } + } + } + } + } + private Comparator linkComparator = new Comparator() { + + public int compare(Link l1, Link l2) { + + int result = l1.getFrom().getVertex().compareTo(l2.getFrom().getVertex()); + if (result != 0) { + return result; + } + result = l1.getTo().getVertex().compareTo(l2.getTo().getVertex()); + if (result != 0) { + return result; + } + result = l1.getFrom().getRelativePosition().x - l2.getFrom().getRelativePosition().x; + if (result != 0) { + return result; + } + result = l1.getTo().getRelativePosition().x - l2.getTo().getRelativePosition().x; + return result; + } + }; + + private class BuildDatastructure extends AlgorithmPart { + + protected void run() { + // Set up nodes + List vertices = new ArrayList(graph.getVertices()); + Collections.sort(vertices); + + for (Vertex v : vertices) { + LayoutNode node = new LayoutNode(); + Dimension size = v.getSize(); + node.width = (int) size.getWidth(); + node.height = (int) size.getHeight(); + node.vertex = v; + nodes.add(node); + vertexToLayoutNode.put(v, node); + } + + // Set up edges + List links = new ArrayList(graph.getLinks()); + Collections.sort(links, linkComparator); + for (Link l : links) { + LayoutEdge edge = new LayoutEdge(); + assert vertexToLayoutNode.containsKey(l.getFrom().getVertex()); + assert vertexToLayoutNode.containsKey(l.getTo().getVertex()); + edge.from = vertexToLayoutNode.get(l.getFrom().getVertex()); + edge.to = vertexToLayoutNode.get(l.getTo().getVertex()); + edge.relativeFrom = l.getFrom().getRelativePosition().x; + edge.relativeTo = l.getTo().getRelativePosition().x; + edge.link = l; + edge.from.succs.add(edge); + edge.to.preds.add(edge); + //assert edge.from != edge.to; // No self-loops allowed + } + + for (Link l : importantLinks) { + if (!vertexToLayoutNode.containsKey(l.getFrom().getVertex()) || + vertexToLayoutNode.containsKey(l.getTo().getVertex())) { + continue; + } + LayoutNode from = vertexToLayoutNode.get(l.getFrom().getVertex()); + LayoutNode to = vertexToLayoutNode.get(l.getTo().getVertex()); + for (LayoutEdge e : from.succs) { + if (e.to == to) { + linksToFollow.add(e.link); + } + } + } + } + + @Override + public void postCheck() { + + assert vertexToLayoutNode.keySet().size() == nodes.size(); + assert nodes.size() == graph.getVertices().size(); + + for (Vertex v : graph.getVertices()) { + + LayoutNode node = vertexToLayoutNode.get(v); + assert node != null; + + for (LayoutEdge e : node.succs) { + assert e.from == node; + } + + for (LayoutEdge e : node.preds) { + assert e.to == node; + } + + } + } + } + + public void doRouting(LayoutGraph graph) { + // Do nothing for now + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/InterClusterConnection.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/InterClusterConnection.java new file mode 100644 index 00000000000..ef423ed753f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/InterClusterConnection.java @@ -0,0 +1,76 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import java.awt.Point; +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class InterClusterConnection implements Link { + + private Port inputSlot; + private Port outputSlot; + private List intermediatePoints; + private ClusterInputSlotNode inputSlotNode; + private ClusterOutputSlotNode outputSlotNode; + + public InterClusterConnection(ClusterOutputSlotNode outputSlotNode, ClusterInputSlotNode inputSlotNode) { + this.outputSlotNode = outputSlotNode; + this.inputSlotNode = inputSlotNode; + this.inputSlot = inputSlotNode.getInputSlot(); + this.outputSlot = outputSlotNode.getOutputSlot(); + intermediatePoints = new ArrayList(); + } + + public ClusterOutputSlotNode getOutputSlotNode() { + return outputSlotNode; + } + + public Port getTo() { + return inputSlot; + } + + public Port getFrom() { + return outputSlot; + } + + public void setControlPoints(List p) { + this.intermediatePoints = p; + } + + public List getControlPoints() { + return intermediatePoints; + } + + @Override + public String toString() { + return "InterClusterConnection[from=" + getFrom() + ", to=" + getTo() + "]"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Node.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Node.java new file mode 100644 index 00000000000..3d43e91be94 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Node.java @@ -0,0 +1,161 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class Node { + + private N data; + private List> inEdges; + private List> outEdges; + private boolean visited; + private boolean active; + private boolean reachable; + private Graph graph; + + protected boolean isVisited() { + return visited; + } + + protected void setVisited(boolean b) { + visited = b; + } + + protected boolean isReachable() { + return reachable; + } + + protected void setReachable(boolean b) { + reachable = b; + } + + protected boolean isActive() { + return active; + } + + protected void setActive(boolean b) { + active = b; + } + + public int getInDegree() { + return getInDegree(true); + } + + public int getInDegree(boolean countSelfLoops) { + if (countSelfLoops) { + return inEdges.size(); + } else { + int cnt = 0; + for (Edge e : inEdges) { + if (e.getSource() != this) { + cnt++; + } + } + return cnt; + } + } + + public int getOutDegree() { + return outEdges.size(); + } + + protected Node(Graph graph, N data) { + setData(data); + this.graph = graph; + inEdges = new ArrayList>(); + outEdges = new ArrayList>(); + } + + protected void addInEdge(Edge e) { + inEdges.add(e); + } + + public Graph getGraph() { + return graph; + } + + protected void addOutEdge(Edge e) { + outEdges.add(e); + } + + protected void removeInEdge(Edge e) { + //assert inEdges.contains(e); + inEdges.remove(e); + } + + protected void removeOutEdge(Edge e) { + //assert outEdges.contains(e); + outEdges.remove(e); + } + + public List> getInEdges() { + return Collections.unmodifiableList(inEdges); + } + + public List> getOutEdges() { + return Collections.unmodifiableList(outEdges); + } + + public List> getSuccessors() { + ArrayList> succ = new ArrayList>(); + for (Edge e : getOutEdges()) { + Node n = e.getDest(); + if (!succ.contains(n)) { + succ.add(n); + } + } + return succ; + } + + public List> getPredecessors() { + ArrayList> pred = new ArrayList>(); + for (Edge e : getInEdges()) { + Node n = e.getSource(); + if (!pred.contains(n)) { + pred.add(n); + } + } + return pred; + } + + public N getData() { + return data; + } + + public void setData(N d) { + data = d; + } + + @Override + public String toString() { + return "Node: " + data; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/OldHierarchicalLayoutManager.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/OldHierarchicalLayoutManager.java new file mode 100644 index 00000000000..5ed6c93afa1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/OldHierarchicalLayoutManager.java @@ -0,0 +1,1222 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +import java.awt.Point; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import com.sun.hotspot.igv.layout.LayoutGraph; +import com.sun.hotspot.igv.layout.LayoutManager; +import com.sun.hotspot.igv.layout.Link; +import com.sun.hotspot.igv.layout.Port; +import com.sun.hotspot.igv.layout.Vertex; + +/** + * + * @author Thomas Wuerthinger + */ +public class OldHierarchicalLayoutManager implements LayoutManager { + + public static final int DUMMY_WIDTH = 0; + public static final int DUMMY_HEIGHT = 0; + public static final int LAYER_OFFSET = 50; + public static final int OFFSET = 8; + public static final boolean VERTICAL_LAYOUT = true; + public static final boolean ASSERT = false; + public static final boolean TRACE = false; + public static final Timing initTiming = new Timing("init"); + public static final Timing removeCyclesTiming = new Timing("removeCycles"); + public static final Timing reversedEdgesTiming = new Timing("reversedEdges"); + public static final Timing assignLayersTiming = new Timing("assignLayers"); + public static final Timing dummyNodesTiming = new Timing("dummyNodes"); + public static final Timing crossingReductionTiming = new Timing("crossingReduction"); + public static final Timing assignCoordinatesTiming = new Timing("assignCoordinates"); + public static final Timing assignRealTiming = new Timing("assignReal"); + public static final Timing rootVertexTiming = new Timing("rootVertex"); + public static final Timing createEdgesTiming = new Timing("createEdges"); + public static final Timing optimizeMedianTiming = new Timing("optimizeMedian"); + private Combine combine; + + public enum Combine { + + NONE, + SAME_INPUTS, + SAME_OUTPUTS + } + + private class NodeData { + + private Map reversePositions; + private Vertex node; + private Link edge; + private int layer; + private int x; + private int y; + private int width; + + public NodeData(Vertex node) { + reversePositions = new HashMap(); + layer = -1; + this.node = node; + assert node != null; + + if (VERTICAL_LAYOUT) { + width = node.getSize().width; + } else { + width = node.getSize().height; + } + } + + public NodeData(Link edge) { + layer = -1; + this.edge = edge; + assert edge != null; + + if (VERTICAL_LAYOUT) { + width = DUMMY_WIDTH; + } else { + width = DUMMY_HEIGHT; + } + } + + public Vertex getNode() { + return node; + } + + public Link getEdge() { + return edge; + } + + public int getCoordinate() { + return x; + } + + public void setCoordinate(int x) { + this.x = x; + } + + public int getX() { + if (VERTICAL_LAYOUT) { + return x; + } else { + return y; + } + } + + public int getY() { + if (VERTICAL_LAYOUT) { + return y; + } else { + return x; + } + } + + public void setLayerCoordinate(int y) { + this.y = y; + } + + public void setLayer(int x) { + layer = x; + } + + public int getLayer() { + return layer; + } + + public boolean isDummy() { + return edge != null; + } + + public int getWidth() { + return width; + } + + public void addReversedStartEdge(Edge e) { + assert e.getData().isReversed(); + Port port = e.getData().getEdge().getTo(); + int pos = addReversedPort(port); + Point start = e.getData().getRelativeStart(); + e.getData().addStartPoint(start); + int yCoord = node.getSize().height + width - node.getSize().width; + e.getData().addStartPoint(new Point(start.x, yCoord)); + e.getData().addStartPoint(new Point(pos, yCoord)); + e.getData().setRelativeStart(new Point(pos, 0)); + } + + private int addReversedPort(Port p) { + if (reversePositions.containsKey(p)) { + return reversePositions.get(p); + } else { + width += OFFSET; + reversePositions.put(p, width); + return width; + } + } + + public void addReversedEndEdge(Edge e) { + assert e.getData().isReversed(); + int pos = addReversedPort(e.getData().getEdge().getFrom()); + Point end = e.getData().getRelativeEnd(); + e.getData().setRelativeEnd(new Point(pos, node.getSize().height)); + int yCoord = 0 - width + node.getSize().width; + e.getData().addEndPoint(new Point(pos, yCoord)); + e.getData().addEndPoint(new Point(end.x, yCoord)); + e.getData().addEndPoint(end); + } + + public int getHeight() { + if (isDummy()) { + if (VERTICAL_LAYOUT) { + return DUMMY_HEIGHT; + } else { + return DUMMY_WIDTH; + } + + } else { + if (VERTICAL_LAYOUT) { + return node.getSize().height; + } else { + return node.getSize().width; + } + } + } + + @Override + public String toString() { + if (isDummy()) { + return edge.toString() + "(layer=" + layer + ")"; + } else { + return node.toString() + "(layer=" + layer + ")"; + } + } + } + + private class EdgeData { + + private Point relativeEnd; + private Point relativeStart; + private List startPoints; + private List endPoints; + private boolean important; + private boolean reversed; + private Link edge; + + public EdgeData(Link edge) { + this(edge, false); + } + + public EdgeData(Link edge, boolean rev) { + this.edge = edge; + reversed = rev; + relativeStart = edge.getFrom().getRelativePosition(); + relativeEnd = edge.getTo().getRelativePosition(); + assert relativeStart.x >= 0 && relativeStart.x <= edge.getFrom().getVertex().getSize().width; + assert relativeStart.y >= 0 && relativeStart.y <= edge.getFrom().getVertex().getSize().height; + assert relativeEnd.x >= 0 && relativeEnd.x <= edge.getTo().getVertex().getSize().width; + assert relativeEnd.y >= 0 && relativeEnd.y <= edge.getTo().getVertex().getSize().height; + startPoints = new ArrayList(); + endPoints = new ArrayList(); + this.important = true; + } + + public boolean isImportant() { + return important; + } + + public void setImportant(boolean b) { + this.important = b; + } + + public List getStartPoints() { + return startPoints; + } + + public List getEndPoints() { + return endPoints; + } + + public List getAbsoluteEndPoints() { + if (endPoints.size() == 0) { + return endPoints; + } + + List result = new ArrayList(); + Point point = edge.getTo().getVertex().getPosition(); + for (Point p : endPoints) { + Point p2 = new Point(p.x + point.x, p.y + point.y); + result.add(p2); + } + + return result; + } + + public List getAbsoluteStartPoints() { + if (startPoints.size() == 0) { + return startPoints; + } + + List result = new ArrayList(); + Point point = edge.getFrom().getVertex().getPosition(); + for (Point p : startPoints) { + Point p2 = new Point(p.x + point.x, p.y + point.y); + result.add(p2); + } + + return result; + } + + public void addEndPoint(Point p) { + endPoints.add(p); + } + + public void addStartPoint(Point p) { + startPoints.add(p); + } + + public Link getEdge() { + return edge; + } + + public void setRelativeEnd(Point p) { + relativeEnd = p; + } + + public void setRelativeStart(Point p) { + relativeStart = p; + } + + public Point getRelativeEnd() { + return relativeEnd; + } + + public Point getRelativeStart() { + return relativeStart; + } + + public boolean isReversed() { + return reversed; + } + + public void setReversed(boolean b) { + reversed = b; + } + + @Override + public String toString() { + return "EdgeData[reversed=" + reversed + "]"; + } + } + private Graph graph; + private Map> nodeMap; + private int layerOffset; + + /** Creates a new instance of HierarchicalPositionManager */ + public OldHierarchicalLayoutManager(Combine combine) { + this(combine, LAYER_OFFSET); + } + + public OldHierarchicalLayoutManager(Combine combine, int layerOffset) { + this.combine = combine; + this.layerOffset = layerOffset; + } + + public void doRouting(LayoutGraph graph) { + } + + //public void setPositions(PositionedNode rootNode, List nodes, List edges) { + public void doLayout(LayoutGraph layoutGraph) { + doLayout(layoutGraph, new HashSet(), new HashSet()); + } + + public void doLayout(LayoutGraph layoutGraph, Set firstLayerHint, Set lastLayerHint) { + doLayout(layoutGraph, firstLayerHint, lastLayerHint, new HashSet()); + } + + public void doLayout(LayoutGraph layoutGraph, Set firstLayerHint, Set lastLayerHint, Set importantLinksHint) { + + if (TRACE) { + System.out.println("HierarchicalPositionManager.doLayout called"); + System.out.println("Vertex count = " + layoutGraph.getVertices().size() + " Link count = " + layoutGraph.getLinks().size()); + } + + // Nothing to do => quit immediately + if (layoutGraph.getVertices().size() == 0) { + return; + } + + initTiming.start(); + + // Mapping vertex to Node in graph + nodeMap = new HashMap>(); + + graph = new Graph(); + + Set> rootNodes = new HashSet>(); + Set startRootVertices = new HashSet(); + + for (Vertex v : layoutGraph.getVertices()) { + if (v.isRoot()) { + startRootVertices.add(v); + } + } + + rootVertexTiming.start(); + Set rootVertices = layoutGraph.findRootVertices(startRootVertices); + rootVertexTiming.stop(); + + + for (Vertex node : layoutGraph.getVertices()) { + + NodeData data = new NodeData(node); + Node n = graph.createNode(data, node); + nodeMap.put(node, n); + + if (rootVertices.contains(node)) { + rootNodes.add(n); + } + } + + Set links = layoutGraph.getLinks(); + Link[] linkArr = new Link[links.size()]; + links.toArray(linkArr); + + List linkList = new ArrayList(); + for (Link l : linkArr) { + linkList.add(l); + } + + createEdgesTiming.start(); + Collections.sort(linkList, new Comparator() { + + public int compare(Link o1, Link o2) { + int result = o1.getFrom().getVertex().compareTo(o2.getFrom().getVertex()); + if (result == 0) { + return o1.getTo().getVertex().compareTo(o2.getTo().getVertex()); + } else { + return result; + } + } + }); + + for (Link edge : linkList) { + EdgeData data = new EdgeData(edge); + graph.createEdge(graph.getNode(edge.getFrom().getVertex()), graph.getNode(edge.getTo().getVertex()), data, data); + if (importantLinksHint.size() > 0 && !importantLinksHint.contains(edge)) { + data.setImportant(false); + } + } + createEdgesTiming.stop(); + + initTiming.stop(); + + removeCyclesTiming.start(); + + // STEP 1: Remove cycles! + removeCycles(rootNodes); + if (ASSERT) { + assert checkRemoveCycles(); + } + + removeCyclesTiming.stop(); + + reversedEdgesTiming.start(); + + for (Node n : graph.getNodes()) { + List> edges = new ArrayList>(n.getOutEdges()); + Collections.sort(edges, new Comparator>() { + + public int compare(Edge o1, Edge o2) { + return o2.getData().getRelativeEnd().x - o1.getData().getRelativeEnd().x; + } + }); + + + for (Edge e : edges) { + + if (e.getData().isReversed()) { + e.getSource().getData().addReversedEndEdge(e); + } + } + } + + for (Node n : graph.getNodes()) { + List> edges = new ArrayList>(n.getInEdges()); + Collections.sort(edges, new Comparator>() { + + public int compare(Edge o1, Edge o2) { + return o2.getData().getRelativeStart().x - o1.getData().getRelativeStart().x; + } + }); + + + for (Edge e : edges) { + if (e.getData().isReversed()) { + e.getDest().getData().addReversedStartEdge(e); + } + } + } + + reversedEdgesTiming.stop(); + + assignLayersTiming.start(); + // STEP 2: Assign layers! + int maxLayer = assignLayers(rootNodes, firstLayerHint, lastLayerHint); + if (ASSERT) { + assert checkAssignLayers(); + } + + // Put into layer array + //int maxLayer = 0; + //for(Node n : graph.getNodes()) { + // maxLayer = Math.max(maxLayer, n.getData().getLayer()); + //} + + + ArrayList> layers[] = new ArrayList[maxLayer + 1]; + int layerSizes[] = new int[maxLayer + 1]; + for (int i = 0; i < maxLayer + 1; i++) { + layers[i] = new ArrayList>(); + } + + for (Node n : graph.getNodes()) { + int curLayer = n.getData().getLayer(); + layers[curLayer].add(n); + } + + assignLayersTiming.stop(); + + // STEP 3: Insert dummy nodes! + dummyNodesTiming.start(); + insertDummyNodes(layers); + if (ASSERT) { + assert checkDummyNodes(); + } + dummyNodesTiming.stop(); + + crossingReductionTiming.start(); + // STEP 4: Assign Y coordinates + assignLayerCoordinates(layers, layerSizes); + + // STEP 5: Crossing reduction + crossingReduction(layers); + crossingReductionTiming.stop(); + + // STEP 6: Assign Y coordinates + assignCoordinatesTiming.start(); + assignCoordinates(layers); + assignCoordinatesTiming.stop(); + + assignRealTiming.start(); + + // Assign coordinates of nodes to real objects + for (Node n : graph.getNodes()) { + if (!n.getData().isDummy()) { + + Vertex node = n.getData().getNode(); + node.setPosition(new Point(n.getData().getX(), n.getData().getY())); + } + } + + for (Node n : graph.getNodes()) { + if (!n.getData().isDummy()) { + + Vertex node = n.getData().getNode(); + + List> outEdges = n.getOutEdges(); + for (Edge e : outEdges) { + Node succ = e.getDest(); + if (succ.getData().isDummy()) { + //PositionedEdge edge = succ.getData().getEdge(); + List points = new ArrayList(); + assignToRealObjects(layerSizes, succ, points); + } else { + List points = new ArrayList(); + + EdgeData otherEdgeData = e.getData(); + points.addAll(otherEdgeData.getAbsoluteStartPoints()); + Link otherEdge = otherEdgeData.getEdge(); + Point relFrom = new Point(otherEdgeData.getRelativeStart()); + Point from = otherEdge.getFrom().getVertex().getPosition(); + relFrom.move(relFrom.x + from.x, relFrom.y + from.y); + points.add(relFrom); + + Point relTo = new Point(otherEdgeData.getRelativeEnd()); + Point to = otherEdge.getTo().getVertex().getPosition(); + relTo.move(relTo.x + to.x, relTo.y + to.y); + assert from != null; + assert to != null; + points.add(relTo); + points.addAll(otherEdgeData.getAbsoluteEndPoints()); + e.getData().getEdge().setControlPoints(points); + } + } + } + } + + assignRealTiming.stop(); + + initTiming.print(); + removeCyclesTiming.print(); + reversedEdgesTiming.print(); + assignLayersTiming.print(); + dummyNodesTiming.print(); + crossingReductionTiming.print(); + assignCoordinatesTiming.print(); + assignRealTiming.print(); + rootVertexTiming.print(); + createEdgesTiming.print(); + optimizeMedianTiming.print(); + } + + public boolean onOneLine(Point p1, Point p2, Point p3) { + int xoff1 = p1.x - p2.x; + int yoff1 = p1.y - p2.y; + int xoff2 = p3.x - p2.x; + int yoff2 = p3.y - p2.x; + + return (xoff1 * yoff2 - yoff1 * xoff2 == 0); + } + + private void assignToRealObjects(int layerSizes[], Node cur, List points) { + assert cur.getData().isDummy(); + + ArrayList otherPoints = new ArrayList(points); + + int size = layerSizes[cur.getData().getLayer()]; + otherPoints.add(new Point(cur.getData().getX(), cur.getData().getY() - size / 2)); + if (otherPoints.size() >= 3 && onOneLine(otherPoints.get(otherPoints.size() - 1), otherPoints.get(otherPoints.size() - 2), otherPoints.get(otherPoints.size() - 3))) { + otherPoints.remove(otherPoints.size() - 2); + } + otherPoints.add(new Point(cur.getData().getX(), cur.getData().getY() + size / 2)); + if (otherPoints.size() >= 3 && onOneLine(otherPoints.get(otherPoints.size() - 1), otherPoints.get(otherPoints.size() - 2), otherPoints.get(otherPoints.size() - 3))) { + otherPoints.remove(otherPoints.size() - 2); + } + + for (int i = 0; i < cur.getOutEdges().size(); i++) { + Node otherSucc = cur.getOutEdges().get(i).getDest(); + + if (otherSucc.getData().isDummy()) { + assignToRealObjects(layerSizes, otherSucc, otherPoints); + } else { + EdgeData otherEdgeData = cur.getOutEdges().get(i).getData(); + Link otherEdge = otherEdgeData.getEdge(); + + List middlePoints = new ArrayList(otherPoints); + if (cur.getOutEdges().get(i).getData().isReversed()) { + Collections.reverse(middlePoints); + } + + ArrayList copy = new ArrayList(); + Point relFrom = new Point(otherEdgeData.getRelativeStart()); + Point from = otherEdge.getFrom().getVertex().getPosition(); + //int moveUp = (size - otherEdge.getFrom().getVertex().getSize().height) / 2; + relFrom.move(relFrom.x + from.x, relFrom.y + from.y); + copy.addAll(otherEdgeData.getAbsoluteStartPoints()); + copy.add(relFrom); + copy.addAll(middlePoints); + + Point relTo = new Point(otherEdgeData.getRelativeEnd()); + Point to = otherEdge.getTo().getVertex().getPosition(); + relTo.move(relTo.x + to.x, relTo.y + to.y); + copy.add(relTo); + + copy.addAll(otherEdgeData.getAbsoluteEndPoints()); + + + otherEdge.setControlPoints(copy); + } + } + } + + private boolean checkDummyNodes() { + for (Edge e : graph.getEdges()) { + if (e.getSource().getData().getLayer() != e.getDest().getData().getLayer() - 1) { + return false; + } + } + + return true; + } + + private void insertDummyNodes(ArrayList> layers[]) { + + int sum = 0; + List> nodes = new ArrayList>(graph.getNodes()); + int edgeCount = 0; + int innerMostLoop = 0; + + for (Node n : nodes) { + List> edges = new ArrayList>(n.getOutEdges()); + for (Edge e : edges) { + + edgeCount++; + Link edge = e.getData().getEdge(); + Node destNode = e.getDest(); + Node lastNode = n; + Edge lastEdge = e; + + boolean searchForNode = (combine != Combine.NONE); + for (int i = n.getData().getLayer() + 1; i < destNode.getData().getLayer(); i++) { + + Node foundNode = null; + if (searchForNode) { + for (Node sameLayerNode : layers[i]) { + innerMostLoop++; + + if (combine == Combine.SAME_OUTPUTS) { + if (sameLayerNode.getData().isDummy() && sameLayerNode.getData().getEdge().getFrom() == edge.getFrom()) { + foundNode = sameLayerNode; + break; + } + } else if (combine == Combine.SAME_INPUTS) { + if (sameLayerNode.getData().isDummy() && sameLayerNode.getData().getEdge().getTo() == edge.getTo()) { + foundNode = sameLayerNode; + break; + } + } + } + } + + if (foundNode == null) { + searchForNode = false; + NodeData intermediateData = new NodeData(edge); + Node curNode = graph.createNode(intermediateData, null); + curNode.getData().setLayer(i); + layers[i].add(0, curNode); + sum++; + lastEdge.remove(); + graph.createEdge(lastNode, curNode, e.getData(), null); + assert lastNode.getData().getLayer() == curNode.getData().getLayer() - 1; + lastEdge = graph.createEdge(curNode, destNode, e.getData(), null); + lastNode = curNode; + } else { + lastEdge.remove(); + lastEdge = graph.createEdge(foundNode, destNode, e.getData(), null); + lastNode = foundNode; + } + + } + } + } + + if (TRACE) { + System.out.println("Number of edges: " + edgeCount); + } + if (TRACE) { + System.out.println("Dummy nodes inserted: " + sum); + } + } + + private void assignLayerCoordinates(ArrayList> layers[], int layerSizes[]) { + int cur = 0; + for (int i = 0; i < layers.length; i++) { + int maxHeight = 0; + for (Node n : layers[i]) { + maxHeight = Math.max(maxHeight, n.getData().getHeight()); + } + + layerSizes[i] = maxHeight; + for (Node n : layers[i]) { + int curCoordinate = cur + (maxHeight - n.getData().getHeight()) / 2; + n.getData().setLayerCoordinate(curCoordinate); + } + cur += maxHeight + layerOffset; + + } + } + + private void assignCoordinates(ArrayList> layers[]) { + + // TODO: change this + for (int i = 0; i < layers.length; i++) { + ArrayList> curArray = layers[i]; + int curY = 0; + for (Node n : curArray) { + + n.getData().setCoordinate(curY); + if (!n.getData().isDummy()) { + curY += n.getData().getWidth(); + } + curY += OFFSET; + + } + } + + int curSol = evaluateSolution(); + if (TRACE) { + System.out.println("First coordinate solution found: " + curSol); + } + + // Sort to correct order + for (int i = 0; i < layers.length; i++) { + Collections.sort(layers[i], new Comparator>() { + + public int compare(Node o1, Node o2) { + if (o2.getData().isDummy()) { + return 1; + } else if (o1.getData().isDummy()) { + return -1; + } + return o2.getInEdges().size() + o2.getOutEdges().size() - o1.getInEdges().size() - o1.getOutEdges().size(); + } + }); + } + + + optimizeMedianTiming.start(); + for (int i = 0; i < 2; i++) { + optimizeMedian(layers); + curSol = evaluateSolution(); + if (TRACE) { + System.out.println("Current coordinate solution found: " + curSol); + } + } + optimizeMedianTiming.stop(); + normalizeCoordinate(); + + } + + private void normalizeCoordinate() { + + int min = Integer.MAX_VALUE; + for (Node n : graph.getNodes()) { + min = Math.min(min, n.getData().getCoordinate()); + } + + for (Node n : graph.getNodes()) { + n.getData().setCoordinate(n.getData().getCoordinate() - min); + } + + } + + private void optimizeMedian(ArrayList> layers[]) { + + // Downsweep + for (int i = 1; i < layers.length; i++) { + + ArrayList> processingList = layers[i]; + ArrayList> alreadyAssigned = new ArrayList>(); + for (Node n : processingList) { + + + ArrayList> preds = new ArrayList>(n.getPredecessors()); + int pos = n.getData().getCoordinate(); + if (preds.size() > 0) { + + Collections.sort(preds, new Comparator>() { + + public int compare(Node o1, Node o2) { + return o1.getData().getCoordinate() - o2.getData().getCoordinate(); + } + }); + + if (preds.size() % 2 == 0) { + assert preds.size() >= 2; + pos = (preds.get(preds.size() / 2).getData().getCoordinate() - calcRelativeCoordinate(preds.get(preds.size() / 2), n) + preds.get(preds.size() / 2 - 1).getData().getCoordinate() - calcRelativeCoordinate(preds.get(preds.size() / 2 - 1), n)) / 2; + } else { + assert preds.size() >= 1; + pos = preds.get(preds.size() / 2).getData().getCoordinate() - calcRelativeCoordinate(preds.get(preds.size() / 2), n); + } + } + + tryAdding(alreadyAssigned, n, pos); + } + } + // Upsweep + for (int i = layers.length - 2; i >= 0; i--) { + ArrayList> processingList = layers[i]; + ArrayList> alreadyAssigned = new ArrayList>(); + for (Node n : processingList) { + + ArrayList> succs = new ArrayList>(n.getSuccessors()); + int pos = n.getData().getCoordinate(); + if (succs.size() > 0) { + + Collections.sort(succs, new Comparator>() { + + public int compare(Node o1, Node o2) { + return o1.getData().getCoordinate() - o2.getData().getCoordinate(); + } + }); + + if (succs.size() % 2 == 0) { + assert succs.size() >= 2; + pos = (succs.get(succs.size() / 2).getData().getCoordinate() - calcRelativeCoordinate(n, succs.get(succs.size() / 2)) + succs.get(succs.size() / 2 - 1).getData().getCoordinate() - calcRelativeCoordinate(n, succs.get(succs.size() / 2 - 1))) / 2; + } else { + assert succs.size() >= 1; + pos = succs.get(succs.size() / 2).getData().getCoordinate() - calcRelativeCoordinate(n, succs.get(succs.size() / 2)); + } + } + + tryAdding(alreadyAssigned, n, pos); + } + } + } + + private int median(ArrayList arr) { + assert arr.size() > 0; + Collections.sort(arr); + if (arr.size() % 2 == 0) { + return (arr.get(arr.size() / 2) + arr.get(arr.size() / 2 - 1)) / 2; + } else { + return arr.get(arr.size() / 2); + } + } + + private int calcRelativeCoordinate(Node n, Node succ) { + + if (n.getData().isDummy() && succ.getData().isDummy()) { + return 0; + } + + int pos = 0; + int pos2 = 0; + ArrayList coords2 = new ArrayList(); + ArrayList coords = new ArrayList(); + /*if(!n.getData().isDummy())*/ { + for (Edge e : n.getOutEdges()) { + + //System.out.println("reversed: " + e.getData().isReversed()); + if (e.getDest() == succ) { + + if (e.getData().isReversed()) { + if (!n.getData().isDummy()) { + coords.add(e.getData().getRelativeEnd().x); + } + + if (!succ.getData().isDummy()) { + coords2.add(e.getData().getRelativeStart().x); + } + } else { + if (!n.getData().isDummy()) { + coords.add(e.getData().getRelativeStart().x); + } + + if (!succ.getData().isDummy()) { + coords2.add(e.getData().getRelativeEnd().x); + } + } + } + } + + // assert coords.size() > 0; + if (!n.getData().isDummy()) { + pos = median(coords); + } + + if (!succ.getData().isDummy()) { + pos2 = median(coords2); + } + } + //System.out.println("coords=" + coords); + //System.out.println("coords2=" + coords2); + + return pos - pos2; + } + + private boolean intersect(int v1, int w1, int v2, int w2) { + if (v1 >= v2 && v1 < v2 + w2) { + return true; + } + if (v1 + w1 > v2 && v1 + w1 < v2 + w2) { + return true; + } + if (v1 < v2 && v1 + w1 > v2) { + return true; + } + return false; + } + + private boolean intersect(Node n1, Node n2) { + return intersect(n1.getData().getCoordinate(), n1.getData().getWidth() + OFFSET, n2.getData().getCoordinate(), n2.getData().getWidth() + OFFSET); + } + + private void tryAdding(List> alreadyAssigned, Node node, int pos) { + + boolean doesIntersect = false; + node.getData().setCoordinate(pos); + for (Node n : alreadyAssigned) { + if (n.getData().getCoordinate() + n.getData().getWidth() < pos) { + break; + } else if (intersect(node, n)) { + doesIntersect = true; + break; + } + + } + + if (!doesIntersect) { + + // Everything fine, just place the node + int z = 0; + for (Node n : alreadyAssigned) { + if (pos > n.getData().getCoordinate()) { + break; + } + z++; + } + + if (z == -1) { + z = alreadyAssigned.size(); + } + + + if (ASSERT) { + assert !findOverlap(alreadyAssigned, node); + } + alreadyAssigned.add(z, node); + + } else { + + assert alreadyAssigned.size() > 0; + + // Search for alternative location + int minOffset = Integer.MAX_VALUE; + int minIndex = -1; + int minPos = 0; + int w = node.getData().getWidth() + OFFSET; + + // Try top-most + minIndex = 0; + minPos = alreadyAssigned.get(0).getData().getCoordinate() + alreadyAssigned.get(0).getData().getWidth() + OFFSET; + minOffset = Math.abs(minPos - pos); + + // Try bottom-most + Node lastNode = alreadyAssigned.get(alreadyAssigned.size() - 1); + int lastPos = lastNode.getData().getCoordinate() - w; + int lastOffset = Math.abs(lastPos - pos); + if (lastOffset < minOffset) { + minPos = lastPos; + minOffset = lastOffset; + minIndex = alreadyAssigned.size(); + } + + // Try between + for (int i = 0; i < alreadyAssigned.size() - 1; i++) { + Node curNode = alreadyAssigned.get(i); + Node nextNode = alreadyAssigned.get(i + 1); + + int start = nextNode.getData().getCoordinate() + nextNode.getData().getWidth() + OFFSET; + int end = curNode.getData().getCoordinate() - OFFSET; + + int bestPoss = end - node.getData().getWidth(); + if (bestPoss < pos && pos - bestPoss > minOffset) { + // No better solution possible => break + break; + } + + if (end - start >= node.getData().getWidth()) { + // Node could fit here + int cand1 = start; + int cand2 = end - node.getData().getWidth(); + int off1 = Math.abs(cand1 - pos); + int off2 = Math.abs(cand2 - pos); + if (off1 < minOffset) { + minPos = cand1; + minOffset = off1; + minIndex = i + 1; + } + + if (off2 < minOffset) { + minPos = cand2; + minOffset = off2; + minIndex = i + 1; + } + } + } + + assert minIndex != -1; + node.getData().setCoordinate(minPos); + if (ASSERT) { + assert !findOverlap(alreadyAssigned, node); + } + alreadyAssigned.add(minIndex, node); + } + + } + + private boolean findOverlap(List> nodes, Node node) { + + for (Node n1 : nodes) { + if (intersect(n1, node)) { + return true; + } + } + + return false; + } + + private int evaluateSolution() { + + int sum = 0; + for (Edge e : graph.getEdges()) { + Node source = e.getSource(); + Node dest = e.getDest(); + int offset = 0; + offset = Math.abs(source.getData().getCoordinate() - dest.getData().getCoordinate()); + sum += offset; + } + + return sum; + } + + private void crossingReduction(ArrayList> layers[]) { + + for (int i = 0; i < layers.length - 1; i++) { + + ArrayList> curNodes = layers[i]; + ArrayList> nextNodes = layers[i + 1]; + for (Node n : curNodes) { + for (Node succ : n.getSuccessors()) { + if (ASSERT) { + assert nextNodes.contains(succ); + } + nextNodes.remove(succ); + nextNodes.add(succ); + } + } + + } + + } + + private void removeCycles(Set> rootNodes) { + final List> reversedEdges = new ArrayList>(); + + + int removedCount = 0; + int reversedCount = 0; + + Graph.DFSTraversalVisitor visitor = graph.new DFSTraversalVisitor() { + + @Override + public boolean visitEdge(Edge e, boolean backEdge) { + if (backEdge) { + if (ASSERT) { + assert !reversedEdges.contains(e); + } + reversedEdges.add(e); + e.getData().setReversed(!e.getData().isReversed()); + } + + return e.getData().isImportant(); + } + }; + Set> nodes = new HashSet>(); + nodes.addAll(rootNodes); + + assert nodes.size() > 0; + + this.graph.traverseDFS(nodes, visitor); + + for (Edge e : reversedEdges) { + if (e.isSelfLoop()) { + e.remove(); + removedCount++; + } else { + e.reverse(); + reversedCount++; + } + } + } + + private boolean checkRemoveCycles() { + return !graph.hasCycles(); + } + // Only used by assignLayers + private int maxLayerTemp; + + private int assignLayers(Set> rootNodes, Set firstLayerHints, + Set lastLayerHints) { + this.maxLayerTemp = -1; + for (Node n : graph.getNodes()) { + n.getData().setLayer(-1); + } + + Graph.BFSTraversalVisitor traverser = graph.new BFSTraversalVisitor() { + + @Override + public void visitNode(Node n, int depth) { + if (depth > n.getData().getLayer()) { + n.getData().setLayer(depth); + maxLayerTemp = Math.max(maxLayerTemp, depth); + } + } + }; + + for (Node n : rootNodes) { + if (n.getData().getLayer() == -1) { + this.graph.traverseBFS(n, traverser, true); + } + } + + for (Vertex v : firstLayerHints) { + assert nodeMap.containsKey(v); + nodeMap.get(v).getData().setLayer(0); + } + + for (Vertex v : lastLayerHints) { + assert nodeMap.containsKey(v); + nodeMap.get(v).getData().setLayer(maxLayerTemp); + } + + return maxLayerTemp; + } + + private boolean checkAssignLayers() { + + for (Edge e : graph.getEdges()) { + Node source = e.getSource(); + Node dest = e.getDest(); + + + if (source.getData().getLayer() >= dest.getData().getLayer()) { + return false; + } + } + int maxLayer = 0; + for (Node n : graph.getNodes()) { + assert n.getData().getLayer() >= 0; + if (n.getData().getLayer() > maxLayer) { + maxLayer = n.getData().getLayer(); + } + } + + int countPerLayer[] = new int[maxLayer + 1]; + for (Node n : graph.getNodes()) { + countPerLayer[n.getData().getLayer()]++; + } + + if (TRACE) { + System.out.println("Number of layers: " + maxLayer); + } + return true; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Timing.java b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Timing.java new file mode 100644 index 00000000000..fe6cd28f2a0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/HierarchicalLayout/src/com/sun/hotspot/igv/hierarchicallayout/Timing.java @@ -0,0 +1,67 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.hierarchicallayout; + +/** + * + * @author Thomas Wuerthinger + */ +public class Timing { + + private long lastValue; + private long sum; + private String name; + + public Timing(String name) { + this.name = name; + } + + @Override + public String toString() { + long val = sum; + if (lastValue != 0) { + // Timer running + long newValue = System.nanoTime(); + val += (newValue - lastValue); + } + return "Timing for " + name + " is: " + val / 1000000 + " ms"; + } + + public void print() { + System.out.println(toString()); + } + + public void start() { + lastValue = System.nanoTime(); + } + + public void stop() { + if (lastValue == 0) { + throw new IllegalStateException("You must call start before stop"); + } + long newValue = System.nanoTime(); + sum += newValue - lastValue; + lastValue = 0; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/build.xml new file mode 100644 index 00000000000..002f9bcc3e8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.layout. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/manifest.mf new file mode 100644 index 00000000000..eafc2369dc6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.layout +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/layout/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/build-impl.xml new file mode 100644 index 00000000000..84413d25676 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/genfiles.properties new file mode 100644 index 00000000000..f054d11726d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=cb0889d9 +build.xml.script.CRC32=d65fccb9 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=cb0889d9 +nbproject/build-impl.xml.script.CRC32=7f82736d +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.xml new file mode 100644 index 00000000000..edd56a5bc66 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/project.xml @@ -0,0 +1,14 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.layout + + + + com.sun.hotspot.igv.layout + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Bundle.properties new file mode 100644 index 00000000000..578627a2b9e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=Layout diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Cluster.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Cluster.java new file mode 100644 index 00000000000..a4bfda5fdff --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Cluster.java @@ -0,0 +1,42 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.awt.Rectangle; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Cluster extends Comparable { + + public Cluster getOuter(); + + public void setBounds(Rectangle r); + + public Set getSuccessors(); + + public Set getPredecessors(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java new file mode 100644 index 00000000000..ac262c95e74 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutGraph.java @@ -0,0 +1,202 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +/** + * + * @author Thomas Wuerthinger + */ +public class LayoutGraph { + + private Set links; + private SortedSet vertices; + private Hashtable> inputPorts; + private Hashtable> outputPorts; + private Hashtable> portLinks; + + public LayoutGraph(Set links) { + this(links, new HashSet()); + } + + public LayoutGraph(Set links, Set additionalVertices) { + this.links = links; + assert verify(); + + vertices = new TreeSet(); + portLinks = new Hashtable>(); + inputPorts = new Hashtable>(); + outputPorts = new Hashtable>(); + + for (Link l : links) { + Port p = l.getFrom(); + Port p2 = l.getTo(); + Vertex v1 = p.getVertex(); + Vertex v2 = p2.getVertex(); + + if (!vertices.contains(v1)) { + + outputPorts.put(v1, new HashSet(1)); + inputPorts.put(v1, new HashSet(3)); + vertices.add(v1); + assert vertices.contains(v1); + } + + if (!vertices.contains(v2)) { + vertices.add(v2); + assert vertices.contains(v2); + outputPorts.put(v2, new HashSet(1)); + inputPorts.put(v2, new HashSet(3)); + } + + if (!portLinks.containsKey(p)) { + HashSet hashSet = new HashSet(3); + portLinks.put(p, hashSet); + } + + if (!portLinks.containsKey(p2)) { + portLinks.put(p2, new HashSet(3)); + } + + outputPorts.get(v1).add(p); + inputPorts.get(v2).add(p2); + + portLinks.get(p).add(l); + portLinks.get(p2).add(l); + } + + for (Vertex v : additionalVertices) { + if (!vertices.contains(v)) { + outputPorts.put(v, new HashSet(1)); + inputPorts.put(v, new HashSet(3)); + vertices.add(v); + vertices.contains(v); + } + } + } + + public Set getInputPorts(Vertex v) { + return this.inputPorts.get(v); + } + + public Set getOutputPorts(Vertex v) { + return this.outputPorts.get(v); + } + + public Set getPortLinks(Port p) { + return portLinks.get(p); + } + + public Set getLinks() { + return links; + } + + public boolean verify() { + return true; + } + + public SortedSet getVertices() { + return vertices; + } + + private void markNotRoot(Set notRootSet, Vertex v, Vertex startingVertex) { + + if (notRootSet.contains(v)) { + return; + } + if (v != startingVertex) { + notRootSet.add(v); + } + Set outPorts = getOutputPorts(v); + for (Port p : outPorts) { + Set portLinks = getPortLinks(p); + for (Link l : portLinks) { + Port other = l.getTo(); + Vertex otherVertex = other.getVertex(); + if (otherVertex != startingVertex) { + markNotRoot(notRootSet, otherVertex, startingVertex); + } + } + } + } + + // Returns a set of vertices with the following properties: + // - All Vertices in the set startingRoots are elements of the set. + // - When starting a DFS at every vertex in the set, every vertex of the + // whole graph is visited. + public Set findRootVertices(Set startingRoots) { + + Set notRootSet = new HashSet(); + for (Vertex v : startingRoots) { + if (!notRootSet.contains(v)) { + markNotRoot(notRootSet, v, v); + } + } + + Set tmpVertices = getVertices(); + for (Vertex v : tmpVertices) { + if (!notRootSet.contains(v)) { + if (this.getInputPorts(v).size() == 0) { + markNotRoot(notRootSet, v, v); + } + } + } + + for (Vertex v : tmpVertices) { + if (!notRootSet.contains(v)) { + markNotRoot(notRootSet, v, v); + } + } + + Set result = new HashSet(); + for (Vertex v : tmpVertices) { + if (!notRootSet.contains(v)) { + result.add(v); + } + } + assert tmpVertices.size() == 0 || result.size() > 0; + return result; + } + + public Set findRootVertices() { + return findRootVertices(new HashSet()); + } + + public SortedSet getClusters() { + + SortedSet clusters = new TreeSet(); + for (Vertex v : getVertices()) { + if (v.getCluster() != null) { + clusters.add(v.getCluster()); + } + } + + return clusters; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutManager.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutManager.java new file mode 100644 index 00000000000..25d0a5eb913 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/LayoutManager.java @@ -0,0 +1,39 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public interface LayoutManager { + + public void doLayout(LayoutGraph graph); + + public void doLayout(LayoutGraph graph, Set firstLayerHint, Set lastLayerHint, Set importantLinks); + + public void doRouting(LayoutGraph graph); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Link.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Link.java new file mode 100644 index 00000000000..b885d4823a4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Link.java @@ -0,0 +1,42 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.awt.Point; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Link { + + public Port getFrom(); + + public Port getTo(); + + public List getControlPoints(); + + public void setControlPoints(List list); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Port.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Port.java new file mode 100644 index 00000000000..0bfe394aa83 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Port.java @@ -0,0 +1,37 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.awt.Point; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Port { + + public Vertex getVertex(); + + public Point getRelativePosition(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Vertex.java b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Vertex.java new file mode 100644 index 00000000000..3a6020b3b9f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Layout/src/com/sun/hotspot/igv/layout/Vertex.java @@ -0,0 +1,44 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.layout; + +import java.awt.Dimension; +import java.awt.Point; + +/** + * + * @author Thomas Wuerthinger + */ +public interface Vertex extends Comparable { + + public Cluster getCluster(); + + public Dimension getSize(); + + public Point getPosition(); + + public void setPosition(Point p); + + public boolean isRoot(); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/build.xml new file mode 100644 index 00000000000..4565a3d6402 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.connection. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/manifest.mf new file mode 100644 index 00000000000..791c20daf71 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.connection +OpenIDE-Module-Layer: com/sun/hotspot/igv/connection/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/connection/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/build-impl.xml new file mode 100644 index 00000000000..5e1c4139d0f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/genfiles.properties new file mode 100644 index 00000000000..0897ad916a4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f8e21cb6 +build.xml.script.CRC32=a265137e +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f8e21cb6 +nbproject/build-impl.xml.script.CRC32=36f3138c +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.xml new file mode 100644 index 00000000000..5edaba9763b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/project.xml @@ -0,0 +1,55 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.connection + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.settings + + + + 1.0 + + + + org.openide.awt + + + + 6.11.1.1 + + + + org.openide.dialogs + + + + 7.5.1 + + + + org.openide.util + + + + 7.10.1.1 + + + + + com.sun.hotspot.igv.connection + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupReceiver b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupReceiver new file mode 100644 index 00000000000..62561a6709f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupReceiver @@ -0,0 +1 @@ +com.sun.hotspot.igv.connection.Server \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Bundle.properties new file mode 100644 index 00000000000..6cbad75a668 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=NetworkConnection diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Client.java b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Client.java new file mode 100644 index 00000000000..a16c2eced3b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Client.java @@ -0,0 +1,96 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.connection; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupCallback; +import com.sun.hotspot.igv.data.serialization.Parser; +import com.sun.hotspot.igv.data.Properties.RegexpPropertyMatcher; +import java.io.IOException; +import java.io.InputStream; +import java.net.Socket; +import javax.swing.JTextField; +import org.openide.util.Exceptions; +import org.openide.xml.XMLUtil; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +/** + * + * @author Thomas Wuerthinger + */ +public class Client implements Runnable, GroupCallback { + + private Socket socket; + private JTextField networkTextField; + private GroupCallback callback; + + public Client(Socket socket, JTextField networkTextField, GroupCallback callback) { + this.callback = callback; + this.socket = socket; + this.networkTextField = networkTextField; + } + + public void run() { + + try { + InputStream inputStream = socket.getInputStream(); + + if (networkTextField.isEnabled()) { + + socket.getOutputStream().write('y'); + InputSource is = new InputSource(inputStream); + + try { + XMLReader reader = XMLUtil.createXMLReader(); + Parser parser = new Parser(this); + parser.parse(reader, is, null); + } catch (SAXException ex) { + ex.printStackTrace(); + } + } else { + socket.getOutputStream().write('n'); + } + + socket.close(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + + public void started(final Group g) { + try { + RegexpPropertyMatcher matcher = new RegexpPropertyMatcher("name", ".*" + networkTextField.getText() + ".*"); + if (g.getProperties().selectSingle(matcher) != null && networkTextField.isEnabled()) { + socket.getOutputStream().write('y'); + callback.started(g); + } else { + socket.getOutputStream().write('n'); + } + } catch (IOException e) { + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Server.java b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Server.java new file mode 100644 index 00000000000..6bd3dd67bb1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/Server.java @@ -0,0 +1,145 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.connection; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupCallback; +import com.sun.hotspot.igv.data.services.GroupReceiver; +import com.sun.hotspot.igv.settings.Settings; +import java.awt.Component; +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.prefs.PreferenceChangeEvent; +import java.util.prefs.PreferenceChangeListener; +import javax.swing.SwingUtilities; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.util.RequestProcessor; + +/** + * + * @author Thomas Wuerthinger + */ +public class Server implements GroupCallback, GroupReceiver, PreferenceChangeListener { + + private javax.swing.JPanel jPanel1; + private javax.swing.JCheckBox networkCheckBox; + private javax.swing.JTextField networkTextField; + private ServerSocket serverSocket; + private GroupCallback callback; + private int port; + private Runnable serverRunnable; + + public Component init(GroupCallback callback) { + + this.callback = callback; + + jPanel1 = new javax.swing.JPanel(); + networkTextField = new javax.swing.JTextField(); + networkCheckBox = new javax.swing.JCheckBox(); + + + jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); + jPanel1.setLayout(new java.awt.BorderLayout(10, 10)); + jPanel1.add(networkTextField, java.awt.BorderLayout.CENTER); + + networkCheckBox.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(networkCheckBox, "Receive when name contains"); + networkCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + networkCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); + networkCheckBox.addChangeListener(new javax.swing.event.ChangeListener() { + + public void stateChanged(javax.swing.event.ChangeEvent evt) { + networkCheckBoxChanged(evt); + } + }); + jPanel1.add(networkCheckBox, java.awt.BorderLayout.WEST); + networkCheckBox.getAccessibleContext().setAccessibleName("Read from network when name contains"); + + initializeNetwork(); + Settings.get().addPreferenceChangeListener(this); + return jPanel1; + } + + private void networkCheckBoxChanged(javax.swing.event.ChangeEvent evt) { + networkTextField.setEnabled(networkCheckBox.isSelected()); + } + + public void preferenceChange(PreferenceChangeEvent e) { + + int curPort = Integer.parseInt(Settings.get().get(Settings.PORT, Settings.PORT_DEFAULT)); + if (curPort != port) { + initializeNetwork(); + } + } + + private void initializeNetwork() { + + int curPort = Integer.parseInt(Settings.get().get(Settings.PORT, Settings.PORT_DEFAULT)); + this.port = curPort; + try { + serverSocket = new java.net.ServerSocket(curPort); + } catch (IOException ex) { + NotifyDescriptor message = new NotifyDescriptor.Message("Could not create server. Listening for incoming data is disabled.", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); + return; + } + + Runnable runnable = new Runnable() { + + public void run() { + while (true) { + try { + Socket clientSocket = serverSocket.accept(); + if (serverRunnable != this) { + clientSocket.close(); + return; + } + RequestProcessor.getDefault().post(new Client(clientSocket, networkTextField, Server.this), 0, Thread.MAX_PRIORITY); + } catch (IOException ex) { + serverSocket = null; + NotifyDescriptor message = new NotifyDescriptor.Message("Error during listening for incoming connections. Listening for incoming data is disabled.", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); + return; + } + } + } + }; + + serverRunnable = runnable; + + RequestProcessor.getDefault().post(runnable, 0, Thread.MAX_PRIORITY); + } + + public void started(final Group g) { + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + callback.started(g); + } + }); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/layer.xml new file mode 100644 index 00000000000..c16a8a0fed6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/NetworkConnection/src/com/sun/hotspot/igv/connection/layer.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/README b/hotspot/src/share/tools/IdealGraphVisualizer/README new file mode 100644 index 00000000000..80e16329506 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/README @@ -0,0 +1,45 @@ +The Ideal Graph Visualizer is a tool developed to help examine the +intermediate representation of C2 which is commonly referred to as the +"ideal graph". It was developed in collaboration with the University +of Linz in Austria and has been included as part of hotspot since that +was the primary target of the tool. The tool itself is fairly general +with only a few modules that contain C2 specific elements. + +The tool is built on top of the NetBeans 6.0 rich client +infrastructure and so requires NetBeans to build. It currently +requires Java 6 to run as it needs support for JavaScript for its +filtering mechanism and assumes it's built into the platform. It +should build out of the box whit NetBeans 6 and Java 6 or later. It's +possible to run it on 1.5 by including Rhino on the classpath though +that currently isn't working correctly. Support for exporting graphs +as SVG can be enabled by adding batik to the classpath which isn't +included by default. + +It can be built on top of NetBeans 6.1 if you change the required +modules to be platform8 instead of platform7. The tool could run on +JDK 1.5 with some reworking of the how the JavaScript support is +enabled but currently it requires some tweaking of the setup. This +will be fixed in a later setup. + +The JVM support is controlled by the flag -XX:PrintIdealGraphLevel=# +where # is: + + 0: no output, the default + 1: dumps graph after parsing, before matching, and final code. + also dumps graph for failed compiles, if available + 2: more detail, including after loop opts + 3: even more detail + 4: prints graph after parsing every bytecode (very slow) + +By default the JVM expects that it will connect to a visualizer on the +local host on port 4444. This can be configured using the options +-XX:PrintIdealGraphAddress= and -XX:PrintIdealGraphPort=. +PrintIdealGraphAddress can actually be a hostname. + +Alternatively the output can be sent to a file using +-XX:PrintIdealGraphFile=filename. Each compiler thread will get it's +own file with unique names being generated by adding a number onto the +provided file name. + +More information about the tool is available at +http://wikis.sun.com/display/HotSpotInternals/IdealGraphVisualizer. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/build.xml new file mode 100644 index 00000000000..dfdd0922316 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.rhino. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/manifest.mf new file mode 100644 index 00000000000..18ba3a45614 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.rhino +OpenIDE-Module-Layer: com/sun/hotspot/igv/rhino/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/rhino/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/build-impl.xml new file mode 100644 index 00000000000..d627b3a01c1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/genfiles.properties new file mode 100644 index 00000000000..e21cae5f34b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=0c3e7912 +build.xml.script.CRC32=44d0050c +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=0c3e7912 +nbproject/build-impl.xml.script.CRC32=7aab3f52 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.xml new file mode 100644 index 00000000000..1f9e5814f48 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/project.xml @@ -0,0 +1,31 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.rhino + + + + com.sun.hotspot.igv.filter + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + + com.sun.hotspot.igv.rhino + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction new file mode 100644 index 00000000000..11a13a78ee0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/META-INF/services/com.sun.hotspot.igv.filter.ScriptEngineAbstraction @@ -0,0 +1 @@ +com.sun.hotspot.igv.rhino.RhinoScriptEngine \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/Bundle.properties new file mode 100644 index 00000000000..e389254eb05 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=RhinoScriptEngineProxy diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/RhinoScriptEngine.java b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/RhinoScriptEngine.java new file mode 100644 index 00000000000..187aa0567be --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/RhinoScriptEngine.java @@ -0,0 +1,85 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.rhino; + +import com.sun.hotspot.igv.filter.ScriptEngineAbstraction; +import com.sun.hotspot.igv.graph.Diagram; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * + * @author Thomas Wuerthinger + */ +public class RhinoScriptEngine implements ScriptEngineAbstraction { + + private String jsHelperText; + private Constructor importer; + private Method scope_put; + private Method cx_evaluateString; + private Method context_enter; + private Method context_exit; + + public boolean initialize(String s) { + this.jsHelperText = s; + Class importerTopLevel = null; + try { + ClassLoader cl = RhinoScriptEngine.class.getClassLoader(); + Class context = cl.loadClass("org.mozilla.javascript.Context"); + Class scriptable = cl.loadClass("org.mozilla.javascript.Scriptable"); + importerTopLevel = cl.loadClass("org.mozilla.javascript.ImporterTopLevel"); + importer = importerTopLevel.getDeclaredConstructor(context); + scope_put = importerTopLevel.getMethod("put", new Class[]{String.class, scriptable, Object.class}); + cx_evaluateString = context.getDeclaredMethod("evaluateString", new Class[]{scriptable, String.class, String.class, Integer.TYPE, Object.class}); + context_enter = context.getDeclaredMethod("enter", new Class[0]); + context_exit = context.getDeclaredMethod("exit", new Class[0]); + return true; + } catch (NoSuchMethodException nsme) { + return false; + } catch (ClassNotFoundException cnfe) { + return false; + } + } + + public void execute(Diagram d, String code) { + try { + Object cx = context_enter.invoke(null, (Object[]) null); + try { + Object scope = importer.newInstance(cx); + scope_put.invoke(scope, "IO", scope, System.out); + scope_put.invoke(scope, "graph", scope, d); + cx_evaluateString.invoke(cx, scope, jsHelperText, "jsHelper.js", 1, null); + cx_evaluateString.invoke(cx, scope, code, "", 1, null); + } finally { + // Exit from the context. + context_exit.invoke(null, (Object[]) null); + } + } catch (InvocationTargetException iae) { + } catch (IllegalAccessException iae) { + } catch (InstantiationException iae) { + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/layer.xml new file mode 100644 index 00000000000..c16a8a0fed6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/RhinoScriptEngineProxy/src/com/sun/hotspot/igv/rhino/layer.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/build.xml new file mode 100644 index 00000000000..31a102f060e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.servercompilerscheduler. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/manifest.mf new file mode 100644 index 00000000000..20c6b686833 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.servercompiler +OpenIDE-Module-Layer: com/sun/hotspot/igv/servercompiler/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/servercompiler/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/build-impl.xml new file mode 100644 index 00000000000..97fbd021e86 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/genfiles.properties new file mode 100644 index 00000000000..18f1a882ca0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=d1360a65 +build.xml.script.CRC32=a9d94ef8 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=d1360a65 +nbproject/build-impl.xml.script.CRC32=52847236 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml new file mode 100644 index 00000000000..56151ed37c8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/project.xml @@ -0,0 +1,21 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.servercompiler + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer new file mode 100644 index 00000000000..9da82d4ca10 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.GroupOrganizer @@ -0,0 +1 @@ +com.sun.hotspot.igv.servercompiler.JavaGroupOrganizer \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.Scheduler b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.Scheduler new file mode 100644 index 00000000000..530080f9f70 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/META-INF/services/com.sun.hotspot.igv.data.services.Scheduler @@ -0,0 +1 @@ +com.sun.hotspot.igv.servercompiler.ServerCompilerScheduler diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/Bundle.properties new file mode 100644 index 00000000000..c5daf04b712 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=ServerCompiler diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/JavaGroupOrganizer.java b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/JavaGroupOrganizer.java new file mode 100644 index 00000000000..e9cc2d62fb9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/JavaGroupOrganizer.java @@ -0,0 +1,200 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.servercompiler; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.services.GroupOrganizer; +import com.sun.hotspot.igv.data.Pair; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class JavaGroupOrganizer implements GroupOrganizer { + + public String getName() { + return "Java structure"; + } + + public List>> organize(List subFolders, List groups) { + + List>> result = new ArrayList>>(); + + if (subFolders.size() == 0) { + buildResult(result, groups, packageNameProvider); + } else if (subFolders.size() == 1) { + buildResult(result, groups, classNameProvider); + } else if (subFolders.size() == 2) { + for (Group g : groups) { + List children = new ArrayList(); + children.add(g); + Pair> p = new Pair>(); + p.setLeft(reducedNameProvider.getName(g)); + p.setRight(children); + result.add(p); + } + } else { + result.add(new Pair>("", groups)); + } + + return result; + } + + private void buildResult(List>> result, List groups, NameProvider provider) { + HashMap> map = new HashMap>(); + for (Group g : groups) { + String s = provider.getName(g); + + if (!map.containsKey(s)) { + List list = new ArrayList(); + Pair> pair = new Pair>(s, list); + result.add(pair); + map.put(s, list); + } + + List curList = map.get(s); + curList.add(g); + } + + Collections.sort(result, new Comparator>>() { + + public int compare(Pair> a, Pair> b) { + return a.getLeft().compareTo(b.getLeft()); + } + }); + } + + private static interface NameProvider { + + public String getName(Group g); + } + private NameProvider reducedNameProvider = new NameProvider() { + + public String getName(Group g) { + String name = g.getName(); + assert name != null : "name of group must be set!"; + final String noReducedName = name; + + int firstPoint = name.indexOf("."); + if (firstPoint == -1) { + return noReducedName; + } + + int firstParenthese = name.indexOf("("); + if (firstParenthese == -1 || firstParenthese < firstPoint) { + return noReducedName; + } + + int current = firstPoint; + while (current > 0 && name.charAt(current) != ' ') { + current--; + } + + String tmp = name.substring(0, firstParenthese); + int lastPoint = tmp.lastIndexOf("."); + if (lastPoint == -1) { + return noReducedName; + } + + name = name.substring(0, current + 1) + name.substring(lastPoint + 1); + return name; + } + }; + private NameProvider packageNameProvider = new NameProvider() { + + public String getName(Group g) { + String name = g.getName(); + assert name != null : "name of group must be set!"; + final String noPackage = ""; + + int firstPoint = name.indexOf("."); + if (firstPoint == -1) { + return noPackage; + } + + int firstParenthese = name.indexOf("("); + if (firstParenthese == -1 || firstParenthese < firstPoint) { + return noPackage; + } + + int current = firstPoint; + while (current > 0 && name.charAt(current) != ' ') { + current--; + } + + String fullClassName = name.substring(current + 1, firstParenthese); + int lastPoint = fullClassName.lastIndexOf("."); + if (lastPoint == -1) { + return noPackage; + } + lastPoint = fullClassName.lastIndexOf(".", lastPoint - 1); + if (lastPoint == -1) { + return noPackage; + } + + String packageName = fullClassName.substring(0, lastPoint); + return packageName; + } + }; + private NameProvider classNameProvider = new NameProvider() { + + public String getName(Group g) { + String name = g.getName(); + assert name != null : "name of group must be set!"; + + final String noClass = ""; + + int firstPoint = name.indexOf("."); + if (firstPoint == -1) { + return noClass; + } + + int firstParenthese = name.indexOf("("); + if (firstParenthese == -1 || firstParenthese < firstPoint) { + return noClass; + } + + int current = firstPoint; + while (current > 0 && name.charAt(current) != ' ') { + current--; + } + + String fullClassName = name.substring(current + 1, firstParenthese); + int lastPoint = fullClassName.lastIndexOf("."); + if (lastPoint == -1) { + return noClass; + } + int lastlastPoint = fullClassName.lastIndexOf(".", lastPoint - 1); + + String className = fullClassName.substring(lastlastPoint + 1, lastPoint); + return className; + } + }; +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java new file mode 100644 index 00000000000..408f142ad8a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java @@ -0,0 +1,597 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.servercompiler; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputEdge; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.data.services.Scheduler; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; +import java.util.Vector; + +/** + * + * @author Thomas Wuerthinger + */ +public class ServerCompilerScheduler implements Scheduler { + + private static class Node { + + public InputNode inputNode; + public Set succs = new HashSet(); + public List preds = new ArrayList(); + public InputBlock block; + public boolean isBlockProjection; + public boolean isBlockStart; + } + private InputGraph graph; + private Collection nodes; + private Map inputNodeToNode; + private Vector blocks; + private Map dominatorMap; + private Map blockIndex; + private InputBlock[][] commonDominator; + private static final Comparator edgeComparator = new Comparator() { + + public int compare(InputEdge o1, InputEdge o2) { + return o1.getToIndex() - o2.getToIndex(); + } + }; + + public void buildBlocks() { + + blocks = new Vector(); + Node root = findRoot(); + if (root == null) { + return; + } + Stack stack = new Stack(); + Set visited = new HashSet(); + stack.add(root); + int blockCount = 0; + InputBlock rootBlock = null; + + + while (!stack.isEmpty()) { + Node proj = stack.pop(); + Node parent = proj; + if (proj.isBlockProjection && proj.preds.size() > 0) { + parent = proj.preds.get(0); + } + + if (!visited.contains(parent)) { + visited.add(parent); + InputBlock block = new InputBlock(graph, "" + blockCount); + blocks.add(block); + if (parent == root) { + rootBlock = block; + } + blockCount++; + parent.block = block; + if (proj != parent && proj.succs.size() == 1 && proj.succs.contains(root)) { + // Special treatment of Halt-nodes + proj.block = block; + } + + Node p = proj; + do { + if (p.preds.size() == 0 || p.preds.get(0) == null) { + p = parent; + break; + } + p = p.preds.get(0); + + if (p.block == null) { + p.block = block; + } + } while (!p.isBlockProjection && !p.isBlockStart); + + if (block != rootBlock) { + for (Node n : p.preds) { + if (n != null && n != p) { + if (n.isBlockProjection) { + n = n.preds.get(0); + } + if (n.block != null) { + n.block.addSuccessor(block); + } + } + } + } + + for (Node n : parent.succs) { + if (n != root && n.isBlockProjection) { + for (Node n2 : n.succs) { + + if (n2 != parent && n2.block != null && n2.block != rootBlock) { + block.addSuccessor(n2.block); + } + } + } else { + if (n != parent && n.block != null && n.block != rootBlock) { + block.addSuccessor(n.block); + } + } + } + + int num_preds = p.preds.size(); + int bottom = -1; + if (isRegion(p) || isPhi(p)) { + bottom = 0; + } + + int pushed = 0; + for (int i = num_preds - 1; i > bottom; i--) { + if (p.preds.get(i) != null && p.preds.get(i) != p) { + stack.push(p.preds.get(i)); + pushed++; + } + } + + if (pushed == 0 && p == root) { + // TODO: special handling when root backedges are not built yet + } + } + } + + for (Node n : nodes) { + InputBlock block = n.block; + if (block != null) { + block.addNode(n.inputNode.getId()); + } + } + + int z = 0; + blockIndex = new HashMap(); + for (InputBlock b : blocks) { + blockIndex.put(b, z); + z++; + } + } + + private String getBlockName(InputNode n) { + return n.getProperties().get("block"); + } + + public Collection schedule(InputGraph graph) { + if (graph.getBlocks().size() > 0) { + Collection tmpNodes = new ArrayList(graph.getNodes()); + for (InputNode n : tmpNodes) { + String block = getBlockName(n); + if (graph.getBlock(n) == null) { + graph.getBlock(block).addNode(n); + assert graph.getBlock(n) != null; + } + } + return graph.getBlocks(); + } else { + nodes = new ArrayList(); + inputNodeToNode = new HashMap(); + + this.graph = graph; + buildUpGraph(); + buildBlocks(); + buildDominators(); + buildCommonDominators(); + scheduleLatest(); + + for (InputNode n : graph.getNodes()) { + assert graph.getBlock(n) != null; + } + + return blocks; + } + } + + public void scheduleLatest() { + + + Node root = findRoot(); + + // Mark all nodes reachable in backward traversal from root + Set reachable = new HashSet(); + reachable.add(root); + Stack stack = new Stack(); + stack.push(root); + while (!stack.isEmpty()) { + Node cur = stack.pop(); + for (Node n : cur.preds) { + if (!reachable.contains(n)) { + reachable.add(n); + stack.push(n); + } + } + } + + Set unscheduled = new HashSet(); + for (Node n : this.nodes) { + if (n.block == null && reachable.contains(n)) { + unscheduled.add(n); + } + } + + while (unscheduled.size() > 0) { + boolean progress = false; + + Set newUnscheduled = new HashSet(); + for (Node n : unscheduled) { + + InputBlock block = null; + if (this.isPhi(n) && n.preds.get(0) != null) { + // Phi nodes in same block as region nodes + block = n.preds.get(0).block; + } else { + for (Node s : n.succs) { + if (reachable.contains(s)) { + if (s.block == null) { + block = null; + break; + } else { + if (block == null) { + block = s.block; + } else { + block = commonDominator[this.blockIndex.get(block)][blockIndex.get(s.block)]; + } + } + } + } + } + + if (block != null) { + n.block = block; + block.addNode(n.inputNode.getId()); + progress = true; + } else { + newUnscheduled.add(n); + } + } + + unscheduled = newUnscheduled; + + if (!progress) { + break; + } + } + + Set curReachable = new HashSet(reachable); + for (Node n : curReachable) { + if (n.block != null) { + for (Node s : n.succs) { + if (!reachable.contains(s)) { + markWithBlock(s, n.block, reachable); + } + } + } + } + + } + + private void markWithBlock(Node n, InputBlock b, Set reachable) { + assert !reachable.contains(n); + Stack stack = new Stack(); + stack.push(n); + n.block = b; + b.addNode(n.inputNode.getId()); + reachable.add(n); + + while (!stack.isEmpty()) { + Node cur = stack.pop(); + for (Node s : cur.succs) { + if (!reachable.contains(s)) { + reachable.add(s); + s.block = b; + b.addNode(s.inputNode.getId()); + stack.push(s); + } + } + + for (Node s : cur.preds) { + if (!reachable.contains(s)) { + reachable.add(s); + s.block = b; + b.addNode(s.inputNode.getId()); + stack.push(s); + } + } + } + } + + private class BlockIntermediate { + + InputBlock block; + int index; + int dominator; + int semi; + int parent; + int label; + int ancestor; + List pred; + List bucket; + } + + public void buildCommonDominators() { + commonDominator = new InputBlock[this.blocks.size()][this.blocks.size()]; + for (int i = 0; i < blocks.size(); i++) { + for (int j = 0; j < blocks.size(); j++) { + commonDominator[i][j] = getCommonDominator(i, j); + } + } + } + + public InputBlock getCommonDominator(int a, int b) { + InputBlock ba = blocks.get(a); + InputBlock bb = blocks.get(b); + if (ba == bb) { + return ba; + } + Set visited = new HashSet(); + while (ba != null) { + visited.add(ba); + ba = dominatorMap.get(ba); + } + + while (bb != null) { + if (visited.contains(bb)) { + return bb; + } + bb = dominatorMap.get(bb); + } + + assert false; + return null; + } + + public void buildDominators() { + dominatorMap = new HashMap(); + if (blocks.size() == 0) { + return; + } + Vector intermediate = new Vector(); + Map map = new HashMap(); + int z = 0; + for (InputBlock b : blocks) { + BlockIntermediate bi = new BlockIntermediate(); + bi.block = b; + bi.index = z; + bi.dominator = -1; + bi.semi = -1; + bi.parent = -1; + bi.label = z; + bi.ancestor = -1; + bi.pred = new ArrayList(); + bi.bucket = new ArrayList(); + intermediate.add(bi); + map.put(b, bi); + z++; + } + Stack stack = new Stack(); + stack.add(0); + + Vector array = new Vector(); + intermediate.get(0).dominator = 0; + + int n = 0; + while (!stack.isEmpty()) { + int index = stack.pop(); + BlockIntermediate ib = intermediate.get(index); + ib.semi = n; + array.add(ib); + n = n + 1; + for (InputBlock b : ib.block.getSuccessors()) { + BlockIntermediate succ = map.get(b); + if (succ.semi == -1) { + succ.parent = index; + stack.push(succ.index); // TODO: check if same node could be pushed twice + } + succ.pred.add(index); + } + } + + for (int i = n - 1; i > 0; i--) { + BlockIntermediate block = array.get(i); + int block_index = block.index; + for (int predIndex : block.pred) { + int curIndex = eval(predIndex, intermediate); + BlockIntermediate curBlock = intermediate.get(curIndex); + if (curBlock.semi < block.semi) { + block.semi = curBlock.semi; + } + } + + + int semiIndex = block.semi; + BlockIntermediate semiBlock = array.get(semiIndex); + semiBlock.bucket.add(block_index); + + link(block.parent, block_index, intermediate); + BlockIntermediate parentBlock = intermediate.get(block.parent); + + for (int j = 0; j < parentBlock.bucket.size(); j++) { + for (int curIndex : parentBlock.bucket) { + int newIndex = eval(curIndex, intermediate); + BlockIntermediate curBlock = intermediate.get(curIndex); + BlockIntermediate newBlock = intermediate.get(newIndex); + int dom = block.parent; + if (newBlock.semi < curBlock.semi) { + dom = newIndex; + } + + curBlock.dominator = dom; + } + } + + + parentBlock.bucket.clear(); + } + + for (int i = 1; i < n; i++) { + + BlockIntermediate block = array.get(i); + int block_index = block.index; + + int semi_index = block.semi; + BlockIntermediate semi_block = array.get(semi_index); + + if (block.dominator != semi_block.index) { + int new_dom = intermediate.get(block.dominator).dominator; + block.dominator = new_dom; + } + } + + for (BlockIntermediate ib : intermediate) { + if (ib.dominator == -1) { + ib.dominator = 0; + } + } + + for (BlockIntermediate bi : intermediate) { + InputBlock b = bi.block; + int dominator = bi.dominator; + InputBlock dominatorBlock = null; + if (dominator != -1) { + dominatorBlock = intermediate.get(dominator).block; + } + + if (dominatorBlock == b) { + dominatorBlock = null; + } + this.dominatorMap.put(b, dominatorBlock); + } + } + + private void compress(int index, Vector blocks) { + BlockIntermediate block = blocks.get(index); + + int ancestor = block.ancestor; + assert ancestor != -1; + + BlockIntermediate ancestor_block = blocks.get(ancestor); + if (ancestor_block.ancestor != -1) { + compress(ancestor, blocks); + + int label = block.label; + BlockIntermediate label_block = blocks.get(label); + + int ancestor_label = ancestor_block.label; + BlockIntermediate ancestor_label_block = blocks.get(label); + if (ancestor_label_block.semi < label_block.semi) { + block.label = ancestor_label; + } + + block.ancestor = ancestor_block.ancestor; + } + } + + private int eval(int index, Vector blocks) { + BlockIntermediate block = blocks.get(index); + if (block.ancestor == -1) { + return index; + } else { + compress(index, blocks); + return block.label; + } + } + + private void link(int index1, int index2, Vector blocks) { + BlockIntermediate block2 = blocks.get(index2); + block2.ancestor = index1; + } + + private boolean isRegion(Node n) { + return n.inputNode.getProperties().get("name").equals("Region"); + } + + private boolean isPhi(Node n) { + return n.inputNode.getProperties().get("name").equals("Phi"); + } + + private Node findRoot() { + + for (Node n : nodes) { + InputNode inputNode = n.inputNode; + if (inputNode.getProperties().get("name").equals("Root")) { + return n; + } + } + + return null; + } + + public void buildUpGraph() { + + for (InputNode n : graph.getNodes()) { + Node node = new Node(); + node.inputNode = n; + nodes.add(node); + String p = n.getProperties().get("is_block_proj"); + node.isBlockProjection = (p != null && p.equals("true")); + p = n.getProperties().get("is_block_start"); + node.isBlockStart = (p != null && p.equals("true")); + inputNodeToNode.put(n, node); + } + + Map> edgeMap = new HashMap>(); + for (InputEdge e : graph.getEdges()) { + + int to = e.getTo(); + if (!edgeMap.containsKey(to)) { + edgeMap.put(to, new ArrayList()); + } + + + List list = edgeMap.get(to); + list.add(e); + } + + + for (Integer i : edgeMap.keySet()) { + + List list = edgeMap.get(i); + Collections.sort(list, edgeComparator); + + int to = i; + InputNode toInputNode = graph.getNode(to); + Node toNode = inputNodeToNode.get(toInputNode); + for (InputEdge e : list) { + assert to == e.getTo(); + int from = e.getFrom(); + InputNode fromInputNode = graph.getNode(from); + Node fromNode = inputNodeToNode.get(fromInputNode); + fromNode.succs.add(toNode); + toNode.preds.add(fromNode); + } + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter new file mode 100644 index 00000000000..3ad07276df8 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter @@ -0,0 +1,5 @@ +colorize("name", ".*", yellow); +colorize("name", "Catch.*", blue); + +colorize("name", "Region|Loop|CountedLoop|Root", red); +colorize("name", "CProj|IfFalse|IfTrue|JProj|CatchProj", magenta); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/combine.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/combine.filter new file mode 100644 index 00000000000..8e5c5a0a7c7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/combine.filter @@ -0,0 +1,4 @@ +var f = new CombineFilter("Combine Filter"); +f.addRule(new CombineFilter.CombineRule(new Properties.RegexpPropertyMatcher("name", ".*"), new Properties.RegexpPropertyMatcher("name", "Proj|IfFalse|IfTrue|JProj|MachProj|JumpProj|CatchProj"))); +f.addRule(new CombineFilter.CombineRule(new Properties.RegexpPropertyMatcher("name", "Cmp.*"), new Properties.RegexpPropertyMatcher("name", "Bool"))); +f.apply(graph); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/difference.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/difference.filter new file mode 100644 index 00000000000..53277373d60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/difference.filter @@ -0,0 +1,4 @@ +colorize("state", "same", white); +colorize("state", "changed", orange); +colorize("state", "new", green); +colorize("state", "deleted", red); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/extendedColor.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/extendedColor.filter new file mode 100644 index 00000000000..1ea0fb36abe --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/extendedColor.filter @@ -0,0 +1,3 @@ +colorize("name", "Con.*", orange); +colorize("name", "Parm|Proj", lightGray); +colorize("bci", "..*", magenta); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/linestyle.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/linestyle.filter new file mode 100644 index 00000000000..9aa15e79298 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/linestyle.filter @@ -0,0 +1,7 @@ +var f = new ColorFilter("Line Style filter"); +f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "int:")), null, Color.BLUE, null)); +f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "control")), null, Color.RED, null)); +f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "memory")), null, Color.GREEN, null)); +f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "tuple:")), null, Color.MAGENTA, null)); +f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "bottom")), null, Color.LIGHT_GRAY, null)); +f.apply(graph); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/matchingFlags.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/matchingFlags.filter new file mode 100644 index 00000000000..0f18448e162 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/matchingFlags.filter @@ -0,0 +1,3 @@ +colorize("is_dontcare", "false", white); +colorize("is_shared", "true", green); +colorize("is_dontcare", "true", red); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter new file mode 100644 index 00000000000..7230576a2ac --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter @@ -0,0 +1,24 @@ +var f = new RemoveFilter("Show only control flow"); +f.addRule( + new RemoveFilter.RemoveRule( + new InvertSelector( + new OrSelector( + new OrSelector( + new SuccessorSelector( + new MatcherSelector( + new Properties.StringPropertyMatcher("type", "control") + ) + ), + new MatcherSelector( + new Properties.StringPropertyMatcher("type", "control") + ) + ), + new MatcherSelector( + new Properties.StringPropertyMatcher("name", "Start") + ) + ) + ), false + ) +); +f.addRule( new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.RegexpPropertyMatcher("name", "Phi|Store.")), false)); +f.apply(graph); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/register.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/register.filter new file mode 100644 index 00000000000..5328246d288 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/register.filter @@ -0,0 +1,4 @@ +colorize("reg", "EAX", green); +colorize("reg", "EFLAGS", gray); +colorize("reg", "EBP", orange); +colorize("reg", "ECX", cyan); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter new file mode 100644 index 00000000000..0333fccb337 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter @@ -0,0 +1 @@ +remove("dump_spec", "FramePtr|ReturnAdr|I_O"); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeMemory.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeMemory.filter new file mode 100644 index 00000000000..842caed3b7f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeMemory.filter @@ -0,0 +1,7 @@ + +//var f = new RemoveFilter("Remove Memory"); +//f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.StringPropertyMatcher("dump_spec", "Memory")), false)); +//f.addRule(new RemoveFilter.RemoveRule(new AndSelector(new MatcherSelector(new Properties.StringPropertyMatcher("name", "Proj")), new MatcherSelector(new Properties.StringPropertyMatcher("type", "memory"))), false)); +//f.apply(graph); + +remove("dump_spec", "Memory"); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeRootInputs.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeRootInputs.filter new file mode 100644 index 00000000000..8f6aacd4c4d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeRootInputs.filter @@ -0,0 +1 @@ +removeInputs("name", "Root"); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSafepointInputs.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSafepointInputs.filter new file mode 100644 index 00000000000..b2abf0ee717 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSafepointInputs.filter @@ -0,0 +1,4 @@ +removeInputs("name", "SafePoint|CallStaticJava|CallDynamicJava|CallJava|CallLeaf|CallRuntime|AbstractLock|CallLeafNoFP|Call|CallStaticJavaDirect", 5); +removeInputs("name", "Unlock|Lock", 7); +removeInputs("name", "Allocate", 7); +removeInputs("name", "AllocateArray", 9); diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSelfLoops.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSelfLoops.filter new file mode 100644 index 00000000000..debfd596de0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/removeSelfLoops.filter @@ -0,0 +1,2 @@ +var f = new RemoveSelfLoopsFilter("Remove Self-Loops"); +f.apply(graph); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/split.filter b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/split.filter new file mode 100644 index 00000000000..5f344ca6d76 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/split.filter @@ -0,0 +1,2 @@ +split("name", "BoxLock"); +split("name", "(Con.*)|(loadCon.*)"); \ No newline at end of file diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml new file mode 100644 index 00000000000..461692d832e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/build.xml new file mode 100644 index 00000000000..7ba84f5cc6d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.settings. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/manifest.mf new file mode 100644 index 00000000000..15f55c9f985 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.settings +OpenIDE-Module-Layer: com/sun/hotspot/igv/settings/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/settings/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/build-impl.xml new file mode 100644 index 00000000000..ca15154cf9f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/genfiles.properties new file mode 100644 index 00000000000..d7271112dad --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=8869440a +build.xml.script.CRC32=7ef09117 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=8869440a +nbproject/build-impl.xml.script.CRC32=1a0e7f21 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.xml new file mode 100644 index 00000000000..0748a12fcaf --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/project.xml @@ -0,0 +1,49 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.settings + + + + org.jdesktop.layout + + + + 1 + 1.4 + + + + org.netbeans.modules.options.api + + + + 1 + 1.5 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + + com.sun.hotspot.igv.settings + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Bundle.properties new file mode 100644 index 00000000000..2c701a08276 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Bundle.properties @@ -0,0 +1,5 @@ +AdvancedOption_DisplayName_Settings=Settings +AdvancedOption_Tooltip_Settings=Application Settings +OpenIDE-Module-Name=Settings +OptionsCategory_Name_View=General +OptionsCategory_Title_View=View Settings diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Settings.java b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Settings.java new file mode 100644 index 00000000000..af7627cdeca --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/Settings.java @@ -0,0 +1,47 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.settings; + +import java.util.prefs.Preferences; + +/** + * + * @author Thomas Wuerthinger + */ +public class Settings { + + public final static String NODE_TEXT = "nodeText"; + public final static String NODE_TEXT_DEFAULT = "[idx] [name]"; + public final static String NODE_WIDTH = "nodeWidth"; + public final static String NODE_WIDTH_DEFAULT = "100"; + public final static String PORT = "port"; + public final static String PORT_DEFAULT = "4444"; + public final static String DIRECTORY = "directory"; + public final static String DIRECTORY_DEFAULT = System.getProperty("user.dir"); + + public static Preferences get() { + return Preferences.userNodeForPackage(Settings.class); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsCategory.java b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsCategory.java new file mode 100644 index 00000000000..857f87edd33 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsCategory.java @@ -0,0 +1,55 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.settings; + +import javax.swing.Icon; +import javax.swing.ImageIcon; +import org.netbeans.spi.options.OptionsCategory; +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ViewOptionsCategory extends OptionsCategory { + + @Override + public Icon getIcon() { + return new ImageIcon(Utilities.loadImage("com/sun/hotspot/igv/settings/settings.gif")); + } + + public String getCategoryName() { + return NbBundle.getMessage(ViewOptionsCategory.class, "OptionsCategory_Name_View"); + } + + public String getTitle() { + return NbBundle.getMessage(ViewOptionsCategory.class, "OptionsCategory_Title_View"); + } + + public OptionsPanelController create() { + return new ViewOptionsPanelController(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsPanelController.java b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsPanelController.java new file mode 100644 index 00000000000..0e6c09a2422 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewOptionsPanelController.java @@ -0,0 +1,95 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.settings; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import javax.swing.JComponent; +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; + +/** + * + * @author Thomas Wuerthinger + */ +final class ViewOptionsPanelController extends OptionsPanelController { + + private ViewPanel panel; + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + private boolean changed; + + public void update() { + getPanel().load(); + changed = false; + } + + public void applyChanges() { + getPanel().store(); + changed = false; + } + + public void cancel() { + // need not do anything special, if no changes have been persisted yet + } + + public boolean isValid() { + return getPanel().valid(); + } + + public boolean isChanged() { + return changed; + } + + public HelpCtx getHelpCtx() { + return null; // new HelpCtx("...ID") if you have a help set + } + + public JComponent getComponent(Lookup masterLookup) { + return getPanel(); + } + + public void addPropertyChangeListener(PropertyChangeListener l) { + pcs.addPropertyChangeListener(l); + } + + public void removePropertyChangeListener(PropertyChangeListener l) { + pcs.removePropertyChangeListener(l); + } + + private ViewPanel getPanel() { + if (panel == null) { + panel = new ViewPanel(this); + } + return panel; + } + + void changed() { + if (!changed) { + changed = true; + pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); + } + pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.form b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.form new file mode 100644 index 00000000000..9b3fc1ec942 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.form @@ -0,0 +1,121 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.java b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.java new file mode 100644 index 00000000000..b02644a5866 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/ViewPanel.java @@ -0,0 +1,144 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.settings; + +/** + * + * @author Thomas Wuerthinger + */ +final class ViewPanel extends javax.swing.JPanel { + + private final ViewOptionsPanelController controller; + + ViewPanel(ViewOptionsPanelController controller) { + this.controller = controller; + initComponents(); + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + portSpinner = new javax.swing.JSpinner(); + jScrollPane1 = new javax.swing.JScrollPane(); + nodeTextArea = new javax.swing.JTextArea(); + nodeWidthSpinner = new javax.swing.JSpinner(); + jLabel3 = new javax.swing.JLabel(); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel1, "Node Text"); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, "Node Width"); + + nodeTextArea.setColumns(20); + nodeTextArea.setRows(5); + jScrollPane1.setViewportView(nodeTextArea); + + org.openide.awt.Mnemonics.setLocalizedText(jLabel3, "Network Port"); + + org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jLabel1) + .add(jLabel3) + .add(jLabel2)) + .add(39, 39, 39) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(portSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(nodeWidthSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 365, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(jPanel1Layout.createSequentialGroup() + .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(18, 18, 18) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(nodeWidthSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jLabel2)) + .add(18, 18, 18) + .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(portSpinner, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(jLabel3))) + .add(jLabel1)) + .add(73, 73, 73)) + ); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .addContainerGap() + .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 232, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addContainerGap(206, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + void load() { + nodeTextArea.setText(Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT)); + nodeWidthSpinner.setValue(Integer.parseInt(Settings.get().get(Settings.NODE_WIDTH, Settings.NODE_WIDTH_DEFAULT))); + portSpinner.setValue(Integer.parseInt(Settings.get().get(Settings.PORT, Settings.PORT_DEFAULT))); + } + + void store() { + Settings.get().put(Settings.NODE_TEXT, nodeTextArea.getText()); + Settings.get().put(Settings.NODE_WIDTH, nodeWidthSpinner.getValue().toString()); + Settings.get().put(Settings.PORT, portSpinner.getValue().toString()); + } + + boolean valid() { + return true; + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea nodeTextArea; + private javax.swing.JSpinner nodeWidthSpinner; + private javax.swing.JSpinner portSpinner; + // End of variables declaration//GEN-END:variables +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/layer.xml new file mode 100644 index 00000000000..f7a7aba5018 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/layer.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/settings.gif b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/settings.gif new file mode 100644 index 00000000000..030be8228d7 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/Settings/src/com/sun/hotspot/igv/settings/settings.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Util/build.xml new file mode 100644 index 00000000000..1af1e360034 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.util. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/Util/manifest.mf new file mode 100644 index 00000000000..9c10b50e24f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/manifest.mf @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.util +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/util/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/build-impl.xml new file mode 100644 index 00000000000..8a444c36b55 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/genfiles.properties new file mode 100644 index 00000000000..494d2b8ef84 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=a470a16f +build.xml.script.CRC32=466cf03b +build.xml.stylesheet.CRC32=05353c81 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=a470a16f +nbproject/build-impl.xml.script.CRC32=39f45e01 +nbproject/build-impl.xml.stylesheet.CRC32=3f8b4615 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml new file mode 100644 index 00000000000..3ae7755b1aa --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/project.xml @@ -0,0 +1,47 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.util + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + org.netbeans.api.visual + + + + 2.9 + + + + org.openide.nodes + + + + 7.2.1.1 + + + + org.openide.util + + + + 7.10.1.1 + + + + + com.sun.hotspot.igv.util + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/BoundedZoomAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/BoundedZoomAction.java new file mode 100644 index 00000000000..f79113fea4c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/BoundedZoomAction.java @@ -0,0 +1,182 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import javax.swing.JComponent; +import javax.swing.JScrollPane; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.action.WidgetAction.State; +import org.netbeans.api.visual.action.WidgetAction.WidgetMouseWheelEvent; +import org.netbeans.api.visual.animator.SceneAnimator; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class BoundedZoomAction extends WidgetAction.Adapter { + + private double minFactor = 0.0; + private double maxFactor = Double.MAX_VALUE; + private double zoomMultiplier; + private boolean useAnimator; + + public BoundedZoomAction(double zoomMultiplier, boolean useAnimator) { + this.zoomMultiplier = zoomMultiplier; + this.useAnimator = useAnimator; + } + + public double getMinFactor() { + return minFactor; + } + + public void setMinFactor(double d) { + minFactor = d; + } + + public double getMaxFactor() { + return maxFactor; + } + + public void setMaxFactor(double d) { + maxFactor = d; + } + + private JScrollPane findScrollPane(JComponent component) { + for (;;) { + if (component == null) { + return null; + } + if (component instanceof JScrollPane) { + return ((JScrollPane) component); + } + Container parent = component.getParent(); + if (!(parent instanceof JComponent)) { + return null; + } + component = (JComponent) parent; + } + } + + @Override + public State mouseWheelMoved(Widget widget, WidgetMouseWheelEvent event) { + final Scene scene = widget.getScene(); + int amount = event.getWheelRotation(); + JScrollPane scrollPane = findScrollPane(scene.getView()); + Point viewPosition = null; + Point mouseLocation = scene.convertSceneToView(event.getPoint()); + int xOffset = 0; + int yOffset = 0; + Point oldViewPosition = null; + Rectangle bounds = new Rectangle(scene.getBounds()); + Dimension componentSize = new Dimension(scene.getView().getPreferredSize()); + + if (scrollPane != null) { + viewPosition = new Point(scrollPane.getViewport().getViewPosition()); + oldViewPosition = new Point(viewPosition); + xOffset = (mouseLocation.x - viewPosition.x); + yOffset = (mouseLocation.y - viewPosition.y); + viewPosition.x += xOffset; + viewPosition.y += yOffset; + } + + if (useAnimator) { + SceneAnimator sceneAnimator = scene.getSceneAnimator(); + synchronized (sceneAnimator) { + double zoom = sceneAnimator.isAnimatingZoomFactor() ? sceneAnimator.getTargetZoomFactor() : scene.getZoomFactor(); + while (amount > 0 && zoom / zoomMultiplier >= minFactor && zoom / zoomMultiplier <= maxFactor) { + zoom /= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x /= zoomMultiplier; + viewPosition.y /= zoomMultiplier; + bounds.width /= zoomMultiplier; + bounds.height /= zoomMultiplier; + componentSize.width /= zoomMultiplier; + componentSize.height /= zoomMultiplier; + } + amount--; + } + while (amount < 0 && zoom * zoomMultiplier >= minFactor && zoom * zoomMultiplier <= maxFactor) { + zoom *= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x *= zoomMultiplier; + viewPosition.y *= zoomMultiplier; + bounds.width *= zoomMultiplier; + bounds.height *= zoomMultiplier; + componentSize.width *= zoomMultiplier; + componentSize.height *= zoomMultiplier; + } + amount++; + } + sceneAnimator.animateZoomFactor(zoom); + } + } else { + double zoom = scene.getZoomFactor(); + while (amount > 0 && zoom / zoomMultiplier >= minFactor && zoom / zoomMultiplier <= maxFactor) { + zoom /= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x /= zoomMultiplier; + viewPosition.y /= zoomMultiplier; + bounds.width /= zoomMultiplier; + bounds.height /= zoomMultiplier; + componentSize.width /= zoomMultiplier; + componentSize.height /= zoomMultiplier; + } + amount--; + } + while (amount < 0 && zoom * zoomMultiplier >= minFactor && zoom * zoomMultiplier <= maxFactor) { + zoom *= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x *= zoomMultiplier; + viewPosition.y *= zoomMultiplier; + bounds.width *= zoomMultiplier; + bounds.height *= zoomMultiplier; + componentSize.width *= zoomMultiplier; + componentSize.height *= zoomMultiplier; + } + amount++; + } + scene.setZoomFactor(zoom); + } + + if (scrollPane != null) { + scene.validate(); // Call validate to update size of scene + Dimension size = scrollPane.getViewport().getExtentSize(); + viewPosition.x -= xOffset; + viewPosition.y -= yOffset; + scene.resolveBounds(scene.getLocation(), bounds); + scene.getView().setPreferredSize(componentSize); + scene.getView().revalidate(); + scene.getView().addNotify(); + scrollPane.getViewport().setViewPosition(viewPosition); + } + + return WidgetAction.State.CONSUMED; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/Bundle.properties new file mode 100644 index 00000000000..ad93affc8a5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/Bundle.properties @@ -0,0 +1 @@ +OpenIDE-Module-Name=Util diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ColorIcon.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ColorIcon.java new file mode 100644 index 00000000000..2c0c2ff8d23 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ColorIcon.java @@ -0,0 +1,55 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import javax.swing.Icon; + +/** + * + * @author Thomas Wuerthinger + */ +public class ColorIcon implements Icon { + + private Color color; + + public ColorIcon(Color c) { + color = c; + } + + public void paintIcon(Component c, Graphics g, int x, int y) { + g.setColor(color); + g.fillRect(x, y, 16, 16); + } + + public int getIconWidth() { + return 16; + } + + public int getIconHeight() { + return 16; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ContextAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ContextAction.java new file mode 100644 index 00000000000..cc82017ca24 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ContextAction.java @@ -0,0 +1,95 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.util; + +import java.awt.EventQueue; +import org.openide.util.ContextAwareAction; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.Utilities; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public abstract class ContextAction extends CallableSystemAction implements LookupListener, ContextAwareAction { + + private Lookup context = null; + private Lookup.Result result = null; + + public ContextAction() { + this(Utilities.actionsGlobalContext()); + } + + public ContextAction(Lookup context) { + init(context); + } + + private void init(Lookup context) { + this.context = context; + result = context.lookupResult(contextClass()); + result.addLookupListener(this); + resultChanged(null); + } + + public void resultChanged(LookupEvent e) { + if (result.allItems().size() != 0) { + update(result.allInstances().iterator().next()); + } else { + update(null); + } + } + + @Override + public void performAction() { + final T t = result.allInstances().iterator().next(); + + // Ensure it's AWT event thread + EventQueue.invokeLater(new Runnable() { + + public void run() { + performAction(t); + } + }); + } + + public void update(T t) { + if (t == null) { + setEnabled(false); + } else { + setEnabled(isEnabled(t)); + } + } + + public boolean isEnabled(T context) { + return true; + } + + public abstract Class contextClass(); + + public abstract void performAction(T context); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickAction.java new file mode 100644 index 00000000000..e01f8c8b131 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickAction.java @@ -0,0 +1,49 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class DoubleClickAction extends WidgetAction.Adapter { + + private DoubleClickHandler handler; + + public DoubleClickAction(DoubleClickHandler handler) { + this.handler = handler; + } + + @Override + public WidgetAction.State mouseClicked(Widget widget, WidgetAction.WidgetMouseEvent event) { + if (event.getClickCount() > 1) { + handler.handleDoubleClick(widget, event); + return WidgetAction.State.CONSUMED; + } + return WidgetAction.State.REJECTED; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickHandler.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickHandler.java new file mode 100644 index 00000000000..61ccaed0bf0 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/DoubleClickHandler.java @@ -0,0 +1,36 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public interface DoubleClickHandler { + + public void handleDoubleClick(Widget w, WidgetMouseEvent e); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSatelliteComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSatelliteComponent.java new file mode 100644 index 00000000000..81cf5c7ba92 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSatelliteComponent.java @@ -0,0 +1,195 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import org.netbeans.api.visual.widget.Scene; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +/** + * @author David Kaspar + * @author Thomas Wuerthinger + */ +public class ExtendedSatelliteComponent extends JComponent implements MouseListener, MouseMotionListener, Scene.SceneListener, ComponentListener { + + private Scene scene; + private Image image; + private int imageWidth; + private int imageHeight; + + public ExtendedSatelliteComponent(Scene scene) { + this.scene = scene; + setDoubleBuffered(true); + setPreferredSize(new Dimension(128, 128)); + addMouseListener(this); + addMouseMotionListener(this); + } + + @Override + public void addNotify() { + super.addNotify(); + scene.addSceneListener(this); + JComponent viewComponent = scene.getView(); + if (viewComponent == null) { + viewComponent = scene.createView(); + } + viewComponent.addComponentListener(this); + repaint(); + } + + @Override + public void removeNotify() { + scene.getView().removeComponentListener(this); + scene.removeSceneListener(this); + super.removeNotify(); + } + + public void update() { + this.image = null; + repaint(); + } + + @Override + public void paint(Graphics g) { + Graphics2D gr = (Graphics2D) g; + super.paint(g); + Rectangle bounds = scene.getBounds(); + Dimension size = getSize(); + + double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; + double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; + double scale = Math.min(sx, sy); + + int vw = (int) (scale * bounds.width); + int vh = (int) (scale * bounds.height); + int vx = (size.width - vw) / 2; + int vy = (size.height - vh) / 2; + + + if (image == null || vw != imageWidth || vh != imageHeight) { + + imageWidth = vw; + imageHeight = vh; + image = this.createImage(imageWidth, imageHeight); + Graphics2D ig = (Graphics2D) image.getGraphics(); + ig.scale(scale, scale); + scene.paint(ig); + } + + gr.drawImage(image, vx, vy, this); + + JComponent component = scene.getView(); + double zoomFactor = scene.getZoomFactor(); + Rectangle viewRectangle = component != null ? component.getVisibleRect() : null; + if (viewRectangle != null) { + Rectangle window = new Rectangle( + (int) ((double) viewRectangle.x * scale / zoomFactor), + (int) ((double) viewRectangle.y * scale / zoomFactor), + (int) ((double) viewRectangle.width * scale / zoomFactor), + (int) ((double) viewRectangle.height * scale / zoomFactor)); + window.translate(vx, vy); + gr.setColor(new Color(200, 200, 200, 128)); + gr.fill(window); + gr.setColor(Color.BLACK); + gr.drawRect(window.x, window.y, window.width - 1, window.height - 1); + } + } + + public void mouseClicked(MouseEvent e) { + } + + public void mousePressed(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseReleased(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } + + public void mouseDragged(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseMoved(MouseEvent e) { + } + + private void moveVisibleRect(Point center) { + JComponent component = scene.getView(); + if (component == null) { + return; + } + double zoomFactor = scene.getZoomFactor(); + Rectangle bounds = scene.getBounds(); + Dimension size = getSize(); + + double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; + double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; + double scale = Math.min(sx, sy); + + int vw = (int) (scale * bounds.width); + int vh = (int) (scale * bounds.height); + int vx = (size.width - vw) / 2; + int vy = (size.height - vh) / 2; + + int cx = (int) ((double) (center.x - vx) / scale * zoomFactor); + int cy = (int) ((double) (center.y - vy) / scale * zoomFactor); + + Rectangle visibleRect = component.getVisibleRect(); + visibleRect.x = cx - visibleRect.width / 2; + visibleRect.y = cy - visibleRect.height / 2; + component.scrollRectToVisible(visibleRect); + + } + + public void sceneRepaint() { + } + + public void sceneValidating() { + } + + public void sceneValidated() { + } + + public void componentResized(ComponentEvent e) { + repaint(); + } + + public void componentMoved(ComponentEvent e) { + repaint(); + } + + public void componentShown(ComponentEvent e) { + } + + public void componentHidden(ComponentEvent e) { + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSelectAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSelectAction.java new file mode 100644 index 00000000000..7501c14720b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/ExtendedSelectAction.java @@ -0,0 +1,69 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.util; + +import java.awt.event.MouseEvent; +import javax.swing.JPanel; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.SelectProvider; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.action.WidgetAction.State; +import org.netbeans.api.visual.action.WidgetAction.WidgetKeyEvent; +import org.netbeans.api.visual.action.WidgetAction.WidgetMouseEvent; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class ExtendedSelectAction extends WidgetAction.Adapter { + + private WidgetAction innerAction; + private JPanel panel; + + public ExtendedSelectAction(SelectProvider provider) { + innerAction = ActionFactory.createSelectAction(provider); + panel = new JPanel(); + } + + @Override + public State mousePressed(Widget widget, WidgetMouseEvent event) { + // TODO: Solve this differently? + if (event.getButton() != MouseEvent.BUTTON2) { + return innerAction.mousePressed(widget, new WidgetMouseEvent(event.getEventID(), new MouseEvent(panel, (int) event.getEventID(), event.getWhen(), event.getModifiersEx(), event.getPoint().x, event.getPoint().y, event.getClickCount(), event.isPopupTrigger(), MouseEvent.BUTTON1))); + } else { + return super.mousePressed(widget, event); + } + } + + @Override + public State mouseReleased(Widget widget, WidgetMouseEvent event) { + return innerAction.mouseReleased(widget, event); + } + + @Override + public State keyTyped(Widget widget, WidgetKeyEvent event) { + return innerAction.keyTyped(widget, event); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java new file mode 100644 index 00000000000..f058edda6ae --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/PropertiesSheet.java @@ -0,0 +1,71 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.util; + +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Property; +import java.lang.reflect.InvocationTargetException; +import org.openide.nodes.Node; +import org.openide.nodes.Sheet; + +/** + * + * @author Thomas Wuerthinger + */ +public class PropertiesSheet { + + public static void initializeSheet(Properties properties, Sheet s) { + + Sheet.Set set1 = Sheet.createPropertiesSet(); + set1.setDisplayName("Properties"); + for (final Property p : properties.getProperties()) { + Node.Property prop = new Node.Property(String.class) { + + @Override + public boolean canRead() { + return true; + } + + @Override + public String getValue() throws IllegalAccessException, InvocationTargetException { + return p.getValue(); + } + + @Override + public boolean canWrite() { + return false; + } + + @Override + public void setValue(String arg0) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { + p.setValue(arg0); + } + }; + prop.setName(p.getName()); + set1.put(prop); + } + s.put(set1); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java new file mode 100644 index 00000000000..c5f3100f205 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSlider.java @@ -0,0 +1,360 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.util; + +import com.sun.hotspot.igv.data.ChangedListener; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.List; +import javax.swing.JComponent; + +/** + * + * @author Thomas Wuerthinger + */ +public class RangeSlider extends JComponent implements ChangedListener, MouseListener, MouseMotionListener { + + public static final int HEIGHT = 40; + public static final int BAR_HEIGHT = 22; + public static final int BAR_SELECTION_ENDING_HEIGHT = 16; + public static final int BAR_SELECTION_HEIGHT = 10; + public static final int BAR_THICKNESS = 2; + public static final int BAR_CIRCLE_SIZE = 9; + public static final int MOUSE_ENDING_OFFSET = 3; + public static final Color BACKGROUND_COLOR = Color.white; + public static final Color BAR_COLOR = Color.black; + public static final Color BAR_SELECTION_COLOR = new Color(255, 0, 0, 120); + public static final Color BAR_SELECTION_COLOR_ROLLOVER = new Color(255, 0, 255, 120); + public static final Color BAR_SELECTION_COLOR_DRAG = new Color(0, 0, 255, 120); + private RangeSliderModel model; + private State state; + private Point startPoint; + private RangeSliderModel tempModel; + private boolean isOverBar; + + private enum State { + + Initial, + DragBar, + DragFirstPosition, + DragSecondPosition + } + + public RangeSlider() { + state = State.Initial; + this.addMouseMotionListener(this); + this.addMouseListener(this); + } + + public void setModel(RangeSliderModel newModel) { + if (model != null) { + model.getChangedEvent().removeListener(this); + model.getColorChangedEvent().removeListener(this); + } + if (newModel != null) { + newModel.getChangedEvent().addListener(this); + newModel.getColorChangedEvent().addListener(this); + } + this.model = newModel; + update(); + } + + private RangeSliderModel getPaintingModel() { + if (tempModel != null) { + return tempModel; + } + return model; + } + + @Override + public Dimension getPreferredSize() { + Dimension d = super.getPreferredSize(); + d.height = HEIGHT; + return d; + } + + public void changed(RangeSliderModel source) { + update(); + } + + private void update() { + this.repaint(); + } + + private int getXPosition(int index) { + assert index >= 0 && index < getPaintingModel().getPositions().size(); + return getXOffset() * (index + 1); + } + + private int getXOffset() { + int size = getPaintingModel().getPositions().size(); + int width = getWidth(); + return (width / (size + 1)); + } + + private int getEndXPosition(int index) { + return getXPosition(index) + getXOffset() / 2; + } + + private int getStartXPosition(int index) { + return getXPosition(index) - getXOffset() / 2; + } + + @Override + public void paint(Graphics g) { + super.paint(g); + Graphics2D g2 = (Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + int width = getWidth(); + int height = getHeight(); + + g2.setColor(BACKGROUND_COLOR); + g2.fillRect(0, 0, width, height); + + // Nothing to paint? + if (getPaintingModel() == null || getPaintingModel().getPositions().size() == 0) { + return; + } + + int firstPos = getPaintingModel().getFirstPosition(); + int secondPos = getPaintingModel().getSecondPosition(); + + paintSelected(g2, firstPos, secondPos); + paintBar(g2); + + } + + private int getBarStartY() { + return getHeight() - BAR_HEIGHT; + } + + private void paintBar(Graphics2D g) { + List list = getPaintingModel().getPositions(); + int barStartY = getBarStartY(); + + g.setColor(BAR_COLOR); + g.fillRect(getXPosition(0), barStartY + BAR_HEIGHT / 2 - BAR_THICKNESS / 2, getXPosition(list.size() - 1) - getXPosition(0), BAR_THICKNESS); + + int circleCenterY = barStartY + BAR_HEIGHT / 2; + for (int i = 0; i < list.size(); i++) { + int curX = getXPosition(i); + g.setColor(getPaintingModel().getColors().get(i)); + g.fillOval(curX - BAR_CIRCLE_SIZE / 2, circleCenterY - BAR_CIRCLE_SIZE / 2, BAR_CIRCLE_SIZE, BAR_CIRCLE_SIZE); + g.setColor(Color.black); + g.drawOval(curX - BAR_CIRCLE_SIZE / 2, circleCenterY - BAR_CIRCLE_SIZE / 2, BAR_CIRCLE_SIZE, BAR_CIRCLE_SIZE); + + + String curS = list.get(i); + if (curS != null && curS.length() > 0) { + int startX = getStartXPosition(i); + int endX = getEndXPosition(i); + FontMetrics metrics = g.getFontMetrics(); + Rectangle bounds = metrics.getStringBounds(curS, g).getBounds(); + if (bounds.width < endX - startX && bounds.height < barStartY) { + g.setColor(Color.black); + g.drawString(curS, startX + (endX - startX) / 2 - bounds.width / 2, barStartY / 2 + bounds.height / 2); + } + } + } + + } + + private void paintSelected(Graphics2D g, int start, int end) { + + int startX = getStartXPosition(start); + int endX = getEndXPosition(end); + int barStartY = getBarStartY(); + int barSelectionEndingStartY = barStartY + BAR_HEIGHT / 2 - BAR_SELECTION_ENDING_HEIGHT / 2; + paintSelectedEnding(g, startX, barSelectionEndingStartY); + paintSelectedEnding(g, endX, barSelectionEndingStartY); + + g.setColor(BAR_SELECTION_COLOR); + if (state == State.DragBar) { + g.setColor(BAR_SELECTION_COLOR_DRAG); + } else if (isOverBar) { + g.setColor(BAR_SELECTION_COLOR_ROLLOVER); + } + g.fillRect(startX, barStartY + BAR_HEIGHT / 2 - BAR_SELECTION_HEIGHT / 2, endX - startX, BAR_SELECTION_HEIGHT); + } + + private void paintSelectedEnding(Graphics g, int x, int y) { + g.setColor(BAR_COLOR); + g.fillRect(x - BAR_THICKNESS / 2, y, BAR_THICKNESS, BAR_SELECTION_ENDING_HEIGHT); + } + + private boolean isOverSecondPosition(Point p) { + if (p.y >= getBarStartY()) { + int destX = getEndXPosition(getPaintingModel().getSecondPosition()); + int off = Math.abs(destX - p.x); + return off <= MOUSE_ENDING_OFFSET; + } + return false; + } + + private boolean isOverFirstPosition(Point p) { + if (p.y >= getBarStartY()) { + int destX = getStartXPosition(getPaintingModel().getFirstPosition()); + int off = Math.abs(destX - p.x); + return off <= MOUSE_ENDING_OFFSET; + } + return false; + } + + private boolean isOverSelection(Point p) { + if (p.y >= getBarStartY() && !isOverFirstPosition(p) && !isOverSecondPosition(p)) { + return p.x > getStartXPosition(getPaintingModel().getFirstPosition()) && p.x < getEndXPosition(getPaintingModel().getSecondPosition()); + } + return false; + } + + public void mouseDragged(MouseEvent e) { + if (state == State.DragBar) { + int firstX = this.getStartXPosition(model.getFirstPosition()); + int newFirstX = firstX + e.getPoint().x - startPoint.x; + int newIndex = getIndexFromPosition(newFirstX) + 1; + if (newIndex + model.getSecondPosition() - model.getFirstPosition() >= model.getPositions().size()) { + newIndex = model.getPositions().size() - (model.getSecondPosition() - model.getFirstPosition()) - 1; + } + int secondPosition = newIndex + model.getSecondPosition() - model.getFirstPosition(); + tempModel.setPositions(newIndex, secondPosition); + update(); + } else if (state == State.DragFirstPosition) { + int firstPosition = getIndexFromPosition(e.getPoint().x) + 1; + int secondPosition = model.getSecondPosition(); + if (firstPosition > secondPosition) { + firstPosition--; + } + tempModel.setPositions(firstPosition, secondPosition); + update(); + } else if (state == State.DragSecondPosition) { + int firstPosition = model.getFirstPosition(); + int secondPosition = getIndexFromPosition(e.getPoint().x); + if (secondPosition < firstPosition) { + secondPosition++; + } + tempModel.setPositions(firstPosition, secondPosition); + update(); + } + } + + private int getIndexFromPosition(int x) { + if (x < getXPosition(0)) { + return -1; + } + for (int i = 0; i < getPaintingModel().getPositions().size() - 1; i++) { + int startX = getXPosition(i); + int endX = getXPosition(i + 1); + if (x >= startX && x <= endX) { + return i; + } + } + return getPaintingModel().getPositions().size() - 1; + } + + private int getCircleIndexFromPosition(int x) { + int result = 0; + for (int i = 1; i < getPaintingModel().getPositions().size() - 1; i++) { + if (x > getStartXPosition(i)) { + result = i; + } + } + return result; + } + + public void mouseMoved(MouseEvent e) { + isOverBar = false; + if (model == null) { + return; + } + + + Point p = e.getPoint(); + if (isOverFirstPosition(p) || isOverSecondPosition(p)) { + setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR)); + } else if (isOverSelection(p)) { + isOverBar = true; + setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } else { + this.setCursor(Cursor.getDefaultCursor()); + } + repaint(); + } + + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() > 1) { + // Double click + int index = getCircleIndexFromPosition(e.getPoint().x); + model.setPositions(index, index); + } + } + + public void mousePressed(MouseEvent e) { + if (model == null) { + return; + } + + Point p = e.getPoint(); + if (isOverFirstPosition(p)) { + state = State.DragFirstPosition; + } else if (isOverSecondPosition(p)) { + state = State.DragSecondPosition; + } else if (isOverSelection(p)) { + state = State.DragBar; + } else { + return; + } + + startPoint = e.getPoint(); + tempModel = model.copy(); + } + + public void mouseReleased(MouseEvent e) { + if (model == null || tempModel == null) { + return; + } + state = State.Initial; + model.setPositions(tempModel.getFirstPosition(), tempModel.getSecondPosition()); + tempModel = null; + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + isOverBar = false; + repaint(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java new file mode 100644 index 00000000000..71766ec3b67 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/Util/src/com/sun/hotspot/igv/util/RangeSliderModel.java @@ -0,0 +1,130 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.util; + +import com.sun.hotspot.igv.data.ChangedEventProvider; +import com.sun.hotspot.igv.data.ChangedEvent; +import java.awt.Color; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * + * @author Thomas Wuerthinger + */ +public class RangeSliderModel implements ChangedEventProvider { + + // Warning: Update setData method if fields are added + private ChangedEvent changedEvent; + private ChangedEvent colorChangedEvent; + private List positions; + private int firstPosition; + private int secondPosition; + private List colors; + + public void setData(RangeSliderModel model) { + boolean changed = false; + changed |= (positions != model.positions); + positions = model.positions; + changed |= (firstPosition != model.firstPosition); + firstPosition = model.firstPosition; + changed |= (secondPosition != model.secondPosition); + secondPosition = model.secondPosition; + boolean colorChanged = (colors != model.colors); + colors = model.colors; + if (changed) { + changedEvent.fire(); + } + if (colorChanged) { + colorChangedEvent.fire(); + } + } + + public RangeSliderModel(List positions) { + assert positions.size() > 0; + this.positions = positions; + this.changedEvent = new ChangedEvent(this); + this.colorChangedEvent = new ChangedEvent(this); + colors = new ArrayList(); + for (int i = 0; i < positions.size(); i++) { + colors.add(Color.black); + } + } + + public void setColors(List colors) { + this.colors = colors; + colorChangedEvent.fire(); + } + + public List getColors() { + return colors; + } + + public RangeSliderModel copy() { + RangeSliderModel newModel = new RangeSliderModel(positions); + newModel.firstPosition = firstPosition; + newModel.secondPosition = secondPosition; + newModel.colors = colors; + return newModel; + } + + public List getPositions() { + return Collections.unmodifiableList(positions); + } + + public int getFirstPosition() { + return firstPosition; + } + + public int getSecondPosition() { + return secondPosition; + } + + public void setPositions(int fp, int sp) { + assert fp >= 0 && fp < positions.size(); + assert sp >= 0 && sp < positions.size(); + firstPosition = fp; + secondPosition = sp; + ensureOrder(); + changedEvent.fire(); + } + + private void ensureOrder() { + if (secondPosition < firstPosition) { + int tmp = secondPosition; + secondPosition = firstPosition; + firstPosition = tmp; + } + } + + public ChangedEvent getColorChangedEvent() { + return colorChangedEvent; + } + + public ChangedEvent getChangedEvent() { + return changedEvent; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/View/build.xml new file mode 100644 index 00000000000..c0c4cd49d7a --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project com.sun.hotspot.igv.view. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/manifest.mf b/hotspot/src/share/tools/IdealGraphVisualizer/View/manifest.mf new file mode 100644 index 00000000000..870dc9065a6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/manifest.mf @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +OpenIDE-Module: com.sun.hotspot.igv.view +OpenIDE-Module-Layer: com/sun/hotspot/igv/view/layer.xml +OpenIDE-Module-Localizing-Bundle: com/sun/hotspot/igv/view/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/build-impl.xml new file mode 100644 index 00000000000..0de8e534ead --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/build-impl.xml @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/genfiles.properties new file mode 100644 index 00000000000..8d7a4ea4c02 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=2de95ef6 +build.xml.script.CRC32=31afe4b1 +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=2de95ef6 +nbproject/build-impl.xml.script.CRC32=fa7a4119 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/platform.properties new file mode 100644 index 00000000000..68ad75e5766 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=JDK_1.6 +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.properties new file mode 100644 index 00000000000..152f44eca60 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.properties @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml new file mode 100644 index 00000000000..96b103188e9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/project.xml @@ -0,0 +1,151 @@ + + + org.netbeans.modules.apisupport.project + + + com.sun.hotspot.igv.view + + + + com.sun.hotspot.igv.data + + + + 1.0 + + + + com.sun.hotspot.igv.difference + + + + 1.0 + + + + com.sun.hotspot.igv.filter + + + + 1.0 + + + + com.sun.hotspot.igv.graph + + + + 1.0 + + + + com.sun.hotspot.igv.hierarchicallayout + + + + 1.0 + + + + com.sun.hotspot.igv.layout + + + + 1.0 + + + + com.sun.hotspot.igv.settings + + + + 1.0 + + + + com.sun.hotspot.igv.svg + + + + 1.0 + + + + com.sun.hotspot.igv.util + + + + 1.0 + + + + org.netbeans.api.visual + + + + 2.9 + + + + org.openide.actions + + + + 6.6.0.1 + + + + org.openide.awt + + + + 6.11.0.1 + + + + org.openide.dialogs + + + + 7.5.1 + + + + org.openide.loaders + + + + 6.7 + + + + org.openide.nodes + + + + 7.2.1.1 + + + + org.openide.util + + + + 7.9.0.1 + + + + org.openide.windows + + + + 6.16 + + + + + com.sun.hotspot.igv.view + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/suite.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/suite.properties new file mode 100644 index 00000000000..29d7cc9bd6f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/nbproject/suite.properties @@ -0,0 +1 @@ +suite.dir=${basedir}/.. diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer new file mode 100644 index 00000000000..ad042e6fb3d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.GraphViewer @@ -0,0 +1 @@ +com.sun.hotspot.igv.view.GraphViewerImplementation diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.InputGraphProvider b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.InputGraphProvider new file mode 100644 index 00000000000..e057d732d3d --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/META-INF/services/com.sun.hotspot.igv.data.services.InputGraphProvider @@ -0,0 +1 @@ +com.sun.hotspot.igv.view.EditorInputGraphProvider diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/BoundedZoomAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/BoundedZoomAction.java new file mode 100644 index 00000000000..87b8fd3cf57 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/BoundedZoomAction.java @@ -0,0 +1,175 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import javax.swing.JComponent; +import javax.swing.JScrollPane; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.action.WidgetAction.State; +import org.netbeans.api.visual.action.WidgetAction.WidgetMouseWheelEvent; +import org.netbeans.api.visual.animator.SceneAnimator; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class BoundedZoomAction extends WidgetAction.Adapter { + + private double minFactor = 0.0; + private double maxFactor = Double.MAX_VALUE; + private double zoomMultiplier; + private boolean useAnimator; + + public BoundedZoomAction(double zoomMultiplier, boolean useAnimator) { + assert zoomMultiplier > 1.0; + this.zoomMultiplier = zoomMultiplier; + this.useAnimator = useAnimator; + } + + public double getMinFactor() { + return minFactor; + } + + public void setMinFactor(double d) { + minFactor = d; + } + + public double getMaxFactor() { + return maxFactor; + } + + public void setMaxFactor(double d) { + maxFactor = d; + } + + private JScrollPane findScrollPane(JComponent component) { + for (;;) { + if (component == null) { + return null; + } + if (component instanceof JScrollPane) { + return ((JScrollPane) component); + } + Container parent = component.getParent(); + if (!(parent instanceof JComponent)) { + return null; + } + component = (JComponent) parent; + } + } + + @Override + public State mouseWheelMoved(Widget widget, WidgetMouseWheelEvent event) { + final Scene scene = widget.getScene(); + int amount = event.getWheelRotation(); + JScrollPane scrollPane = findScrollPane(scene.getView()); + Point viewPosition = null; + Point mouseLocation = scene.convertSceneToView(event.getPoint()); + int xOffset = 0; + int yOffset = 0; + Rectangle bounds = new Rectangle(scene.getBounds()); + Dimension componentSize = new Dimension(scene.getView().getPreferredSize()); + if (scrollPane != null) { + viewPosition = new Point(scrollPane.getViewport().getViewPosition()); + xOffset = (mouseLocation.x - viewPosition.x); + yOffset = (mouseLocation.y - viewPosition.y); + viewPosition.x += xOffset; + viewPosition.y += yOffset; + } + + if (useAnimator) { + SceneAnimator sceneAnimator = scene.getSceneAnimator(); + synchronized (sceneAnimator) { + double zoom = sceneAnimator.isAnimatingZoomFactor() ? sceneAnimator.getTargetZoomFactor() : scene.getZoomFactor(); + while (amount > 0 && zoom / zoomMultiplier >= minFactor) { + zoom /= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x /= zoomMultiplier; + viewPosition.y /= zoomMultiplier; + bounds.width /= zoomMultiplier; + bounds.height /= zoomMultiplier; + componentSize.width /= zoomMultiplier; + componentSize.height /= zoomMultiplier; + } + amount--; + } + while (amount < 0 && zoom * zoomMultiplier <= maxFactor) { + zoom *= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x *= zoomMultiplier; + viewPosition.y *= zoomMultiplier; + bounds.width *= zoomMultiplier; + bounds.height *= zoomMultiplier; + componentSize.width *= zoomMultiplier; + componentSize.height *= zoomMultiplier; + } + amount++; + } + sceneAnimator.animateZoomFactor(zoom); + } + } else { + double zoom = scene.getZoomFactor(); + while (amount > 0 && zoom / zoomMultiplier >= minFactor) { + zoom /= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x /= zoomMultiplier; + viewPosition.y /= zoomMultiplier; + bounds.width /= zoomMultiplier; + bounds.height /= zoomMultiplier; + componentSize.width /= zoomMultiplier; + componentSize.height /= zoomMultiplier; + } + amount--; + } + while (amount < 0 && zoom * zoomMultiplier <= maxFactor) { + zoom *= zoomMultiplier; + if (viewPosition != null) { + viewPosition.x *= zoomMultiplier; + viewPosition.y *= zoomMultiplier; + bounds.width *= zoomMultiplier; + bounds.height *= zoomMultiplier; + componentSize.width *= zoomMultiplier; + componentSize.height *= zoomMultiplier; + } + amount++; + } + scene.setZoomFactor(zoom); + } + + if (scrollPane != null) { + viewPosition.x -= xOffset; + viewPosition.y -= yOffset; + scrollPane.getViewport().setViewPosition(viewPosition); + } + + + return WidgetAction.State.CONSUMED; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties new file mode 100644 index 00000000000..4593549d591 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/Bundle.properties @@ -0,0 +1,3 @@ +HINT_EditorTopComponent=This is a Editor window +OpenIDE-Module-Name=View +CTL_EditorTopComponent=Editor Window diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ConnectionAnchor.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ConnectionAnchor.java new file mode 100644 index 00000000000..3ede4ba1731 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ConnectionAnchor.java @@ -0,0 +1,84 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import com.sun.hotspot.igv.view.widgets.SlotWidget; +import java.awt.Point; +import java.awt.Rectangle; +import org.netbeans.api.visual.anchor.Anchor; +import org.netbeans.api.visual.anchor.Anchor.Entry; +import org.netbeans.api.visual.anchor.Anchor.Result; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class ConnectionAnchor extends Anchor { + + public enum HorizontalAlignment { + + Left, + Center, + Right + } + private HorizontalAlignment alignment; + + public ConnectionAnchor(Widget widget) { + this(HorizontalAlignment.Center, widget); + } + + public ConnectionAnchor(HorizontalAlignment alignment, Widget widget) { + super(widget); + this.alignment = alignment; + } + + public Result compute(Entry entry) { + return new Result(getRelatedSceneLocation(), Anchor.DIRECTION_ANY); + } + + @Override + public Point getRelatedSceneLocation() { + Point p = null; + Widget w = getRelatedWidget(); + if (w != null) { + if (w instanceof SlotWidget) { + p = ((SlotWidget) w).getAnchorPosition(); + } else { + Rectangle r = w.convertLocalToScene(w.getBounds()); + int y = r.y + r.height / 2; + int x = r.x; + if (alignment == HorizontalAlignment.Center) { + x = r.x + r.width / 2; + } else if (alignment == HorizontalAlignment.Right) { + x = r.x + r.width; + } + + p = new Point(x, y); + } + } + + return p; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java new file mode 100644 index 00000000000..2ee3067acfe --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java @@ -0,0 +1,1254 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import com.sun.hotspot.igv.view.widgets.BlockWidget; +import com.sun.hotspot.igv.view.widgets.LineWidget; +import com.sun.hotspot.igv.util.DoubleClickAction; +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Slot; +import com.sun.hotspot.igv.hierarchicallayout.HierarchicalClusterLayoutManager; +import com.sun.hotspot.igv.hierarchicallayout.OldHierarchicalLayoutManager; +import com.sun.hotspot.igv.hierarchicallayout.HierarchicalLayoutManager; +import com.sun.hotspot.igv.view.widgets.FigureWidget; +import com.sun.hotspot.igv.view.widgets.InputSlotWidget; +import com.sun.hotspot.igv.view.widgets.OutputSlotWidget; +import com.sun.hotspot.igv.view.widgets.SlotWidget; +import com.sun.hotspot.igv.layout.LayoutGraph; +import com.sun.hotspot.igv.data.services.Scheduler; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.graph.Block; +import com.sun.hotspot.igv.util.ColorIcon; +import com.sun.hotspot.igv.util.ExtendedSelectAction; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.UndoableEditEvent; +import javax.swing.undo.AbstractUndoableEdit; +import javax.swing.undo.CannotRedoException; +import javax.swing.undo.CannotUndoException; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.PopupMenuProvider; +import org.netbeans.api.visual.action.RectangularSelectDecorator; +import org.netbeans.api.visual.action.RectangularSelectProvider; +import org.netbeans.api.visual.action.SelectProvider; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.animator.SceneAnimator; +import org.netbeans.api.visual.layout.LayoutFactory; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.netbeans.api.visual.widget.LayerWidget; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.widget.LabelWidget; +import org.openide.awt.UndoRedo; +import org.openide.util.Lookup; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; + +/** + * + * @author Thomas Wuerthinger + */ +public class DiagramScene extends Scene implements ChangedListener { + + private Hashtable figureWidgets; + private Hashtable slotWidgets; + private Hashtable connectionWidgets; + private Hashtable blockWidgets; + private Widget hoverWidget; + private WidgetAction hoverAction; + private List selectedWidgets; + private Lookup lookup; + private InstanceContent content; + private Action[] actions; + private LayerWidget connectionLayer; + private JScrollPane scrollPane; + private UndoRedo.Manager undoRedoManager; + private LayerWidget mainLayer; + private LayerWidget slotLayer; + private LayerWidget blockLayer; + private double realZoomFactor; + private BoundedZoomAction zoomAction; + private WidgetAction panAction; + private Widget topLeft; + private Widget bottomRight; + private LayerWidget startLayer; + private LabelWidget startLabel; + private DiagramViewModel model; + private DiagramViewModel modelCopy; + public static final int AFTER = 1; + public static final int BEFORE = 1; + public static final float ALPHA = 0.4f; + public static final int GRID_SIZE = 30; + public static final int BORDER_SIZE = 20; + public static final int UNDOREDO_LIMIT = 100; + public static final int SCROLL_UNIT_INCREMENT = 80; + public static final int SCROLL_BLOCK_INCREMENT = 400; + public static final float ZOOM_MAX_FACTOR = 3.0f; + public static final float ZOOM_MIN_FACTOR = 0.0f;//0.15f; + public static final float ZOOM_INCREMENT = 1.5f; + public static final int SLOT_OFFSET = 6; + public static final int ANIMATION_LIMIT = 40; + private PopupMenuProvider popupMenuProvider = new PopupMenuProvider() { + + public JPopupMenu getPopupMenu(Widget widget, Point localLocation) { + return DiagramScene.this.createPopupMenu(); + } + }; + private RectangularSelectDecorator rectangularSelectDecorator = new RectangularSelectDecorator() { + + public Widget createSelectionWidget() { + Widget widget = new Widget(DiagramScene.this); + widget.setBorder(BorderFactory.createLineBorder(Color.black, 2)); + widget.setForeground(Color.red); + return widget; + } + }; + private RectangularSelectProvider rectangularSelectProvider = new RectangularSelectProvider() { + + public void performSelection(Rectangle rectangle) { + if (rectangle.width < 0) { + rectangle.x += rectangle.width; + rectangle.width *= -1; + } + + if (rectangle.height < 0) { + rectangle.y += rectangle.height; + rectangle.height *= -1; + } + + boolean updated = false; + for (Figure f : getModel().getDiagramToView().getFigures()) { + FigureWidget w = figureWidgets.get(f); + Rectangle r = new Rectangle(w.getBounds()); + r.setLocation(w.getLocation()); + if (r.intersects(rectangle)) { + if (!selectedWidgets.contains(w)) { + addToSelection(w); + updated = true; + } + } else { + if (selectedWidgets.contains(w)) { + selectedWidgets.remove(w); + content.remove(w.getNode()); + w.setState(w.getState().deriveSelected(false)); + updated = true; + } + } + } + + if (updated) { + selectionUpdated(); + } + } + }; + private SelectProvider selectProvider = new SelectProvider() { + + public boolean isAimingAllowed(Widget widget, Point point, boolean b) { + return false; + } + + public boolean isSelectionAllowed(Widget widget, Point point, boolean b) { + return widget instanceof FigureWidget || widget == DiagramScene.this; + } + + public void select(Widget w, Point point, boolean change) { + + boolean updated = false; + + if (w == DiagramScene.this) { + if (DiagramScene.this.selectedWidgets.size() != 0) { + clearSelection(); + selectionUpdated(); + } + return; + } + + FigureWidget widget = (FigureWidget) w; + + + if (change) { + if (widget.getState().isSelected()) { + assert selectedWidgets.contains(widget); + widget.setState(widget.getState().deriveSelected(false)); + selectedWidgets.remove(widget); + content.remove(widget.getNode()); + updated = true; + } else { + assert !selectedWidgets.contains(widget); + addToSelection(widget); + updated = true; + assert widget.getState().isSelected(); + } + } else { + + if (widget.getState().isSelected()) { + assert selectedWidgets.contains(widget); + } else { + + assert !selectedWidgets.contains(widget); + clearSelection(); + addToSelection(widget); + updated = true; + assert widget.getState().isSelected(); + } + } + + if (updated) { + selectionUpdated(); + } + + } + }; + + private FigureWidget getFigureWidget(Figure f) { + return figureWidgets.get(f); + } + private FocusListener focusListener = new FocusListener() { + + public void focusGained(FocusEvent e) { + DiagramScene.this.getView().requestFocus(); + } + + public void focusLost(FocusEvent e) { + } + }; + private MouseWheelListener mouseWheelListener = new MouseWheelListener() { + + public void mouseWheelMoved(MouseWheelEvent e) { + DiagramScene.this.zoomAction.mouseWheelMoved(DiagramScene.this, new WidgetAction.WidgetMouseWheelEvent(0, e)); + DiagramScene.this.validate(); + } + }; + private MouseListener mouseListener = new MouseListener() { + + public void mouseClicked(MouseEvent e) { + DiagramScene.this.panAction.mouseClicked(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + + public void mousePressed(MouseEvent e) { + DiagramScene.this.panAction.mousePressed(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + + public void mouseReleased(MouseEvent e) { + DiagramScene.this.panAction.mouseReleased(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + + public void mouseEntered(MouseEvent e) { + DiagramScene.this.panAction.mouseEntered(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + + public void mouseExited(MouseEvent e) { + DiagramScene.this.panAction.mouseExited(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + }; + private MouseMotionListener mouseMotionListener = new MouseMotionListener() { + + public void mouseDragged(MouseEvent e) { + DiagramScene.this.panAction.mouseDragged(DiagramScene.this, new WidgetAction.WidgetMouseEvent(0, e)); + } + + public void mouseMoved(MouseEvent e) { + } + }; + private ScrollChangeListener scrollChangeListener = new ScrollChangeListener(); + + private class ScrollChangeListener implements ChangeListener { + + private Map relativePositions = new HashMap(); + private Point oldPosition; + + public void register(Widget w, Point p) { + relativePositions.put(w, p); + } + + public void unregister(Widget w) { + relativePositions.remove(w); + } + + public void stateChanged(ChangeEvent e) { + Point p = DiagramScene.this.getScrollPane().getViewport().getViewPosition(); + if (oldPosition == null || !p.equals(oldPosition)) { + for (Widget w : relativePositions.keySet()) { + Point curPoint = relativePositions.get(w); + Point newPoint = new Point(p.x + curPoint.x, p.y + curPoint.y); + w.setPreferredLocation(newPoint); + DiagramScene.this.validate(); + } + oldPosition = p; + } + } + } + + public Point getScrollPosition() { + return getScrollPane().getViewport().getViewPosition(); + } + + public void setScrollPosition(Point p) { + getScrollPane().getViewport().setViewPosition(p); + } + + public DiagramScene(Action[] actions, DiagramViewModel model) { + this.actions = actions; + selectedWidgets = new ArrayList(); + content = new InstanceContent(); + lookup = new AbstractLookup(content); + this.setCheckClipping(true); + this.getInputBindings().setZoomActionModifiers(0); + + JComponent comp = this.createView(); + comp.setDoubleBuffered(true); + comp.setBackground(Color.WHITE); + comp.setOpaque(true); + + this.setBackground(Color.WHITE); + this.setOpaque(true); + scrollPane = new JScrollPane(comp); + scrollPane.setBackground(Color.WHITE); + scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT); + scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT); + scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT); + scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT); + scrollPane.getViewport().addChangeListener(scrollChangeListener); + hoverAction = this.createWidgetHoverAction(); + + blockLayer = new LayerWidget(this); + this.addChild(blockLayer); + + startLayer = new LayerWidget(this); + this.addChild(startLayer); + // TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections..."; + String startLabelString = ""; + LabelWidget w = new LabelWidget(this, startLabelString); + scrollChangeListener.register(w, new Point(10, 10)); + w.setAlignment(LabelWidget.Alignment.CENTER); + startLabel = w; + startLayer.addChild(w); + + mainLayer = new LayerWidget(this); + this.addChild(mainLayer); + + topLeft = new Widget(this); + topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE)); + this.addChild(topLeft); + + + bottomRight = new Widget(this); + bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE)); + this.addChild(bottomRight); + + slotLayer = new LayerWidget(this); + this.addChild(slotLayer); + + connectionLayer = new LayerWidget(this); + this.addChild(connectionLayer); + + LayerWidget selectionLayer = new LayerWidget(this); + this.addChild(selectionLayer); + + this.setLayout(LayoutFactory.createAbsoluteLayout()); + + this.getActions().addAction(hoverAction); + zoomAction = new BoundedZoomAction(1.1, false); + zoomAction.setMaxFactor(ZOOM_MAX_FACTOR); + zoomAction.setMinFactor(ZOOM_MIN_FACTOR); + this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1)); + panAction = new ExtendedPanAction(); + this.getActions().addAction(panAction); + this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider)); + + LayerWidget selectLayer = new LayerWidget(this); + this.addChild(selectLayer); + this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider)); + + blockWidgets = new Hashtable(); + + boolean b = this.getUndoRedoEnabled(); + this.setUndoRedoEnabled(false); + this.setNewModel(model); + this.setUndoRedoEnabled(b); + } + + private void selectionUpdated() { + getModel().setSelectedNodes(this.getSelectedNodes()); + addUndo(); + } + + public DiagramViewModel getModel() { + return model; + } + + public void setRealZoomFactor(double d) { + this.realZoomFactor = d; + } + + public double getRealZoomFactor() { + if (realZoomFactor == 0.0) { + return getZoomFactor(); + } else { + return realZoomFactor; + } + } + + public JScrollPane getScrollPane() { + return scrollPane; + } + + public boolean isAllVisible() { + return getModel().getHiddenNodes().size() == 0; + } + + public Action createGotoAction(final Figure f) { + final DiagramScene diagramScene = this; + Action a = new AbstractAction() { + + public void actionPerformed(ActionEvent e) { + diagramScene.gotoFigure(f); + } + }; + + a.setEnabled(true); + a.putValue(Action.SMALL_ICON, new ColorIcon(f.getColor())); + String name = f.getLines()[0]; + + name += " ("; + + if (f.getCluster() != null) { + name += "B" + f.getCluster().toString(); + } + if (!this.getFigureWidget(f).isVisible()) { + if (f.getCluster() != null) { + name += ", "; + } + name += "hidden"; + } + name += ")"; + a.putValue(Action.NAME, name); + return a; + } + + public void setNewModel(DiagramViewModel model) { + if (this.model != null) { + this.model.getDiagramChangedEvent().removeListener(this); + this.model.getViewPropertiesChangedEvent().removeListener(this); + } + this.model = model; + + if (this.model == null) { + this.modelCopy = null; + } else { + this.modelCopy = this.model.copy(); + } + + model.getDiagramChangedEvent().addListener(this); + model.getViewPropertiesChangedEvent().addListener(this); + + update(); + } + + private void update() { + + /*if (startLabel != null) { + // Animate fade-out + final LabelWidget labelWidget = this.startLabel; + labelWidget.setVisible(true); + RequestProcessor.getDefault().post(new Runnable() { + public void run() { + final int Sleep = 200; + final int Progress = 10; + for (int i = 0; i < 255 / Progress + 1; i++) { + try { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + Color c = labelWidget.getForeground(); + int v = c.getRed(); + v += Progress; + if (v > 255) { + v = 255; + } + labelWidget.setForeground(new Color(v, v, v, 255 - v)); + labelWidget.getScene().validate(); + } + }); + } catch (InterruptedException ex) { + } catch (InvocationTargetException ex) { + } + try { + Thread.sleep(Sleep); + } catch (InterruptedException ex) { + } + } + labelWidget.setVisible(false); + DiagramScene.this.scrollChangeListener.unregister(labelWidget); + } + }, 1000); + startLabel = null; + }*/ + + slotLayer.removeChildren(); + mainLayer.removeChildren(); + blockLayer.removeChildren(); + + blockWidgets.clear(); + figureWidgets = new Hashtable(); + slotWidgets = new Hashtable(); + connectionWidgets = new Hashtable(); + + WidgetAction selectAction = new ExtendedSelectAction(selectProvider); + Diagram d = getModel().getDiagramToView(); + + if (getModel().getShowBlocks()) { + Scheduler s = Lookup.getDefault().lookup(Scheduler.class); + Collection newBlocks = new ArrayList(s.schedule(d.getGraph())); + d.schedule(newBlocks); + } + + for (Figure f : d.getFigures()) { + FigureWidget w = new FigureWidget(f, this, mainLayer); + w.getActions().addAction(selectAction); + w.getActions().addAction(hoverAction); + w.getActions().addAction(ActionFactory.createPopupMenuAction(w)); + w.getActions().addAction(new DoubleClickAction(w)); + w.setVisible(false); + + figureWidgets.put(f, w); + + for (InputSlot s : f.getInputSlots()) { + SlotWidget sw = new InputSlotWidget(s, this, slotLayer, w); + slotWidgets.put(s, sw); + sw.getActions().addAction(selectAction); + } + + for (OutputSlot s : f.getOutputSlots()) { + SlotWidget sw = new OutputSlotWidget(s, this, slotLayer, w); + slotWidgets.put(s, sw); + sw.getActions().addAction(selectAction); + } + } + + if (getModel().getShowBlocks()) { + for (InputBlock bn : d.getGraph().getBlocks()) { + BlockWidget w = new BlockWidget(this, d, bn); + w.setVisible(false); + blockWidgets.put(bn, w); + blockLayer.addChild(w); + } + } + + this.smallUpdate(true); + + } + + private void smallUpdate(boolean relayout) { + + this.updateHiddenNodes(model.getHiddenNodes(), relayout); + boolean b = this.getUndoRedoEnabled(); + this.setUndoRedoEnabled(false); + this.setSelection(getModel().getSelectedNodes()); + this.setUndoRedoEnabled(b); + this.validate(); + } + + private boolean isVisible(Connection c) { + FigureWidget w1 = figureWidgets.get(c.getInputSlot().getFigure()); + FigureWidget w2 = figureWidgets.get(c.getOutputSlot().getFigure()); + + if (w1.isVisible() && w2.isVisible()) { + return true; + } + + return false; + } + + private void relayout(Set oldVisibleWidgets) { + + Diagram diagram = getModel().getDiagramToView(); + + HashSet
    figures = new HashSet
    (); + + for (Figure f : diagram.getFigures()) { + FigureWidget w = figureWidgets.get(f); + if (w.isVisible()) { + figures.add(f); + } + } + + HashSet edges = new HashSet(); + + for (Connection c : diagram.getConnections()) { + if (isVisible(c)) { + edges.add(c); + } + } + + if (getModel().getShowBlocks()) { + HierarchicalClusterLayoutManager m = new HierarchicalClusterLayoutManager(OldHierarchicalLayoutManager.Combine.SAME_OUTPUTS); + HierarchicalLayoutManager manager = new HierarchicalLayoutManager(HierarchicalLayoutManager.Combine.SAME_OUTPUTS); + manager.setMaxLayerLength(9); + manager.setMinLayerDifference(3); + m.setManager(manager); + m.setSubManager(new HierarchicalLayoutManager(HierarchicalLayoutManager.Combine.SAME_OUTPUTS)); + m.doLayout(new LayoutGraph(edges, figures)); + + } else { + HierarchicalLayoutManager manager = new HierarchicalLayoutManager(HierarchicalLayoutManager.Combine.SAME_OUTPUTS); + manager.setMaxLayerLength(10); + manager.doLayout(new LayoutGraph(edges, figures)); + } + + int maxX = -BORDER_SIZE; + int maxY = -BORDER_SIZE; + for (Figure f : diagram.getFigures()) { + FigureWidget w = figureWidgets.get(f); + if (w.isVisible()) { + Point p = f.getPosition(); + Dimension d = f.getSize(); + maxX = Math.max(maxX, p.x + d.width); + maxY = Math.max(maxY, p.y + d.height); + } + } + + for (Connection c : diagram.getConnections()) { + List points = c.getControlPoints(); + FigureWidget w1 = figureWidgets.get((Figure) c.getTo().getVertex()); + FigureWidget w2 = figureWidgets.get((Figure) c.getFrom().getVertex()); + if (w1.isVisible() && w2.isVisible()) { + for (Point p : points) { + if (p != null) { + maxX = Math.max(maxX, p.x); + maxY = Math.max(maxY, p.y); + } + } + } + } + + if (getModel().getShowBlocks()) { + for (Block b : diagram.getBlocks()) { + BlockWidget w = blockWidgets.get(b.getInputBlock()); + if (w != null && w.isVisible()) { + Rectangle r = b.getBounds(); + maxX = Math.max(maxX, r.x + r.width); + maxY = Math.max(maxY, r.y + r.height); + } + } + } + + bottomRight.setPreferredLocation(new Point(maxX + BORDER_SIZE, maxY + BORDER_SIZE)); + int offx = 0; + int offy = 0; + int curWidth = maxX + 2 * BORDER_SIZE; + int curHeight = maxY + 2 * BORDER_SIZE; + + Rectangle bounds = this.getScrollPane().getBounds(); + if (curWidth < bounds.width) { + offx = (bounds.width - curWidth) / 2; + } + + if (curHeight < bounds.height) { + offy = (bounds.height - curHeight) / 2; + } + + final int offx2 = offx; + final int offy2 = offy; + + SceneAnimator animator = this.getSceneAnimator(); + connectionLayer.removeChildren(); + int visibleFigureCount = 0; + for (Figure f : diagram.getFigures()) { + if (figureWidgets.get(f).isVisible()) { + visibleFigureCount++; + } + } + + for (Figure f : diagram.getFigures()) { + for (OutputSlot s : f.getOutputSlots()) { + SceneAnimator anim = animator; + if (visibleFigureCount > ANIMATION_LIMIT) { + anim = null; + } + processOutputSlot(s, s.getConnections(), 0, null, null, offx2, offy2, anim); + } + } + + for (Figure f : diagram.getFigures()) { + FigureWidget w = figureWidgets.get(f); + if (w.isVisible()) { + Point p = f.getPosition(); + Point p2 = new Point(p.x + offx2, p.y + offy2); + Rectangle r = new Rectangle(p.x + offx2, p.y + offy2, f.getSize().width, f.getSize().height); + if (oldVisibleWidgets.contains(w)) { + if (visibleFigureCount > ANIMATION_LIMIT) { + w.setPreferredLocation(p2); + } else { + animator.animatePreferredLocation(w, p2); + } + } else { + w.setPreferredLocation(p2); + } + } + } + + if (getModel().getShowBlocks()) { + for (Block b : diagram.getBlocks()) { + BlockWidget w = blockWidgets.get(b.getInputBlock()); + if (w != null && w.isVisible()) { + Point location = new Point(b.getBounds().x + offx2, b.getBounds().y + offy2); + Rectangle r = new Rectangle(location.x, location.y, b.getBounds().width, b.getBounds().height); + if (oldVisibleWidgets.contains(w)) { + if (visibleFigureCount > ANIMATION_LIMIT) { + w.setPreferredBounds(r); + } else { + animator.animatePreferredBounds(w, r); + } + } else { + w.setPreferredBounds(r); + } + } + } + } + } + private final Point specialNullPoint = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); + + private void processOutputSlot(OutputSlot s, List connections, int controlPointIndex, Point lastPoint, LineWidget predecessor, int offx, int offy, SceneAnimator animator) { + Map> pointMap = new HashMap>(); + + for (Connection c : connections) { + + if (!isVisible(c)) { + continue; + } + + List controlPoints = c.getControlPoints(); + if (controlPointIndex >= controlPoints.size()) { + continue; + } + + Point cur = controlPoints.get(controlPointIndex); + if (cur == null) { + cur = specialNullPoint; + } else if (controlPointIndex == 0 && !s.getShowName()) { + cur = new Point(cur.x, cur.y - SLOT_OFFSET); + } else if (controlPointIndex == controlPoints.size() - 1 && !c.getInputSlot().getShowName()) { + cur = new Point(cur.x, cur.y + SLOT_OFFSET); + } + + if (pointMap.containsKey(cur)) { + pointMap.get(cur).add(c); + } else { + List newList = new ArrayList(2); + newList.add(c); + pointMap.put(cur, newList); + } + + } + + for (Point p : pointMap.keySet()) { + List connectionList = pointMap.get(p); + + boolean isBold = false; + boolean isDashed = true; + + for (Connection c : connectionList) { + + if (c.getStyle() == Connection.ConnectionStyle.BOLD) { + isBold = true; + } + + if (c.getStyle() != Connection.ConnectionStyle.DASHED) { + isDashed = false; + } + } + + LineWidget newPredecessor = predecessor; + if (p == specialNullPoint) { + + } else if (lastPoint == specialNullPoint) { + + } else if (lastPoint != null) { + Point p1 = new Point(lastPoint.x + offx, lastPoint.y + offy); + Point p2 = new Point(p.x + offx, p.y + offy); + LineWidget w = new LineWidget(this, s, connectionList, p1, p2, predecessor, animator, isBold, isDashed); + newPredecessor = w; + connectionLayer.addChild(w); + w.getActions().addAction(hoverAction); + } + + processOutputSlot(s, connectionList, controlPointIndex + 1, p, newPredecessor, offx, offy, animator); + } + } + + private void clearSelection() { + if (selectedWidgets.size() == 0) { + return; + } + for (FigureWidget w : selectedWidgets) { + assert w.getState().isSelected(); + w.setState(w.getState().deriveSelected(false)); + content.remove(w.getNode()); + } + selectedWidgets.clear(); + } + + public Lookup getLookup() { + return lookup; + } + + public void gotoFigures(final List
    figures) { + Rectangle overall = null; + showFigures(figures); + for (Figure f : figures) { + + FigureWidget fw = getFigureWidget(f); + if (fw != null) { + Rectangle r = fw.getBounds(); + Point p = fw.getLocation(); + Rectangle r2 = new Rectangle(p.x, p.y, r.width, r.height); + + if (overall == null) { + overall = r2; + } else { + overall = overall.union(r2); + } + } + } + if (overall != null) { + centerRectangle(overall); + } + } + + private Point calcCenter(Rectangle r) { + + Point center = new Point((int) r.getCenterX(), (int) r.getCenterY()); + center.x -= getScrollPane().getViewport().getViewRect().width / 2; + center.y -= getScrollPane().getViewport().getViewRect().height / 2; + + // Ensure to be within area + center.x = Math.max(0, center.x); + center.x = Math.min(getScrollPane().getViewport().getViewSize().width - getScrollPane().getViewport().getViewRect().width, center.x); + center.y = Math.max(0, center.y); + center.y = Math.min(getScrollPane().getViewport().getViewSize().height - getScrollPane().getViewport().getViewRect().height, center.y); + + return center; + } + + private void centerRectangle(Rectangle r) { + + if (getScrollPane().getViewport().getViewRect().width == 0 || getScrollPane().getViewport().getViewRect().height == 0) { + return; + } + + Rectangle r2 = new Rectangle(r.x, r.y, r.width, r.height); + r2 = convertSceneToView(r2); + + double factorX = (double) r2.width / (double) getScrollPane().getViewport().getViewRect().width; + double factorY = (double) r2.height / (double) getScrollPane().getViewport().getViewRect().height; + double factor = Math.max(factorX, factorY); + if (factor >= 1.0) { + Point p = getScrollPane().getViewport().getViewPosition(); + setZoomFactor(getZoomFactor() / factor); + r2.x /= factor; + r2.y /= factor; + r2.width /= factor; + r2.height /= factor; + getScrollPane().getViewport().setViewPosition(calcCenter(r2)); + } else { + getScrollPane().getViewport().setViewPosition(calcCenter(r2)); + } + } + + private void addToSelection(Figure f) { + FigureWidget w = getFigureWidget(f); + addToSelection(w); + } + + private void addToSelection(FigureWidget w) { + assert !selectedWidgets.contains(w); + selectedWidgets.add(w); + content.add(w.getNode()); + w.setState(w.getState().deriveSelected(true)); + } + + private void setSelection(Set nodes) { + clearSelection(); + for (Figure f : getModel().getDiagramToView().getFigures()) { + if (doesIntersect(f.getSource().getSourceNodesAsSet(), nodes)) { + addToSelection(f); + } + } + selectionUpdated(); + this.validate(); + } + + public void setSelection(Collection
    list) { + clearSelection(); + for (Figure f : list) { + addToSelection(f); + } + + selectionUpdated(); + this.validate(); + } + + public Set
    getSelectedFigures() { + Set
    result = new HashSet
    (); + for (Widget w : selectedWidgets) { + if (w instanceof FigureWidget) { + FigureWidget fw = (FigureWidget) w; + if (fw.getState().isSelected()) { + result.add(fw.getFigure()); + } + } + } + return result; + } + + public Set getSelectedNodes() { + Set result = new HashSet(); + for (Widget w : selectedWidgets) { + if (w instanceof FigureWidget) { + FigureWidget fw = (FigureWidget) w; + if (fw.getState().isSelected()) { + result.addAll(fw.getFigure().getSource().getSourceNodesAsSet()); + } + } + } + return result; + } + + private UndoRedo.Manager getUndoRedoManager() { + if (undoRedoManager == null) { + undoRedoManager = new UndoRedo.Manager(); + undoRedoManager.setLimit(UNDOREDO_LIMIT); + } + + return undoRedoManager; + } + + public UndoRedo getUndoRedo() { + return getUndoRedoManager(); + } + + private boolean isVisible(Figure f) { + for (Integer n : f.getSource().getSourceNodesAsSet()) { + if (getModel().getHiddenNodes().contains(n)) { + return false; + } + } + return true; + } + + private boolean doesIntersect(Set s1, Set s2) { + if (s1.size() > s2.size()) { + Set tmp = s1; + s1 = s2; + s2 = tmp; + } + + for (Object o : s1) { + if (s2.contains(o)) { + return true; + } + } + + return false; + } + + public void showNot(final Set nodes) { + updateHiddenNodes(nodes, true); + } + + public void showOnly(final Set nodes) { + HashSet allNodes = new HashSet(getModel().getGraphToView().getGroup().getAllNodes()); + allNodes.removeAll(nodes); + updateHiddenNodes(allNodes, true); + } + + private void updateHiddenNodes(Set newHiddenNodes, boolean doRelayout) { + + Set visibleBlocks = new HashSet(); + + Diagram diagram = getModel().getDiagramToView(); + assert diagram != null; + + Set oldVisibleWidgets = new HashSet(); + + for (Figure f : diagram.getFigures()) { + FigureWidget w = figureWidgets.get(f); + if (w.isVisible()) { + oldVisibleWidgets.add(w); + } + } + + if (getModel().getShowBlocks()) { + for (InputBlock b : diagram.getGraph().getBlocks()) { + BlockWidget w = blockWidgets.get(b); + if (w.isVisible()) { + oldVisibleWidgets.add(w); + } + } + } + + for (Figure f : diagram.getFigures()) { + boolean hiddenAfter = doesIntersect(f.getSource().getSourceNodesAsSet(), newHiddenNodes); + + FigureWidget w = this.figureWidgets.get(f); + w.setBoundary(false); + if (!hiddenAfter) { + // Figure is shown + w.setVisible(true); + for (InputNode n : f.getSource().getSourceNodes()) { + visibleBlocks.add(diagram.getGraph().getBlock(n)); + } + } else { + // Figure is hidden + w.setVisible(false); + } + } + + if (getModel().getShowNodeHull()) { + List boundaries = new ArrayList(); + for (Figure f : diagram.getFigures()) { + FigureWidget w = this.figureWidgets.get(f); + if (!w.isVisible()) { + Set
    set = new HashSet
    (f.getPredecessorSet()); + set.addAll(f.getSuccessorSet()); + + boolean b = false; + for (Figure neighbor : set) { + FigureWidget neighborWidget = figureWidgets.get(neighbor); + if (neighborWidget.isVisible()) { + b = true; + break; + } + } + + if (b) { + w.setBoundary(true); + for (InputNode n : f.getSource().getSourceNodes()) { + visibleBlocks.add(diagram.getGraph().getBlock(n)); + } + boundaries.add(w); + } + } + } + + for (FigureWidget w : boundaries) { + if (w.isBoundary()) { + w.setVisible(true); + } + } + } + + if (getModel().getShowBlocks()) { + for (InputBlock b : diagram.getGraph().getBlocks()) { + + boolean visibleAfter = visibleBlocks.contains(b); + + BlockWidget w = blockWidgets.get(b); + if (visibleAfter) { + // Block must be shown + w.setVisible(true); + } else { + // Block must be hidden + w.setVisible(false); + } + } + } + + getModel().setHiddenNodes(newHiddenNodes); + if (doRelayout) { + relayout(oldVisibleWidgets); + } + this.validate(); + addUndo(); + } + + private void showFigures(Collection
    f) { + HashSet newHiddenNodes = new HashSet(getModel().getHiddenNodes()); + for (Figure fig : f) { + newHiddenNodes.removeAll(fig.getSource().getSourceNodesAsSet()); + } + updateHiddenNodes(newHiddenNodes, true); + } + + private void showFigure(Figure f) { + HashSet newHiddenNodes = new HashSet(getModel().getHiddenNodes()); + newHiddenNodes.removeAll(f.getSource().getSourceNodesAsSet()); + updateHiddenNodes(newHiddenNodes, true); + } + + public void showAll(final Collection
    f) { + showFigures(f); + + } + + public void show(final Figure f) { + showFigure(f); + } + + public void gotoFigure(final Figure f) { + + if (!isVisible(f)) { + showFigure(f); + } + + FigureWidget fw = getFigureWidget(f); + if (fw != null) { + Rectangle r = fw.getBounds(); + Point p = fw.getLocation(); + centerRectangle(new Rectangle(p.x, p.y, r.width, r.height)); + + // Select figure + clearSelection(); + addToSelection(fw); + selectionUpdated(); + } + } + + public JPopupMenu createPopupMenu() { + JPopupMenu menu = new JPopupMenu(); + for (Action a : actions) { + if (a == null) { + menu.addSeparator(); + } else { + menu.add(a); + } + } + return menu; + } + + private static class DiagramUndoRedo extends AbstractUndoableEdit implements ChangedListener { + + private DiagramViewModel oldModel; + private DiagramViewModel newModel; + private Point oldScrollPosition; + private DiagramScene scene; + + public DiagramUndoRedo(DiagramScene scene, Point oldScrollPosition, DiagramViewModel oldModel, DiagramViewModel newModel) { + assert oldModel != null; + assert newModel != null; + this.oldModel = oldModel; + this.newModel = newModel; + this.scene = scene; + this.oldScrollPosition = oldScrollPosition; + } + + @Override + public void redo() throws CannotRedoException { + super.redo(); + boolean b = scene.getUndoRedoEnabled(); + scene.setUndoRedoEnabled(false); + scene.getModel().getViewChangedEvent().addListener(this); + scene.getModel().setData(newModel); + scene.getModel().getViewChangedEvent().removeListener(this); + scene.setUndoRedoEnabled(b); + } + + @Override + public void undo() throws CannotUndoException { + super.undo(); + boolean b = scene.getUndoRedoEnabled(); + scene.setUndoRedoEnabled(false); + scene.getModel().getViewChangedEvent().addListener(this); + scene.getModel().setData(oldModel); + scene.getModel().getViewChangedEvent().removeListener(this); + + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + scene.setScrollPosition(oldScrollPosition); + } + }); + + scene.setUndoRedoEnabled(b); + } + + public void changed(DiagramViewModel source) { + scene.getModel().getViewChangedEvent().removeListener(this); + if (oldModel.getSelectedNodes().equals(newModel.getHiddenNodes())) { + scene.smallUpdate(false); + } else { + scene.smallUpdate(true); + } + } + } + private boolean undoRedoEnabled = true; + + public void setUndoRedoEnabled(boolean b) { + this.undoRedoEnabled = b; + } + + public boolean getUndoRedoEnabled() { + return undoRedoEnabled; + } + + public void changed(DiagramViewModel source) { + assert source == model : "Receive only changed event from current model!"; + assert source != null; + update(); + } + + private void addUndo() { + + DiagramViewModel newModelCopy = model.copy(); + + if (undoRedoEnabled) { + this.getUndoRedoManager().undoableEditHappened(new UndoableEditEvent(this, new DiagramUndoRedo(this, this.getScrollPosition(), modelCopy, newModelCopy))); + } + + this.modelCopy = newModelCopy; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java new file mode 100644 index 00000000000..e374873b584 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramViewModel.java @@ -0,0 +1,303 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.view; + +import com.sun.hotspot.igv.data.Group; +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.difference.Difference; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.data.ChangedEvent; +import com.sun.hotspot.igv.util.RangeSliderModel; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.settings.Settings; +import java.awt.Color; + +/** + * + * @author Thomas Wuerthinger + */ +public class DiagramViewModel extends RangeSliderModel implements ChangedListener { + + // Warning: Update setData method if fields are added + private Group group; + private Set hiddenNodes; + private Set onScreenNodes; + private Set selectedNodes; + private FilterChain filterChain; + private FilterChain sequenceFilterChain; + private Diagram diagram; + private ChangedEvent diagramChangedEvent; + private ChangedEvent viewChangedEvent; + private ChangedEvent viewPropertiesChangedEvent; + private boolean showBlocks; + private boolean showNodeHull; + private ChangedListener filterChainChangedListener = new ChangedListener() { + + public void changed(FilterChain source) { + diagramChanged(); + } + }; + + public DiagramViewModel copy() { + DiagramViewModel result = new DiagramViewModel(group, filterChain, sequenceFilterChain); + result.setData(this); + return result; + } + + public void setData(DiagramViewModel newModel) { + super.setData(newModel); + boolean diagramChanged = false; + boolean viewChanged = false; + boolean viewPropertiesChanged = false; + + this.group = newModel.group; + diagramChanged |= (filterChain != newModel.filterChain); + this.filterChain = newModel.filterChain; + diagramChanged |= (sequenceFilterChain != newModel.sequenceFilterChain); + this.sequenceFilterChain = newModel.sequenceFilterChain; + diagramChanged |= (diagram != newModel.diagram); + this.diagram = newModel.diagram; + viewChanged |= (hiddenNodes != newModel.hiddenNodes); + this.hiddenNodes = newModel.hiddenNodes; + viewChanged |= (onScreenNodes != newModel.onScreenNodes); + this.onScreenNodes = newModel.onScreenNodes; + viewChanged |= (selectedNodes != newModel.selectedNodes); + this.selectedNodes = newModel.selectedNodes; + viewPropertiesChanged |= (showBlocks != newModel.showBlocks); + this.showBlocks = newModel.showBlocks; + viewPropertiesChanged |= (showNodeHull != newModel.showNodeHull); + this.showNodeHull = newModel.showNodeHull; + + if (diagramChanged) { + diagramChangedEvent.fire(); + } + if (viewPropertiesChanged) { + viewPropertiesChangedEvent.fire(); + } + if (viewChanged) { + viewChangedEvent.fire(); + } + } + + public boolean getShowBlocks() { + return showBlocks; + } + + public void setShowBlocks(boolean b) { + showBlocks = b; + viewPropertiesChangedEvent.fire(); + } + + public boolean getShowNodeHull() { + return showNodeHull; + } + + public void setShowNodeHull(boolean b) { + showNodeHull = b; + viewPropertiesChangedEvent.fire(); + } + + public DiagramViewModel(Group g, FilterChain filterChain, FilterChain sequenceFilterChain) { + super(calculateStringList(g)); + + this.showNodeHull = true; + this.showBlocks = true; + this.group = g; + assert filterChain != null; + this.filterChain = filterChain; + assert sequenceFilterChain != null; + this.sequenceFilterChain = sequenceFilterChain; + hiddenNodes = new HashSet(); + onScreenNodes = new HashSet(); + selectedNodes = new HashSet(); + super.getChangedEvent().addListener(this); + diagramChangedEvent = new ChangedEvent(this); + viewChangedEvent = new ChangedEvent(this); + viewPropertiesChangedEvent = new ChangedEvent(this); + + filterChain.getChangedEvent().addListener(filterChainChangedListener); + sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); + } + + public ChangedEvent getDiagramChangedEvent() { + return diagramChangedEvent; + } + + public ChangedEvent getViewChangedEvent() { + return viewChangedEvent; + } + + public ChangedEvent getViewPropertiesChangedEvent() { + return viewPropertiesChangedEvent; + } + + public Set getSelectedNodes() { + return Collections.unmodifiableSet(selectedNodes); + } + + public Set getHiddenNodes() { + return Collections.unmodifiableSet(hiddenNodes); + } + + public Set getOnScreenNodes() { + return Collections.unmodifiableSet(onScreenNodes); + } + + public void setSelectedNodes(Set nodes) { + this.selectedNodes = nodes; + List colors = new ArrayList(); + for (String s : getPositions()) { + colors.add(Color.black); + } + if (nodes.size() >= 1) { + for (Integer id : nodes) { + if (id < 0) { + id = -id; + } + InputNode last = null; + int index = 0; + for (InputGraph g : group.getGraphs()) { + Color curColor = colors.get(index); + InputNode cur = g.getNode(id); + if (cur != null) { + if (last == null) { + curColor = Color.green; + } else { + if (last.equals(cur)) { + if (curColor == Color.black) { + curColor = Color.white; + } + } else { + if (curColor != Color.green) { + curColor = Color.orange; + } + } + } + } + last = cur; + colors.set(index, curColor); + index++; + } + } + this.setColors(colors); + } + setColors(colors); + viewChangedEvent.fire(); + } + + public void setHiddenNodes(Set nodes) { + this.hiddenNodes = nodes; + viewChangedEvent.fire(); + } + + public void setOnScreenNodes(Set onScreenNodes) { + this.onScreenNodes = onScreenNodes; + viewChangedEvent.fire(); + } + + public FilterChain getSequenceFilterChain() { + return filterChain; + } + + public void setSequenceFilterChain(FilterChain chain) { + assert chain != null : "sequenceFilterChain must never be null"; + sequenceFilterChain.getChangedEvent().removeListener(filterChainChangedListener); + sequenceFilterChain = chain; + sequenceFilterChain.getChangedEvent().addListener(filterChainChangedListener); + diagramChanged(); + } + + private void diagramChanged() { + // clear diagram + diagram = null; + getDiagramChangedEvent().fire(); + + } + + public FilterChain getFilterChain() { + return filterChain; + } + + public void setFilterChain(FilterChain chain) { + assert chain != null : "filterChain must never be null"; + filterChain.getChangedEvent().removeListener(filterChainChangedListener); + filterChain = chain; + filterChain.getChangedEvent().addListener(filterChainChangedListener); + diagramChanged(); + } + + private static List calculateStringList(Group g) { + List result = new ArrayList(); + for (InputGraph graph : g.getGraphs()) { + result.add(graph.getName()); + } + return result; + } + + public InputGraph getFirstGraph() { + return group.getGraphs().get(getFirstPosition()); + } + + public InputGraph getSecondGraph() { + return group.getGraphs().get(getSecondPosition()); + } + + public void selectGraph(InputGraph g) { + int index = group.getGraphs().indexOf(g); + assert index != -1; + setPositions(index, index); + } + + public Diagram getDiagramToView() { + + if (diagram == null) { + diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT)); + getFilterChain().apply(diagram, getSequenceFilterChain()); + } + + return diagram; + } + + public InputGraph getGraphToView() { + if (getFirstGraph() != getSecondGraph()) { + InputGraph inputGraph = Difference.createDiffGraph(getSecondGraph(), getFirstGraph()); + return inputGraph; + } else { + InputGraph inputGraph = getFirstGraph(); + return inputGraph; + } + } + + public void changed(RangeSliderModel source) { + diagramChanged(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorInputGraphProvider.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorInputGraphProvider.java new file mode 100644 index 00000000000..f1c3f042985 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorInputGraphProvider.java @@ -0,0 +1,52 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.view; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.InputGraphProvider; +import com.sun.hotspot.igv.data.InputNode; +import java.util.Set; + +/** + * + * @author Thomas Wuerthinger + */ +public class EditorInputGraphProvider implements InputGraphProvider { + + public InputGraph getGraph() { + EditorTopComponent e = EditorTopComponent.getActive(); + if (e == null) { + return null; + } + return e.getDiagramModel().getGraphToView(); + } + + public void setSelectedNodes(Set nodes) { + EditorTopComponent e = EditorTopComponent.getActive(); + if (e != null) { + e.setSelectedNodes(nodes); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.form b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.form new file mode 100644 index 00000000000..dc990facd9c --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.form @@ -0,0 +1,31 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java new file mode 100644 index 00000000000..e923544eda1 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/EditorTopComponent.java @@ -0,0 +1,577 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import com.sun.hotspot.igv.data.InputNode; +import com.sun.hotspot.igv.filter.FilterChain; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.view.actions.EnableBlockLayoutAction; +import com.sun.hotspot.igv.view.actions.ExpandPredecessorsAction; +import com.sun.hotspot.igv.view.actions.ExpandSuccessorsAction; +import com.sun.hotspot.igv.view.actions.ExtractAction; +import com.sun.hotspot.igv.view.actions.HideAction; +import com.sun.hotspot.igv.view.actions.NextDiagramAction; +import com.sun.hotspot.igv.view.actions.NodeFindAction; +import com.sun.hotspot.igv.view.actions.OverviewAction; +import com.sun.hotspot.igv.view.actions.PredSuccAction; +import com.sun.hotspot.igv.view.actions.PrevDiagramAction; +import com.sun.hotspot.igv.view.actions.ShowAllAction; +import com.sun.hotspot.igv.view.actions.ZoomInAction; +import com.sun.hotspot.igv.view.actions.ZoomOutAction; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.PropertyMatcher; +import com.sun.hotspot.igv.filter.FilterChainProvider; +import com.sun.hotspot.igv.util.RangeSlider; +import com.sun.hotspot.igv.util.RangeSliderModel; +import com.sun.hotspot.igv.svg.BatikSVG; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.event.HierarchyBoundsListener; +import java.awt.event.HierarchyEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.io.Writer; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.swing.Action; +import javax.swing.ActionMap; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.Border; +import org.openide.DialogDisplayer; +import org.openide.actions.FindAction; +import org.openide.actions.RedoAction; +import org.openide.actions.UndoAction; +import org.openide.awt.Toolbar; +import org.openide.awt.ToolbarPool; +import org.openide.awt.UndoRedo; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallbackSystemAction; +import org.openide.util.actions.SystemAction; +import org.openide.util.lookup.AbstractLookup; +import org.openide.util.lookup.InstanceContent; +import org.openide.util.lookup.ProxyLookup; +import org.openide.windows.Mode; +import org.openide.windows.TopComponent; +import org.openide.windows.WindowManager; +import org.openide.NotifyDescriptor; + +/** + * + * @author Thomas Wuerthinger + */ +public final class EditorTopComponent extends TopComponent implements ChangedListener, PropertyChangeListener { + + private DiagramScene scene; + private InstanceContent content; + private FindPanel findPanel; + private EnableBlockLayoutAction blockLayoutAction; + private OverviewAction overviewAction; + private PredSuccAction predSuccAction; + private boolean notFirstTime; + private ExtendedSatelliteComponent satelliteComponent; + private JPanel centerPanel; + private CardLayout cardLayout; + private RangeSlider rangeSlider; + private JToggleButton overviewButton; + private static final String PREFERRED_ID = "EditorTopComponent"; + private static final String SATELLITE_STRING = "satellite"; + private static final String SCENE_STRING = "scene"; + private DiagramViewModel rangeSliderModel; + private ExportCookie exportCookie = new ExportCookie() { + + public void export(File f) { + + Graphics2D svgGenerator = BatikSVG.createGraphicsObject(); + + if (svgGenerator == null) { + NotifyDescriptor message = new NotifyDescriptor.Message("For export to SVG files the Batik SVG Toolkit must be intalled.", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); + } else { + scene.paint(svgGenerator); + FileOutputStream os = null; + try { + os = new FileOutputStream(f); + Writer out = new OutputStreamWriter(os, "UTF-8"); + BatikSVG.printToStream(svgGenerator, out, true); + } catch (FileNotFoundException e) { + NotifyDescriptor message = new NotifyDescriptor.Message("For export to SVG files the Batik SVG Toolkit must be intalled.", NotifyDescriptor.ERROR_MESSAGE); + DialogDisplayer.getDefault().notifyLater(message); + + } catch (UnsupportedEncodingException e) { + } finally { + if (os != null) { + try { + os.close(); + } catch (IOException e) { + } + } + } + + } + } + }; + + private void updateDisplayName() { + setDisplayName(getDiagram().getName()); + } + + public EditorTopComponent(Diagram diagram) { + + FilterChain filterChain = null; + FilterChain sequence = null; + FilterChainProvider provider = Lookup.getDefault().lookup(FilterChainProvider.class); + if (provider == null) { + filterChain = new FilterChain(); + sequence = new FilterChain(); + } else { + filterChain = provider.getFilterChain(); + sequence = provider.getSequence(); + } + + setName(NbBundle.getMessage(EditorTopComponent.class, "CTL_EditorTopComponent")); + setToolTipText(NbBundle.getMessage(EditorTopComponent.class, "HINT_EditorTopComponent")); + + Action[] actions = new Action[]{ + PrevDiagramAction.get(PrevDiagramAction.class), + NextDiagramAction.get(NextDiagramAction.class), + null, + ExtractAction.get(ExtractAction.class), + ShowAllAction.get(HideAction.class), + ShowAllAction.get(ShowAllAction.class), + null, + ZoomInAction.get(ZoomInAction.class), + ZoomOutAction.get(ZoomOutAction.class), + null, + ExpandPredecessorsAction.get(ExpandPredecessorsAction.class), + ExpandSuccessorsAction.get(ExpandSuccessorsAction.class) + }; + + + initComponents(); + + ActionMap actionMap = getActionMap(); + + ToolbarPool.getDefault().setPreferredIconSize(16); + Toolbar toolBar = new Toolbar(); + Border b = (Border) UIManager.get("Nb.Editor.Toolbar.border"); //NOI18N + toolBar.setBorder(b); + JPanel container = new JPanel(); + this.add(container, BorderLayout.NORTH); + container.setLayout(new BorderLayout()); + container.add(BorderLayout.NORTH, toolBar); + + rangeSliderModel = new DiagramViewModel(diagram.getGraph().getGroup(), filterChain, sequence); + rangeSliderModel.selectGraph(diagram.getGraph()); + rangeSlider = new RangeSlider(); + rangeSlider.setModel(rangeSliderModel); + rangeSliderModel.getChangedEvent().addListener(this); + container.add(BorderLayout.CENTER, rangeSlider); + + scene = new DiagramScene(actions, rangeSliderModel); + content = new InstanceContent(); + this.associateLookup(new ProxyLookup(new Lookup[]{scene.getLookup(), new AbstractLookup(content)})); + content.add(exportCookie); + content.add(rangeSliderModel); + + + findPanel = new FindPanel(diagram.getFigures()); + findPanel.setMaximumSize(new Dimension(200, 50)); + toolBar.add(findPanel); + toolBar.add(NodeFindAction.get(NodeFindAction.class)); + toolBar.addSeparator(); + toolBar.add(NextDiagramAction.get(NextDiagramAction.class)); + toolBar.add(PrevDiagramAction.get(PrevDiagramAction.class)); + toolBar.addSeparator(); + toolBar.add(ExtractAction.get(ExtractAction.class)); + toolBar.add(ShowAllAction.get(HideAction.class)); + toolBar.add(ShowAllAction.get(ShowAllAction.class)); + toolBar.addSeparator(); + toolBar.add(ShowAllAction.get(ZoomInAction.class)); + toolBar.add(ShowAllAction.get(ZoomOutAction.class)); + + blockLayoutAction = new EnableBlockLayoutAction(); + JToggleButton button = new JToggleButton(blockLayoutAction); + button.setSelected(true); + toolBar.add(button); + blockLayoutAction.addPropertyChangeListener(this); + + overviewAction = new OverviewAction(); + overviewButton = new JToggleButton(overviewAction); + overviewButton.setSelected(false); + toolBar.add(overviewButton); + overviewAction.addPropertyChangeListener(this); + + predSuccAction = new PredSuccAction(); + button = new JToggleButton(predSuccAction); + button.setSelected(true); + toolBar.add(button); + predSuccAction.addPropertyChangeListener(this); + + toolBar.addSeparator(); + toolBar.add(UndoAction.get(UndoAction.class)); + toolBar.add(RedoAction.get(RedoAction.class)); + + centerPanel = new JPanel(); + this.add(centerPanel, BorderLayout.CENTER); + cardLayout = new CardLayout(); + centerPanel.setLayout(cardLayout); + centerPanel.add(SCENE_STRING, scene.getScrollPane()); + centerPanel.setBackground(Color.WHITE); + satelliteComponent = new ExtendedSatelliteComponent(scene); + satelliteComponent.setSize(200, 200); + centerPanel.add(SATELLITE_STRING, satelliteComponent); + + CallbackSystemAction callFindAction = (CallbackSystemAction) SystemAction.get(FindAction.class); + NodeFindAction findAction = NodeFindAction.get(NodeFindAction.class); + Object key = callFindAction.getActionMapKey(); + actionMap.put(key, findAction); + + scene.getScrollPane().addKeyListener(keyListener); + scene.getView().addKeyListener(keyListener); + satelliteComponent.addKeyListener(keyListener); + + scene.getScrollPane().addHierarchyBoundsListener(new HierarchyBoundsListener() { + + public void ancestorMoved(HierarchyEvent e) { + } + + public void ancestorResized(HierarchyEvent e) { + if (!notFirstTime && scene.getScrollPane().getBounds().width > 0) { + notFirstTime = true; + SwingUtilities.invokeLater(new Runnable() { + + public void run() { + Figure f = EditorTopComponent.this.scene.getModel().getDiagramToView().getRootFigure(); + if (f != null) { + scene.setUndoRedoEnabled(false); + scene.gotoFigure(f); + scene.setUndoRedoEnabled(true); + } + } + }); + } + } + }); + + updateDisplayName(); + } + private KeyListener keyListener = new KeyListener() { + + public void keyTyped(KeyEvent e) { + } + + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_S) { + EditorTopComponent.this.overviewButton.setSelected(true); + EditorTopComponent.this.overviewAction.setState(true); + } + } + + public void keyReleased(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_S) { + EditorTopComponent.this.overviewButton.setSelected(false); + EditorTopComponent.this.overviewAction.setState(false); + } + } + }; + + public DiagramViewModel getDiagramModel() { + return scene.getModel(); + } + + private void showSatellite() { + cardLayout.show(centerPanel, SATELLITE_STRING); + satelliteComponent.requestFocus(); + + } + + private void showScene() { + cardLayout.show(centerPanel, SCENE_STRING); + scene.getView().requestFocus(); + } + + public void findNode() { + findPanel.find(); + } + + public void zoomOut() { + double zoom = scene.getZoomFactor(); + Point viewPosition = scene.getScrollPane().getViewport().getViewPosition(); + double newZoom = zoom / DiagramScene.ZOOM_INCREMENT; + if (newZoom > DiagramScene.ZOOM_MIN_FACTOR) { + scene.setZoomFactor(newZoom); + scene.validate(); + scene.getScrollPane().getViewport().setViewPosition(new Point((int) (viewPosition.x / DiagramScene.ZOOM_INCREMENT), (int) (viewPosition.y / DiagramScene.ZOOM_INCREMENT))); + this.satelliteComponent.update(); + } + } + + public void zoomIn() { + double zoom = scene.getZoomFactor(); + Point viewPosition = scene.getScrollPane().getViewport().getViewPosition(); + double newZoom = zoom * DiagramScene.ZOOM_INCREMENT; + if (newZoom < DiagramScene.ZOOM_MAX_FACTOR) { + scene.setZoomFactor(newZoom); + scene.validate(); + scene.getScrollPane().getViewport().setViewPosition(new Point((int) (viewPosition.x * DiagramScene.ZOOM_INCREMENT), (int) (viewPosition.y * DiagramScene.ZOOM_INCREMENT))); + this.satelliteComponent.update(); + } + } + + public void showPrevDiagram() { + int fp = getModel().getFirstPosition(); + int sp = getModel().getSecondPosition(); + if (fp != 0) { + fp--; + sp--; + getModel().setPositions(fp, sp); + } + } + + public DiagramViewModel getModel() { + return scene.getModel(); + } + + public FilterChain getFilterChain() { + return this.scene.getModel().getFilterChain(); + } + + public static EditorTopComponent getActive() { + Set modes = WindowManager.getDefault().getModes(); + for (Mode m : modes) { + TopComponent tc = m.getSelectedTopComponent(); + if (tc instanceof EditorTopComponent) { + return (EditorTopComponent) tc; + } + } + return null; + } + + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + jCheckBox1 = new javax.swing.JCheckBox(); + + org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, "jCheckBox1"); + jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0)); + + setLayout(new java.awt.BorderLayout()); + + }// //GEN-END:initComponents + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox jCheckBox1; + // End of variables declaration//GEN-END:variables + @Override + public int getPersistenceType() { + return TopComponent.PERSISTENCE_NEVER; + } + + @Override + public void componentOpened() { + } + + @Override + public void componentClosed() { + } + + @Override + protected String preferredID() { + return PREFERRED_ID; + } + + public void changed(RangeSliderModel model) { + updateDisplayName(); + } + + public boolean showPredSucc() { + return (Boolean) predSuccAction.getValue(PredSuccAction.STATE); + } + + public void setSelection(PropertyMatcher matcher) { + + Properties.PropertySelector
    selector = new Properties.PropertySelector
    (scene.getModel().getDiagramToView().getFigures()); + List
    list = selector.selectMultiple(matcher); + boolean b = scene.getUndoRedoEnabled(); + scene.setUndoRedoEnabled(false); + scene.gotoFigures(list); + scene.setUndoRedoEnabled(b); + scene.setSelection(list); + } + + public void setSelectedNodes(Set nodes) { + + List
    list = new ArrayList
    (); + Set ids = new HashSet(); + for (InputNode n : nodes) { + ids.add(n.getId()); + } + + for (Figure f : scene.getModel().getDiagramToView().getFigures()) { + for (InputNode n : f.getSource().getSourceNodes()) { + if (ids.contains(n.getId())) { + list.add(f); + break; + } + } + } + + scene.gotoFigures(list); + scene.setSelection(list); + } + + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getSource() == this.predSuccAction) { + boolean b = (Boolean) predSuccAction.getValue(PredSuccAction.STATE); + this.getModel().setShowNodeHull(b); + } else if (evt.getSource() == this.overviewAction) { + boolean b = (Boolean) overviewAction.getValue(OverviewAction.STATE); + if (b) { + showSatellite(); + } else { + showScene(); + } + } else if (evt.getSource() == this.blockLayoutAction) { + boolean b = (Boolean) blockLayoutAction.getValue(EnableBlockLayoutAction.STATE); + System.out.println("Showblocks = " + b); + this.getModel().setShowBlocks(b); + } else { + assert false : "Unknown event source"; + } + } + + public void extract() { + scene.showOnly(scene.getSelectedNodes()); + } + + public void hideNodes() { + Set selectedNodes = this.scene.getSelectedNodes(); + HashSet nodes = new HashSet(scene.getModel().getHiddenNodes()); + nodes.addAll(selectedNodes); + this.scene.showNot(nodes); + } + + public void expandPredecessors() { + Set
    oldSelection = scene.getSelectedFigures(); + Set
    figures = new HashSet
    (); + + for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { + boolean ok = false; + if (oldSelection.contains(f)) { + ok = true; + } else { + for (Figure pred : f.getSuccessors()) { + if (oldSelection.contains(pred)) { + ok = true; + break; + } + } + } + + if (ok) { + figures.add(f); + } + } + + scene.showAll(figures); + } + + public void expandSuccessors() { + Set
    oldSelection = scene.getSelectedFigures(); + Set
    figures = new HashSet
    (); + + for (Figure f : this.getDiagramModel().getDiagramToView().getFigures()) { + boolean ok = false; + if (oldSelection.contains(f)) { + ok = true; + } else { + for (Figure succ : f.getPredecessors()) { + if (oldSelection.contains(succ)) { + ok = true; + break; + } + } + } + + if (ok) { + figures.add(f); + } + } + + scene.showAll(figures); + } + + public void showAll() { + scene.showNot(new HashSet()); + } + + public Diagram getDiagram() { + return getDiagramModel().getDiagramToView(); + } + + @Override + protected void componentActivated() { + } + + @Override + public void requestFocus() { + super.requestFocus(); + scene.getView().requestFocus(); + } + + @Override + public boolean requestFocusInWindow() { + super.requestFocusInWindow(); + return scene.getView().requestFocusInWindow(); + } + + @Override + public UndoRedo getUndoRedo() { + return scene.getUndoRedo(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExportCookie.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExportCookie.java new file mode 100644 index 00000000000..539865e2bc2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExportCookie.java @@ -0,0 +1,36 @@ +/* + * Copyright 1998-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 com.sun.hotspot.igv.view; + +import java.io.File; + +/** + * + * @author Thomas Wuerthinger + */ +public interface ExportCookie { + + void export(File f); +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedPanAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedPanAction.java new file mode 100644 index 00000000000..15ae3218b26 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedPanAction.java @@ -0,0 +1,131 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Point; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.action.WidgetAction; + +import java.awt.event.MouseEvent; +import javax.swing.JComponent; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; + +/** + * @author David Kaspar + * @author Thomas Wuerthinger + */ +public class ExtendedPanAction extends WidgetAction.LockedAdapter { + + private Scene scene; + private JScrollPane scrollPane; + private Point lastLocation; + + protected boolean isLocked() { + return scrollPane != null; + } + + @Override + public State mousePressed(Widget widget, WidgetMouseEvent event) { + if (event.getButton() == MouseEvent.BUTTON2 || event.getButton() == MouseEvent.BUTTON1 && ((event.getModifiers() & MouseEvent.CTRL_MASK) != 0)) { + scene = widget.getScene(); + scrollPane = findScrollPane(scene.getView()); + if (scrollPane != null) { + lastLocation = scene.convertSceneToView(widget.convertLocalToScene(event.getPoint())); + SwingUtilities.convertPointToScreen(lastLocation, scrollPane.getViewport().getView()); + return State.createLocked(widget, this); + } + } + return State.REJECTED; + } + + private JScrollPane findScrollPane(JComponent component) { + for (;;) { + if (component == null) { + return null; + } + if (component instanceof JScrollPane) { + return ((JScrollPane) component); + } + Container parent = component.getParent(); + if (!(parent instanceof JComponent)) { + return null; + } + component = (JComponent) parent; + } + } + + @Override + public State mouseReleased(Widget widget, WidgetMouseEvent event) { + boolean state = pan(widget, event.getPoint()); + if (state) { + scrollPane = null; + } + return state ? State.createLocked(widget, this) : State.REJECTED; + } + + @Override + public State mouseDragged(Widget widget, WidgetMouseEvent event) { + return pan(widget, event.getPoint()) ? State.createLocked(widget, this) : State.REJECTED; + } + + private boolean pan(Widget widget, Point newLocation) { + if (scrollPane == null || scene != widget.getScene()) { + return false; + } + newLocation = scene.convertSceneToView(widget.convertLocalToScene(newLocation)); + SwingUtilities.convertPointToScreen(newLocation, scrollPane.getViewport().getView()); + Point viewPosition = scrollPane.getViewport().getViewPosition(); + Dimension viewSize = scrollPane.getViewport().getViewSize(); + Dimension viewPortSize = scrollPane.getViewport().getSize(); + + int xOffset = lastLocation.x - newLocation.x; + int yOffset = lastLocation.y - newLocation.y; + + if (viewPortSize.height == viewSize.height) { + yOffset = 0; + } + + if (viewPortSize.width == viewSize.width) { + xOffset = 0; + } + + if (xOffset == 0 && yOffset == 0) { + return true; + } + viewPosition = new Point(viewPosition.x + xOffset, viewPosition.y + yOffset); + viewPosition.x = Math.max(viewPosition.x, 0); + viewPosition.y = Math.max(viewPosition.y, 0); + viewPosition.x = Math.min(viewPosition.x, scrollPane.getViewport().getView().getSize().width - scrollPane.getViewport().getSize().width); + viewPosition.y = Math.min(viewPosition.y, scrollPane.getViewport().getView().getSize().height - scrollPane.getViewport().getSize().height); + + scrollPane.getViewport().setViewPosition(viewPosition); + scrollPane.getViewport().getView().repaint(); + lastLocation = newLocation; + return true; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedSatelliteComponent.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedSatelliteComponent.java new file mode 100644 index 00000000000..cd3e8940933 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/ExtendedSatelliteComponent.java @@ -0,0 +1,200 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import org.netbeans.api.visual.widget.Scene; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +/** + * @author David Kaspar + * @author Thomas Wuerthinger + */ +public class ExtendedSatelliteComponent extends JComponent implements MouseListener, MouseMotionListener, Scene.SceneListener, ComponentListener { + + private DiagramScene scene; + private Image image; + private int imageWidth; + private int imageHeight; + + public ExtendedSatelliteComponent(DiagramScene scene) { + this.scene = scene; + setDoubleBuffered(true); + setPreferredSize(new Dimension(128, 128)); + addMouseListener(this); + addMouseMotionListener(this); + } + + public void addNotify() { + super.addNotify(); + scene.addSceneListener(this); + JComponent viewComponent = scene.getView(); + if (viewComponent == null) { + viewComponent = scene.createView(); + } + viewComponent.addComponentListener(this); + repaint(); + } + + public void removeNotify() { + scene.getView().removeComponentListener(this); + scene.removeSceneListener(this); + super.removeNotify(); + } + + public void update() { + this.image = null; + if (this.isVisible()) { + repaint(); + revalidate(); + validate(); + } + } + + public void paint(Graphics g) { + Graphics2D gr = (Graphics2D) g; + super.paint(g); + Rectangle bounds = scene.getBounds(); + Dimension size = getSize(); + + double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; + double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; + double scale = Math.min(sx, sy); + + int vw = (int) (scale * bounds.width); + int vh = (int) (scale * bounds.height); + int vx = (size.width - vw) / 2; + int vy = (size.height - vh) / 2; + + + if (image == null || vw != imageWidth || vh != imageHeight) { + + imageWidth = vw; + imageHeight = vh; + image = this.createImage(imageWidth, imageHeight); + Graphics2D ig = (Graphics2D) image.getGraphics(); + ig.scale(scale, scale); + scene.setRealZoomFactor(scale); + scene.paint(ig); + scene.setRealZoomFactor(0.0); + } + + gr.drawImage(image, vx, vy, this); + + JComponent component = scene.getView(); + double zoomFactor = scene.getZoomFactor(); + Rectangle viewRectangle = component != null ? component.getVisibleRect() : null; + if (viewRectangle != null) { + Rectangle window = new Rectangle( + (int) ((double) viewRectangle.x * scale / zoomFactor), + (int) ((double) viewRectangle.y * scale / zoomFactor), + (int) ((double) viewRectangle.width * scale / zoomFactor), + (int) ((double) viewRectangle.height * scale / zoomFactor)); + window.translate(vx, vy); + gr.setColor(new Color(200, 200, 200, 128)); + gr.fill(window); + gr.setColor(Color.BLACK); + gr.drawRect(window.x, window.y, window.width - 1, window.height - 1); + } + } + + public void mouseClicked(MouseEvent e) { + } + + public void mousePressed(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseReleased(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseEntered(MouseEvent e) { + } + + public void mouseExited(MouseEvent e) { + } + + public void mouseDragged(MouseEvent e) { + moveVisibleRect(e.getPoint()); + } + + public void mouseMoved(MouseEvent e) { + } + + private void moveVisibleRect(Point center) { + JComponent component = scene.getView(); + if (component == null) { + return; + } + double zoomFactor = scene.getZoomFactor(); + Rectangle bounds = scene.getBounds(); + Dimension size = getSize(); + + double sx = bounds.width > 0 ? (double) size.width / bounds.width : 0.0; + double sy = bounds.width > 0 ? (double) size.height / bounds.height : 0.0; + double scale = Math.min(sx, sy); + + int vw = (int) (scale * bounds.width); + int vh = (int) (scale * bounds.height); + int vx = (size.width - vw) / 2; + int vy = (size.height - vh) / 2; + + int cx = (int) ((double) (center.x - vx) / scale * zoomFactor); + int cy = (int) ((double) (center.y - vy) / scale * zoomFactor); + + Rectangle visibleRect = component.getVisibleRect(); + visibleRect.x = cx - visibleRect.width / 2; + visibleRect.y = cy - visibleRect.height / 2; + component.scrollRectToVisible(visibleRect); + + this.repaint(); + } + + public void sceneRepaint() { + //repaint (); + } + + public void sceneValidating() { + } + + public void sceneValidated() { + } + + public void componentResized(ComponentEvent e) { + repaint(); + } + + public void componentMoved(ComponentEvent e) { + repaint(); + } + + public void componentShown(ComponentEvent e) { + } + + public void componentHidden(ComponentEvent e) { + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java new file mode 100644 index 00000000000..7d45f1b35c6 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/FindPanel.java @@ -0,0 +1,111 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.data.Properties.RegexpPropertyMatcher; +import com.sun.hotspot.igv.data.Property; +import java.awt.GridLayout; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; +import javax.swing.JComboBox; +import javax.swing.JPanel; +import javax.swing.JTextField; + +/** + * + * @author Thomas Wuerthinger + */ +class FindPanel extends JPanel implements KeyListener { + + private JComboBox nameComboBox; + private JTextField valueTextField; + + public FindPanel(List
    figures) { + createDesign(); + updateComboBox(figures); + } + + protected void createDesign() { + setLayout(new GridLayout()); + nameComboBox = new JComboBox(); + valueTextField = new JTextField(); + add(nameComboBox); + add(valueTextField); + valueTextField.addKeyListener(this); + } + + public void updateComboBox(List
    figures) { + + String sel = (String) nameComboBox.getSelectedItem(); + SortedSet propertyNames = new TreeSet(); + + for (Figure f : figures) { + Properties prop = f.getProperties(); + for (Property p : prop.getProperties()) { + if (!propertyNames.contains(p.getName())) { + propertyNames.add(p.getName()); + } + } + } + + for (String s : propertyNames) { + nameComboBox.addItem(s); + } + nameComboBox.setSelectedItem(sel); + } + + public String getNameText() { + return (String) nameComboBox.getSelectedItem(); + } + + public String getValueText() { + return valueTextField.getText(); + } + + public void keyTyped(KeyEvent e) { + } + + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ENTER) { + find(); + } + } + + public void find() { + EditorTopComponent comp = EditorTopComponent.getActive(); + if (comp != null) { + RegexpPropertyMatcher matcher = new RegexpPropertyMatcher(getNameText(), getValueText()); + comp.setSelection(matcher); + } + } + + public void keyReleased(KeyEvent e) { + + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/GraphViewerImplementation.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/GraphViewerImplementation.java new file mode 100644 index 00000000000..e303b51aab9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/GraphViewerImplementation.java @@ -0,0 +1,43 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import com.sun.hotspot.igv.data.InputGraph; +import com.sun.hotspot.igv.data.services.GraphViewer; +import com.sun.hotspot.igv.graph.Diagram; +import com.sun.hotspot.igv.settings.Settings; + +/** + * + * @author Thomas Wuerthinger + */ +public class GraphViewerImplementation implements GraphViewer { + + public void view(InputGraph graph) { + Diagram diagram = Diagram.createDiagram(graph, Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT)); + EditorTopComponent tc = new EditorTopComponent(diagram); + tc.open(); + tc.requestActive(); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/PreferenceConstants.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/PreferenceConstants.java new file mode 100644 index 00000000000..31df010ea86 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/PreferenceConstants.java @@ -0,0 +1,34 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +/** + * + * @author Thomas Wuerthinger + */ +public class PreferenceConstants { + + public static final String KEY_LINE_GENERATOR = "lineGenerator"; + public static final String DEFAULT_LINE_GENERATOR = "com.sun.hotspot.igv.positioning.BasicLineGenerator"; +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/SlotLayout.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/SlotLayout.java new file mode 100644 index 00000000000..9176297c771 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/SlotLayout.java @@ -0,0 +1,171 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view; + +import java.awt.Point; +import java.awt.Rectangle; +import java.util.Collection; +import java.util.List; +import org.netbeans.api.visual.layout.Layout; +import org.netbeans.api.visual.layout.LayoutFactory; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class SlotLayout implements Layout { + + public enum HorizontalAlignment { + + Left, + Center, + Right + } + private Layout baseLayout; + private HorizontalAlignment alignment; + private boolean vertical; + + public SlotLayout() { + this(HorizontalAlignment.Center, false); + } + + public SlotLayout(HorizontalAlignment alignment, boolean vertical) { + this.alignment = alignment; + baseLayout = LayoutFactory.createVerticalFlowLayout(); + this.vertical = vertical; + } + + public void layout(Widget widget) { + if (!vertical) { + Collection children = widget.getChildren(); + int gap = 0; + int max = 0; + for (Widget child : children) { + Rectangle preferredBounds = child.getPreferredBounds(); + int i = preferredBounds.width; + if (i > max) { + max = i; + } + } + int pos = 0; + for (Widget child : children) { + Rectangle preferredBounds = child.getPreferredBounds(); + int x = preferredBounds.x; + int y = preferredBounds.y; + int width = preferredBounds.width; + int height = preferredBounds.height; + if (pos == 0) { + pos += height / 2; + } + int lx = -x; + int ly = pos - y; + switch (alignment) { + case Center: + lx += (max - width) / 2; + break; + case Left: + break; + case Right: + lx += max - width; + break; + } + child.resolveBounds(new Point(lx, ly), new Rectangle(x, y, width, height)); + pos += height + gap; + } + } else { + + Collection children = widget.getChildren(); + int gap = 0; + int max = 0; + for (Widget child : children) { + Rectangle preferredBounds = child.getPreferredBounds(); + int i = preferredBounds.height; + if (i > max) { + max = i; + } + } + int pos = 0; + for (Widget child : children) { + Rectangle preferredBounds = child.getPreferredBounds(); + int x = preferredBounds.x; + int y = preferredBounds.y; + int width = preferredBounds.width; + int height = preferredBounds.height; + if (pos == 0) { + pos += width / 2; + } + int lx = pos - x; + int ly = -y; + switch (alignment) { + case Center: + ly += (max - height) / 2; + break; + case Left: + break; + case Right: + ly += max - height; + break; + } + child.resolveBounds(new Point(lx, ly), new Rectangle(x, y, width, height)); + pos += width + gap; + } + + } + } + + public boolean requiresJustification(Widget widget) { + return true; + } + + public void justify(Widget widget) { + baseLayout.justify(widget); + + Rectangle client = widget.getClientArea(); + List children = widget.getChildren(); + + int count = children.size(); + int z = 0; + + int maxWidth = 0; + for (Widget c : children) { + if (c.getPreferredBounds().width > maxWidth) { + maxWidth = c.getPreferredBounds().width; + } + } + + for (Widget c : children) { + z++; + Point curLocation = c.getLocation(); + Rectangle curBounds = c.getBounds(); + + + Point location = new Point(curLocation.x, client.y + client.height * z / (count + 1) - curBounds.height / 2); + if (vertical) { + location = new Point(client.x + client.width * z / (count + 1) - maxWidth / 2, curLocation.y); + } + c.resolveBounds(location, null); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties new file mode 100644 index 00000000000..2f1fad50024 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/Bundle.properties @@ -0,0 +1,7 @@ +CTL_EditorAction=Open Editor Window +CTL_LineGeneratorAction=Line Generator +CTL_NextDiagramAction=Show next graph +CTL_EnableBlockLayoutAction=Enable block layout +CTL_NodeFindAction=Find +CTL_PrevDiagramAction=Show previous graph +CTL_ExportAction=Export... diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/EnableBlockLayoutAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/EnableBlockLayoutAction.java new file mode 100644 index 00000000000..231d5c18d77 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/EnableBlockLayoutAction.java @@ -0,0 +1,55 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +/** + * + * @author Thomas Wuerthinger + */ +public class EnableBlockLayoutAction extends AbstractAction { + + private boolean state; + public static final String STATE = "state"; + + public EnableBlockLayoutAction() { + state = true; + putValue(AbstractAction.SMALL_ICON, new ImageIcon(org.openide.util.Utilities.loadImage(iconResource()))); + putValue(STATE, true); + putValue(Action.SHORT_DESCRIPTION, "Cluster nodes into blocks"); + } + + public void actionPerformed(ActionEvent ev) { + this.state = !state; + this.putValue(STATE, state); + } + + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/blocks.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java new file mode 100644 index 00000000000..3bb9dbeba02 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandPredecessorsAction.java @@ -0,0 +1,60 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ExpandPredecessorsAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.expandPredecessors(); + } + } + + public String getName() { + return "Expand Predecessors"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java new file mode 100644 index 00000000000..6ca1508f2ab --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExpandSuccessorsAction.java @@ -0,0 +1,60 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ExpandSuccessorsAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.expandSuccessors(); + } + } + + public String getName() { + return "Expand Successors"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java new file mode 100644 index 00000000000..771e25c895e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExportAction.java @@ -0,0 +1,117 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.settings.Settings; +import com.sun.hotspot.igv.view.ExportCookie; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.io.File; +import javax.swing.Action; +import javax.swing.JFileChooser; +import javax.swing.KeyStroke; +import javax.swing.filechooser.FileFilter; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.LookupEvent; +import org.openide.util.LookupListener; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ExportAction extends CallableSystemAction implements LookupListener { + + private final Lookup lookup; + private final Lookup.Result result; + + public ExportAction() { + putValue(Action.SHORT_DESCRIPTION, "Export current graph as an SVG file"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK)); + lookup = Utilities.actionsGlobalContext(); + result = lookup.lookup(new Lookup.Template(ExportCookie.class)); + result.addLookupListener(this); + resultChanged(null); + } + + public void resultChanged(LookupEvent e) { + super.setEnabled(result.allInstances().size() > 0); + } + + public void performAction() { + + JFileChooser fc = new JFileChooser(); + fc.setFileFilter(new FileFilter() { + + public boolean accept(File f) { + return true; + } + + public String getDescription() { + return "SVG files (*.svg)"; + } + }); + fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT))); + + + if (fc.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) { + File file = fc.getSelectedFile(); + if (!file.getName().contains(".")) { + file = new File(file.getAbsolutePath() + ".svg"); + } + + File dir = file; + if (!dir.isDirectory()) { + dir = dir.getParentFile(); + } + + Settings.get().put(Settings.DIRECTORY, dir.getAbsolutePath()); + ExportCookie cookie = Utilities.actionsGlobalContext().lookup(ExportCookie.class); + if (cookie != null) { + cookie.export(file); + } + } + } + + public String getName() { + return NbBundle.getMessage(ExportAction.class, "CTL_ExportAction"); + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/export.gif"; + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java new file mode 100644 index 00000000000..008ba3c3861 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ExtractAction.java @@ -0,0 +1,74 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import java.awt.Event; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ExtractAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.extract(); + } + } + + public ExtractAction() { + putValue(Action.SHORT_DESCRIPTION, "Extract current set of selected nodes"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK, false)); + } + + public String getName() { + return "Extract action"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/extract.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java new file mode 100644 index 00000000000..8ac2ffb629f --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/HideAction.java @@ -0,0 +1,74 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import java.awt.Event; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class HideAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.hideNodes(); + } + } + + public HideAction() { + putValue(Action.SHORT_DESCRIPTION, "Hide selected nodes"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_H, Event.CTRL_MASK, false)); + } + + public String getName() { + return "Hide"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/hide.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/MouseOverAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/MouseOverAction.java new file mode 100644 index 00000000000..10afb7c20a7 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/MouseOverAction.java @@ -0,0 +1,59 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import org.netbeans.api.visual.action.HoverProvider; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.action.WidgetAction.State; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class MouseOverAction extends WidgetAction.Adapter { + + private long eventID = Integer.MIN_VALUE; + private HoverProvider provider; + + public MouseOverAction(HoverProvider provider) { + this.provider = provider; + } + + @Override + public State mouseMoved(Widget widget, WidgetMouseEvent event) { + long id = event.getEventID(); + if (id != eventID) { + eventID = id; + provider.widgetHovered(widget); + } + return State.REJECTED; + } + + @Override + public State mouseExited(Widget widget, WidgetMouseEvent event) { + provider.widgetHovered(null); + return State.REJECTED; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NextDiagramAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NextDiagramAction.java new file mode 100644 index 00000000000..d7f7216f2a4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NextDiagramAction.java @@ -0,0 +1,105 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.DiagramViewModel; +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.util.ContextAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; + +/** + * + * @author Thomas Wuerthinger + */ +public final class NextDiagramAction extends ContextAction implements ChangedListener { + + private DiagramViewModel model; + + public NextDiagramAction() { + this(Utilities.actionsGlobalContext()); + } + + public NextDiagramAction(Lookup lookup) { + putValue(Action.SHORT_DESCRIPTION, "Show next graph of current group"); + putValue(Action.SMALL_ICON, new ImageIcon(Utilities.loadImage("com/sun/hotspot/igv/view/images/next_diagram.png"))); + } + + public String getName() { + return NbBundle.getMessage(NextDiagramAction.class, "CTL_NextDiagramAction"); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public Class contextClass() { + return DiagramViewModel.class; + } + + @Override + public void performAction(DiagramViewModel model) { + int fp = model.getFirstPosition(); + int sp = model.getSecondPosition(); + if (sp != model.getPositions().size() - 1) { + int nfp = fp + 1; + int nsp = sp + 1; + model.setPositions(nfp, nsp); + } + } + + @Override + public void update(DiagramViewModel model) { + super.update(model); + + if (this.model != model) { + if (this.model != null) { + this.model.getDiagramChangedEvent().removeListener(this); + } + + this.model = model; + if (this.model != null) { + this.model.getDiagramChangedEvent().addListener(this); + } + } + } + + @Override + public boolean isEnabled(DiagramViewModel model) { + return model.getSecondPosition() != model.getPositions().size() - 1; + } + + public Action createContextAwareInstance(Lookup arg0) { + return new NextDiagramAction(arg0); + } + + public void changed(DiagramViewModel source) { + update(source); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NodeFindAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NodeFindAction.java new file mode 100644 index 00000000000..03911b0d224 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/NodeFindAction.java @@ -0,0 +1,71 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import javax.swing.Action; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class NodeFindAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent comp = EditorTopComponent.getActive(); + if (comp != null) { + comp.findNode(); + } + } + + public NodeFindAction() { + putValue(Action.SHORT_DESCRIPTION, "Find nodes"); + } + + public String getName() { + return NbBundle.getMessage(NodeFindAction.class, "CTL_NodeFindAction"); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + public boolean isEnabled() { + return true; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/search.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/OverviewAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/OverviewAction.java new file mode 100644 index 00000000000..0a54ca0bad2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/OverviewAction.java @@ -0,0 +1,58 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +/** + * + * @author Thomas Wuerthinger + */ +public class OverviewAction extends AbstractAction { + + private boolean state; + public static final String STATE = "state"; + + public OverviewAction() { + putValue(AbstractAction.SMALL_ICON, new ImageIcon(org.openide.util.Utilities.loadImage(iconResource()))); + putValue(Action.SHORT_DESCRIPTION, "Show satellite view of whole graph"); + setState(false); + } + + public void actionPerformed(ActionEvent ev) { + setState(!state); + } + + public void setState(boolean b) { + this.putValue(STATE, b); + this.state = b; + } + + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/overview.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PredSuccAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PredSuccAction.java new file mode 100644 index 00000000000..6e2d79b213b --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PredSuccAction.java @@ -0,0 +1,55 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import java.awt.event.ActionEvent; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +/** + * + * @author Thomas Wuerthinger + */ +public class PredSuccAction extends AbstractAction { + + private boolean state; + public static final String STATE = "state"; + + public PredSuccAction() { + state = true; + putValue(AbstractAction.SMALL_ICON, new ImageIcon(org.openide.util.Utilities.loadImage(iconResource()))); + putValue(STATE, true); + putValue(Action.SHORT_DESCRIPTION, "Show neighboring nodes of fully visible nodes semi-transparent"); + } + + public void actionPerformed(ActionEvent ev) { + this.state = !state; + this.putValue(STATE, state); + } + + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/predsucc.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PrevDiagramAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PrevDiagramAction.java new file mode 100644 index 00000000000..2945c200392 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/PrevDiagramAction.java @@ -0,0 +1,105 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.data.ChangedListener; +import com.sun.hotspot.igv.view.DiagramViewModel; +import com.sun.hotspot.igv.util.ContextAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; +import org.openide.util.NbBundle; +import org.openide.util.Utilities; + +/** + * + * @author Thomas Wuerthinger + */ +public final class PrevDiagramAction extends ContextAction implements ChangedListener { + + private DiagramViewModel model; + + public PrevDiagramAction() { + this(Utilities.actionsGlobalContext()); + } + + public PrevDiagramAction(Lookup lookup) { + putValue(Action.SHORT_DESCRIPTION, "Show previous graph of current group"); + putValue(Action.SMALL_ICON, new ImageIcon(Utilities.loadImage("com/sun/hotspot/igv/view/images/prev_diagram.png"))); + } + + public String getName() { + return NbBundle.getMessage(PrevDiagramAction.class, "CTL_PrevDiagramAction"); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + public Class contextClass() { + return DiagramViewModel.class; + } + + @Override + public void performAction(DiagramViewModel model) { + int fp = model.getFirstPosition(); + int sp = model.getSecondPosition(); + if (fp != 0) { + int nfp = fp - 1; + int nsp = sp - 1; + model.setPositions(nfp, nsp); + } + } + + @Override + public void update(DiagramViewModel model) { + super.update(model); + + if (this.model != model) { + if (this.model != null) { + this.model.getDiagramChangedEvent().removeListener(this); + } + + this.model = model; + if (this.model != null) { + this.model.getDiagramChangedEvent().addListener(this); + } + } + } + + @Override + public boolean isEnabled(DiagramViewModel model) { + return model.getFirstPosition() != 0; + } + + public Action createContextAwareInstance(Lookup arg0) { + return new PrevDiagramAction(arg0); + } + + public void changed(DiagramViewModel source) { + update(source); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java new file mode 100644 index 00000000000..f9f3b4be670 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ShowAllAction.java @@ -0,0 +1,74 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.*; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ShowAllAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.showAll(); + } + } + + public ShowAllAction() { + putValue(Action.SHORT_DESCRIPTION, "Show all nodes"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK)); + } + + public String getName() { + return "Show all"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/expand.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java new file mode 100644 index 00000000000..9b059725562 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomInAction.java @@ -0,0 +1,69 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import java.awt.Event; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ZoomInAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.zoomIn(); + } + } + + public String getName() { + return "Zoom in"; + } + + public ZoomInAction() { + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, Event.CTRL_MASK, false)); + putValue(Action.SHORT_DESCRIPTION, "Zoom in"); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/zoomin.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java new file mode 100644 index 00000000000..6ec6d24216e --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/actions/ZoomOutAction.java @@ -0,0 +1,75 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.actions; + +import com.sun.hotspot.igv.view.EditorTopComponent; +import java.awt.Event; +import java.awt.event.KeyEvent; +import javax.swing.Action; +import javax.swing.KeyStroke; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; + +/** + * + * @author Thomas Wuerthinger + */ +public final class ZoomOutAction extends CallableSystemAction { + + public void performAction() { + EditorTopComponent editor = EditorTopComponent.getActive(); + if (editor != null) { + editor.zoomOut(); + } + } + + public ZoomOutAction() { + + putValue(Action.SHORT_DESCRIPTION, "Zoom out"); + putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, Event.CTRL_MASK, false)); + } + + public String getName() { + return "Zoom out"; + } + + @Override + protected void initialize() { + super.initialize(); + } + + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } + + @Override + protected String iconResource() { + return "com/sun/hotspot/igv/view/images/zoomout.gif"; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/blocks.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/blocks.gif new file mode 100644 index 00000000000..71aa946d539 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/blocks.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/expand.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/expand.gif new file mode 100644 index 00000000000..ebc418d0539 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/expand.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/export.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/export.gif new file mode 100644 index 00000000000..d15a80acc5f Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/export.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/extract.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/extract.gif new file mode 100644 index 00000000000..7a0f1aa85e9 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/extract.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/hide.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/hide.gif new file mode 100644 index 00000000000..25a0c0ff3a5 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/hide.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/next_diagram.png b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/next_diagram.png new file mode 100644 index 00000000000..b0a40e670d3 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/next_diagram.png differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/overview.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/overview.gif new file mode 100644 index 00000000000..abafbe28cfa Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/overview.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/predsucc.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/predsucc.gif new file mode 100644 index 00000000000..5009b345c75 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/predsucc.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/prev_diagram.png b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/prev_diagram.png new file mode 100644 index 00000000000..7eabfd938f5 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/prev_diagram.png differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/search.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/search.gif new file mode 100644 index 00000000000..9e488969a62 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/search.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomin.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomin.gif new file mode 100644 index 00000000000..2329426e481 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomin.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomout.gif b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomout.gif new file mode 100644 index 00000000000..f9f7565878f Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/images/zoomout.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml new file mode 100644 index 00000000000..eff917a44bf --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/layer.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/BlockWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/BlockWidget.java new file mode 100644 index 00000000000..9465d25f8e2 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/BlockWidget.java @@ -0,0 +1,82 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.data.InputBlock; +import com.sun.hotspot.igv.graph.Diagram; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.awt.geom.Rectangle2D; +import org.netbeans.api.visual.widget.Scene; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class BlockWidget extends Widget { + + public static final int BORDER = 20; + public static final Color BACKGROUND_COLOR = new Color(235, 235, 255); + private static final Font titleFont = new Font("Serif", Font.PLAIN, 14).deriveFont(Font.BOLD); + private InputBlock blockNode; + private Diagram diagram; + + public BlockWidget(Scene scene, Diagram d, InputBlock blockNode) { + super(scene); + this.blockNode = blockNode; + this.diagram = d; + this.setBackground(BACKGROUND_COLOR); + this.setOpaque(true); + this.setCheckClipping(true); + } + + @Override + protected void paintWidget() { + super.paintWidget(); + Graphics2D g = this.getGraphics(); + Stroke old = g.getStroke(); + g.setColor(Color.BLUE); + Rectangle r = new Rectangle(this.getPreferredBounds()); + r.width--; + r.height--; + if (this.getBounds().width > 0 && this.getBounds().height > 0) { + g.setStroke(new BasicStroke(2)); + g.drawRect(r.x, r.y, r.width, r.height); + } + + Color titleColor = Color.BLACK; + g.setColor(titleColor); + g.setFont(titleFont); + + String s = "B" + blockNode.toString(); + Rectangle2D r1 = g.getFontMetrics().getStringBounds(s, g); + g.drawString(s, r.x + 5, r.y + (int) r1.getHeight()); + g.setStroke(old); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/DiagramConnectionWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/DiagramConnectionWidget.java new file mode 100644 index 00000000000..98e696151db --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/DiagramConnectionWidget.java @@ -0,0 +1,251 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.view.DiagramScene; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.util.ArrayList; +import java.util.List; +import org.netbeans.api.visual.anchor.AnchorShape; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.ConnectionWidget; +import org.netbeans.api.visual.widget.Scene; + +/** + * + * @author Thomas Wuerthinger + */ +public class DiagramConnectionWidget extends ConnectionWidget { + + private static Stroke DASHED_STROKE = new BasicStroke( + 1, + BasicStroke.CAP_BUTT, + BasicStroke.JOIN_ROUND, + 0, + new float[]{2}, + 0); + private static Stroke NORMAL_STROKE = new BasicStroke(1); + private static Stroke BOLD_STROKE = new BasicStroke(3); + public static int WHITE_FACTOR = 5; + private Connection connection; + private Color color; + private Point lastSourceAnchor; + private Point lastTargetAnchor; + private List controlPoints; + private Rectangle clientArea; + private boolean split; + private int[] xPoints; + private int[] yPoints; + private int pointCount; + + /** Creates a new instance of ConnectionWidget */ + public DiagramConnectionWidget(Connection connection, Scene scene) { + super(scene); + this.connection = connection; + color = connection.getColor(); + if (connection.getStyle() == Connection.ConnectionStyle.DASHED) { + this.setStroke(DASHED_STROKE); + } else if (connection.getStyle() == Connection.ConnectionStyle.BOLD) { + this.setStroke(BOLD_STROKE); + } else { + this.setStroke(NORMAL_STROKE); + } + this.setCheckClipping(true); + clientArea = new Rectangle(); + updateControlPoints(); + } + + public Connection getConnection() { + return connection; + } + + public void updateControlPoints() { + List newControlPoints = connection.getControlPoints(); + Connection c = connection; + Figure f = c.getInputSlot().getFigure(); + Point p = new Point(f.getPosition()); + p.translate(c.getInputSlot().getRelativePosition().x, f.getSize().height / 2); + Point p4 = new Point(f.getPosition()); + p4.translate(c.getInputSlot().getRelativePosition().x, c.getInputSlot().getRelativePosition().y); + + Figure f2 = c.getOutputSlot().getFigure(); + Point p2 = new Point(f2.getPosition()); + p2.translate(c.getOutputSlot().getRelativePosition().x, f2.getSize().height / 2); + Point p3 = new Point(f2.getPosition()); + p3.translate(c.getOutputSlot().getRelativePosition().x, c.getOutputSlot().getRelativePosition().y); + + /*if(controlPoints.size() >= 2) { + String className = Preferences.userNodeForPackage(PreferenceConstants.class).get(PreferenceConstants.KEY_LINE_GENERATOR, PreferenceConstants.DEFAULT_LINE_GENERATOR); + try { + LineGenerator lg = (LineGenerator)Class.forName(className).newInstance(); + controlPoints = lg.createLine(controlPoints, p2, p); + } catch (InstantiationException ex) { + } catch (IllegalAccessException ex) { + } catch (ClassNotFoundException ex) { + } + }*/ + + this.controlPoints = newControlPoints; + pointCount = newControlPoints.size(); + xPoints = new int[pointCount]; + yPoints = new int[pointCount]; + int minX = Integer.MAX_VALUE; + int maxX = Integer.MIN_VALUE; + int minY = Integer.MAX_VALUE; + int maxY = Integer.MIN_VALUE; + split = false; + for (int i = 0; i < pointCount; i++) { + if (newControlPoints.get(i) == null) { + split = true; + } else { + int curX = newControlPoints.get(i).x; + int curY = newControlPoints.get(i).y; + this.xPoints[i] = curX; + this.yPoints[i] = curY; + minX = Math.min(minX, curX); + maxX = Math.max(maxX, curX); + minY = Math.min(minY, curY); + maxY = Math.max(maxY, curY); + } + } + + this.clientArea = new Rectangle(minX, minY, maxX - minX, maxY - minY); + } + + @Override + protected void paintWidget() { + Graphics2D g = this.getGraphics(); + + if (xPoints.length == 0 || Math.abs(xPoints[0] - xPoints[xPoints.length - 1]) > 2000) { + return; + } + + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + //g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); + //g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); + + DiagramScene ds = (DiagramScene) this.getScene(); + boolean shouldHide = false;//ds.getShouldHide(this); + + Composite oldComposite = null; + if (shouldHide) { + Color c = new Color(255 - (255 - color.getRed()) / WHITE_FACTOR, 255 - (255 - color.getGreen()) / WHITE_FACTOR, 255 - (255 - color.getBlue()) / WHITE_FACTOR); + g.setPaint(c); + } else { + g.setPaint(color); + } + + if (split) { + for (int i = 1; i < controlPoints.size(); i++) { + Point prev = controlPoints.get(i - 1); + Point cur = controlPoints.get(i); + if (cur == null || prev == null) { + continue; + } + + g.drawLine(prev.x, prev.y, cur.x, cur.y); + } + } else { + g.drawPolyline(xPoints, yPoints, pointCount); + } + + /*for(int i=0; i= 2) { + Graphics2D g2 = (Graphics2D) g.create(); + int xOff = xPoints[xPoints.length - 2] - xPoints[xPoints.length - 1]; + int yOff = yPoints[yPoints.length - 2] - yPoints[yPoints.length - 1]; + if (xOff == 0 && yOff == 0 && yPoints.length >= 3) { + xOff = xPoints[xPoints.length - 3] - xPoints[xPoints.length - 1]; + yOff = yPoints[yPoints.length - 3] - yPoints[yPoints.length - 1]; + } + g2.translate(xPoints[xPoints.length - 1], yPoints[yPoints.length - 1]); + g2.rotate(Math.atan2(yOff, xOff)); + + g2.scale(0.55, 0.80); + AnchorShape.TRIANGLE_FILLED.paint(g2, false); + } + } + + @Override + public void notifyStateChanged(ObjectState previousState, ObjectState state) { + + if (previousState.isHovered() != state.isHovered()) { + color = connection.getColor(); + if (state.isHovered()) { + this.setStroke(BOLD_STROKE); + } else { + this.setStroke(NORMAL_STROKE); + } + + if (state.isHovered()) { + this.setStroke(BOLD_STROKE); + } else { + this.setStroke(NORMAL_STROKE); + } + + repaint(); + } + super.notifyStateChanged(previousState, state); + } + + @Override + public List getControlPoints() { + if (split) { + ArrayList result = new ArrayList(); + for (Point p : controlPoints) { + if (p != null) { + result.add(p); + } + } + return result; + } else { + return controlPoints; + } + } + + @Override + public String toString() { + return "ConnectionWidget[" + connection + "]"; + } + + @Override + protected Rectangle calculateClientArea() { + Rectangle result = new Rectangle(clientArea); + result.grow(10, 10); + return result; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java new file mode 100644 index 00000000000..ea65e028262 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/FigureWidget.java @@ -0,0 +1,358 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.view.DiagramScene; +import com.sun.hotspot.igv.view.SlotLayout; +import com.sun.hotspot.igv.util.DoubleClickHandler; +import com.sun.hotspot.igv.data.Properties; +import com.sun.hotspot.igv.util.PropertiesSheet; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Point; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.JMenu; +import javax.swing.JPopupMenu; +import org.netbeans.api.visual.action.PopupMenuProvider; +import org.netbeans.api.visual.action.WidgetAction; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.Widget; +import org.netbeans.api.visual.layout.LayoutFactory; +import org.netbeans.api.visual.widget.LabelWidget; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.nodes.Sheet; + +/** + * + * @author Thomas Wuerthinger + */ +public class FigureWidget extends Widget implements Properties.Provider, PopupMenuProvider, DoubleClickHandler { + + public static final boolean VERTICAL_LAYOUT = true; + public static final int DEPTH = 5; + public static final int MAX_STRING_LENGTH = 20; + private static final double LABEL_ZOOM_FACTOR = 0.3; + private static final double ZOOM_FACTOR = 0.1; + private Font font; + private Font boldFont; + private Figure figure; + private Widget leftWidget; + private Widget rightWidget; + private Widget middleWidget; + private ArrayList labelWidgets; + private DiagramScene diagramScene; + private boolean boundary; + private Node node; + + public void setBoundary(boolean b) { + boundary = b; + } + + public boolean isBoundary() { + return boundary; + } + + public Node getNode() { + return node; + } + + private String shortenString(String string) { + if (string.length() > MAX_STRING_LENGTH) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < string.length(); i++) { + char c = string.charAt(i); + if (!Character.isLetter(c) || Character.isUpperCase(c)) { + sb.append(c); + } + } + string = sb.toString(); + } + return string; + } + + public FigureWidget(final Figure f, DiagramScene s, Widget parent) { + + super(s); + + + font = f.getDiagram().getFont(); + boldFont = f.getDiagram().getFont().deriveFont(Font.BOLD); + this.setCheckClipping(true); + this.diagramScene = s; + + parent.addChild(this); + this.figure = f; + this.resolveBounds(null, calculateClientArea()); + + leftWidget = new Widget(s); + this.addChild(leftWidget); + leftWidget.setLayout(new SlotLayout(SlotLayout.HorizontalAlignment.Right, VERTICAL_LAYOUT));//LayoutFactory.createVerticalFlowLayout(LayoutFactory.SerialAlignment.JUSTIFY, 0)); + + middleWidget = new Widget(s); + this.addChild(middleWidget); + + if (VERTICAL_LAYOUT) { + this.setLayout(LayoutFactory.createVerticalFlowLayout()); + } else { + this.setLayout(LayoutFactory.createHorizontalFlowLayout()); + } + + middleWidget.setLayout(LayoutFactory.createVerticalFlowLayout()); + + middleWidget.setBackground(f.getColor()); + middleWidget.setOpaque(true); + assert this.getScene() != null; + assert this.getScene().getView() != null; + middleWidget.setBorder(BorderFactory.createLineBorder(Color.BLACK)); + + + labelWidgets = new ArrayList(); + + String[] strings = figure.getLines(); + + for (String cur : strings) { + + String displayString = cur; + + LabelWidget lw = new LabelWidget(s); + labelWidgets.add(lw); + middleWidget.addChild(lw); + lw.setLabel(displayString); + + lw.setFont(font); + lw.setForeground(Color.BLACK); + lw.setAlignment(LabelWidget.Alignment.CENTER); + lw.setVerticalAlignment(LabelWidget.VerticalAlignment.CENTER); + lw.setMaximumSize(new Dimension(f.getWidth(), 20000)); + lw.setMinimumSize(new Dimension(f.getWidth(), 20)); + } + + rightWidget = new Widget(s); + this.addChild(rightWidget); + rightWidget.setLayout(new SlotLayout(SlotLayout.HorizontalAlignment.Left, VERTICAL_LAYOUT));//LayoutFactory.createVerticalLayout(LayoutFactory.SerialAlignment.JUSTIFY, 0)); + + // Initialize node for property sheet + node = new AbstractNode(Children.LEAF) { + + @Override + protected Sheet createSheet() { + Sheet s = super.createSheet(); + PropertiesSheet.initializeSheet(f.getProperties(), s); + return s; + } + }; + node.setDisplayName(getName()); + } + private boolean firstTime = true; + + @Override + protected void paintWidget() { + if (firstTime) { + firstTime = false; + for (LabelWidget w : labelWidgets) { + String cur = w.getLabel(); + Graphics graphics = this.getGraphics(); + if (graphics.getFontMetrics().stringWidth(cur) > figure.getWidth()) { + w.setLabel(shortenString(cur)); + } + } + } + super.paintWidget(); + } + + public Widget getLeftWidget() { + return leftWidget; + } + + public Widget getRightWidget() { + return rightWidget; + } + + @Override + protected void notifyStateChanged(ObjectState previousState, ObjectState state) { + super.notifyStateChanged(previousState, state); + + Color borderColor = Color.BLACK; + int thickness = 1; + boolean repaint = false; + Font f = font; + if (state.isSelected()) { + thickness = 1; + f = boldFont; + } + + if (state.isHovered()) { + borderColor = Color.BLUE; + } + + if (state.isHovered() != previousState.isHovered()) { + repaint = true; + } + + if (state.isSelected() != previousState.isSelected()) { + repaint = true; + } + + if (repaint) { + middleWidget.setBorder(BorderFactory.createLineBorder(borderColor, thickness)); + for (LabelWidget labelWidget : labelWidgets) { + labelWidget.setFont(f); + } + repaint(); + } + } + + public String getName() { + return getProperties().get("name"); + } + + public Properties getProperties() { + return figure.getProperties(); + } + + public Figure getFigure() { + return figure; + } + + @Override + protected void paintChildren() { + + if (diagramScene.getRealZoomFactor() < ZOOM_FACTOR && diagramScene.getModel().getShowBlocks()) { + return; + } + + Composite oldComposite = null; + if (boundary) { + oldComposite = getScene().getGraphics().getComposite(); + float alpha = DiagramScene.ALPHA; + this.getScene().getGraphics().setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); + } + + if (diagramScene.getRealZoomFactor() < LABEL_ZOOM_FACTOR) { + + for (LabelWidget labelWidget : labelWidgets) { + labelWidget.setVisible(false); + } + super.paintChildren(); + for (LabelWidget labelWidget : labelWidgets) { + labelWidget.setVisible(true); + } + + } else { + super.paintChildren(); + } + + if (boundary) { + getScene().getGraphics().setComposite(oldComposite); + } + } + + public JPopupMenu getPopupMenu(Widget widget, Point point) { + JPopupMenu m = diagramScene.createPopupMenu(); + + JMenu predecessors = new JMenu("Predecessors"); + addFigureToSubMenu(predecessors, getFigure(), false, DEPTH); + + JMenu successors = new JMenu("Successors"); + addFigureToSubMenu(successors, getFigure(), true, DEPTH); + + m.addSeparator(); + m.add(predecessors); + m.add(successors); + return m; + } + + public void addFigureToSubMenu(JMenu subMenu, final Figure f, boolean successor, int depth) { + Set
    set = f.getPredecessorSet(); + if (successor) { + set = f.getSuccessorSet(); + } + + int count = set.size(); + if (set.contains(f)) { + count--; + } + + for (Figure f2 : set) { + if (f2 == f) { + continue; + } + + count--; + addFigureToMenu(subMenu, f2, successor, depth - 1); + if (count > 0) { + subMenu.addSeparator(); + } + } + } + + public void addFigureToMenu(JMenu m, final Figure f, boolean successor, int depth) { + + Action a = diagramScene.createGotoAction(f); + + + m.add(a); + + if (depth > 0) { + String name = "Predecessors"; + if (successor) { + name = "Successors"; + } + + JMenu subMenu = new JMenu(name); + addFigureToSubMenu(subMenu, f, successor, depth); + m.add(subMenu); + } + + } + + public void handleDoubleClick(Widget w, WidgetAction.WidgetMouseEvent e) { + + if (diagramScene.isAllVisible()) { + Set hiddenNodes = new HashSet(diagramScene.getModel().getGraphToView().getGroup().getAllNodes()); + hiddenNodes.removeAll(this.getFigure().getSource().getSourceNodesAsSet()); + this.diagramScene.showNot(hiddenNodes); + } else if (isBoundary()) { + + Set hiddenNodes = new HashSet(diagramScene.getModel().getHiddenNodes()); + hiddenNodes.removeAll(this.getFigure().getSource().getSourceNodesAsSet()); + this.diagramScene.showNot(hiddenNodes); + } else { + Set hiddenNodes = new HashSet(diagramScene.getModel().getHiddenNodes()); + hiddenNodes.addAll(this.getFigure().getSource().getSourceNodesAsSet()); + this.diagramScene.showNot(hiddenNodes); + } + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/InputSlotWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/InputSlotWidget.java new file mode 100644 index 00000000000..a6028aa71ee --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/InputSlotWidget.java @@ -0,0 +1,61 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.view.DiagramScene; +import java.awt.Point; +import java.util.List; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class InputSlotWidget extends SlotWidget { + + private InputSlot inputSlot; + + public InputSlotWidget(InputSlot slot, DiagramScene scene, Widget parent, FigureWidget fw) { + super(slot, scene, parent, fw); + inputSlot = slot; + init(); + getFigureWidget().getLeftWidget().addChild(this); + } + + public InputSlot getInputSlot() { + return inputSlot; + } + + protected Point calculateRelativeLocation() { + if (getFigureWidget().getBounds() == null) { + return new Point(0, 0); + } + + double x = 0; + List slots = inputSlot.getFigure().getInputSlots(); + assert slots.contains(inputSlot); + return new Point((int) x, (int) (calculateRelativeY(slots.size(), slots.indexOf(inputSlot)))); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java new file mode 100644 index 00000000000..902413eac87 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java @@ -0,0 +1,293 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.view.DiagramScene; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.awt.geom.Line2D; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JPopupMenu; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.action.PopupMenuProvider; +import org.netbeans.api.visual.animator.SceneAnimator; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class LineWidget extends Widget implements PopupMenuProvider { + + public final int BORDER = 8; + public final int ARROW_SIZE = 6; + public final int BOLD_ARROW_SIZE = 7; + public final int HOVER_ARROW_SIZE = 8; + public final int BOLD_STROKE_WIDTH = 2; + public final int HOVER_STROKE_WIDTH = 3; + private static double ZOOM_FACTOR = 0.1; + private OutputSlot outputSlot; + private DiagramScene scene; + private List connections; + private Point from; + private Point to; + private Rectangle clientArea; + private Color color = Color.BLACK; + private LineWidget predecessor; + private List successors; + private boolean highlighted; + private boolean popupVisible; + private boolean isBold; + private boolean isDashed; + + public LineWidget(DiagramScene scene, OutputSlot s, List connections, Point from, Point to, LineWidget predecessor, SceneAnimator animator, boolean isBold, boolean isDashed) { + super(scene); + this.scene = scene; + this.outputSlot = s; + this.connections = connections; + this.from = from; + this.to = to; + this.predecessor = predecessor; + this.successors = new ArrayList(); + if (predecessor != null) { + predecessor.addSuccessor(this); + } + + this.isBold = isBold; + this.isDashed = isDashed; + + int minX = from.x; + int minY = from.y; + int maxX = to.x; + int maxY = to.y; + if (minX > maxX) { + int tmp = minX; + minX = maxX; + maxX = tmp; + } + + if (minY > maxY) { + int tmp = minY; + minY = maxY; + maxY = tmp; + } + + clientArea = new Rectangle(minX, minY, maxX - minX + 1, maxY - minY + 1); + clientArea.grow(BORDER, BORDER); + + if (connections.size() > 0) { + color = connections.get(0).getColor(); + } + + this.setCheckClipping(true); + + this.getActions().addAction(ActionFactory.createPopupMenuAction(this)); + if (animator == null) { + this.setBackground(color); + } else { + this.setBackground(Color.WHITE); + animator.animateBackgroundColor(this, color); + } + } + + public Point getFrom() { + return from; + } + + public Point getTo() { + return to; + } + + private void addSuccessor(LineWidget widget) { + this.successors.add(widget); + } + + @Override + protected Rectangle calculateClientArea() { + return clientArea; + } + + @Override + protected void paintWidget() { + if (scene.getRealZoomFactor() < ZOOM_FACTOR) { + return; + } + + Graphics2D g = getScene().getGraphics(); + g.setPaint(this.getBackground()); + ObjectState state = this.getState(); + float width = 1.0f; + + if (isBold) { + width = BOLD_STROKE_WIDTH; + } + + if (highlighted || popupVisible) { + width = HOVER_STROKE_WIDTH; + } + + Stroke oldStroke = g.getStroke(); + if (isDashed) { + float[] dashPattern = {5, 5, 5, 5}; + g.setStroke(new BasicStroke(width, BasicStroke.CAP_BUTT, + BasicStroke.JOIN_MITER, 10, + dashPattern, 0)); + } else { + g.setStroke(new BasicStroke(width)); + } + + g.drawLine(from.x, from.y, to.x, to.y); + + boolean sameFrom = false; + boolean sameTo = successors.size() == 0; + for (LineWidget w : successors) { + if (w.getFrom().equals(getTo())) { + sameTo = true; + } + } + + if (predecessor == null || predecessor.getTo().equals(getFrom())) { + sameFrom = true; + } + + + int size = ARROW_SIZE; + if (isBold) { + size = BOLD_ARROW_SIZE; + } + if (highlighted || popupVisible) { + size = HOVER_ARROW_SIZE; + } + if (!sameFrom) { + g.fillPolygon( + new int[]{from.x - size / 2, from.x + size / 2, from.x}, + new int[]{from.y - size / 2, from.y - size / 2, from.y + size / 2}, + 3); + } + if (!sameTo) { + g.fillPolygon( + new int[]{to.x - size / 2, to.x + size / 2, to.x}, + new int[]{to.y - size / 2, to.y - size / 2, to.y + size / 2}, + 3); + } + g.setStroke(oldStroke); + } + + private void setHighlighted(boolean b) { + this.highlighted = b; + this.revalidate(true); + } + + private void setPopupVisible(boolean b) { + this.popupVisible = b; + this.revalidate(true); + } + + @Override + public boolean isHitAt(Point localPoint) { + return Line2D.ptLineDistSq(from.x, from.y, to.x, to.y, localPoint.x, localPoint.y) <= BORDER * BORDER; + } + + @Override + protected void notifyStateChanged(ObjectState previousState, ObjectState state) { + if (previousState.isHovered() != state.isHovered()) { + setRecursiveHighlighted(state.isHovered()); + } + } + + private void setRecursiveHighlighted(boolean b) { + LineWidget cur = predecessor; + while (cur != null) { + cur.setHighlighted(b); + cur = cur.predecessor; + } + + highlightSuccessors(b); + this.setHighlighted(b); + } + + private void highlightSuccessors(boolean b) { + for (LineWidget s : successors) { + s.setHighlighted(b); + s.highlightSuccessors(b); + } + } + + private void setRecursivePopupVisible(boolean b) { + LineWidget cur = predecessor; + while (cur != null) { + cur.setPopupVisible(b); + cur = cur.predecessor; + } + + popupVisibleSuccessors(b); + setPopupVisible(b); + } + + private void popupVisibleSuccessors(boolean b) { + for (LineWidget s : successors) { + s.setPopupVisible(b); + s.popupVisibleSuccessors(b); + } + } + + public JPopupMenu getPopupMenu(Widget widget, Point localLocation) { + JPopupMenu menu = new JPopupMenu(); + menu.add(scene.createGotoAction(outputSlot.getFigure())); + menu.addSeparator(); + + for (Connection c : connections) { + InputSlot s = c.getInputSlot(); + menu.add(scene.createGotoAction(s.getFigure())); + } + + final LineWidget w = this; + menu.addPopupMenuListener(new PopupMenuListener() { + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + w.setRecursivePopupVisible(true); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + w.setRecursivePopupVisible(false); + } + + public void popupMenuCanceled(PopupMenuEvent e) { + } + }); + + return menu; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/MultiConnectionWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/MultiConnectionWidget.java new file mode 100644 index 00000000000..b65c5eab1cf --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/MultiConnectionWidget.java @@ -0,0 +1,281 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.Connection; +import com.sun.hotspot.igv.graph.InputSlot; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Slot; +import com.sun.hotspot.igv.view.DiagramScene; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.awt.geom.Line2D; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; +import javax.swing.JPopupMenu; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; +import org.netbeans.api.visual.action.PopupMenuProvider; +import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class MultiConnectionWidget extends Widget implements PopupMenuProvider { + + public final int BORDER = 4; + public final int HOVER_STROKE_WIDTH = 3; + + private static class Route { + + public Point from; + public Point to; + public SortedSet inputSlots; + public boolean decorateStart; + public boolean decorateEnd; + + public Route(Point from, Point to) { + assert from != null; + assert to != null; + this.from = from; + this.to = to; + this.inputSlots = new TreeSet(); + } + + @Override + public boolean equals(Object obj) { + + if (obj instanceof Route) { + Route r = (Route) obj; + return r.from.equals(from) && r.to.equals(to); + } + + return super.equals(obj); + } + + @Override + public int hashCode() { + return ((((from.x * 1711) + from.y) * 1711 + to.x) * 1711 + to.y); + } + } + private Rectangle clientArea; + private OutputSlot outputSlot; + private Map> routeMap; + private List routeList; + private Color color; + private DiagramScene diagramScene; + private boolean popupVisible; + + /** Creates a new instance of MultiConnectionWidget */ + public MultiConnectionWidget(OutputSlot outputSlot, DiagramScene scene) { + super(scene); + + this.diagramScene = scene; + this.outputSlot = outputSlot; + this.setCheckClipping(true); + + routeMap = new HashMap>(); + routeList = new ArrayList(); + color = Color.BLACK; + + for (Connection c : outputSlot.getConnections()) { + List controlPoints = c.getControlPoints(); + InputSlot inputSlot = (InputSlot) c.getTo(); + color = c.getColor(); + + for (int i = 1; i < controlPoints.size(); i++) { + Point prev = controlPoints.get(i - 1); + Point cur = controlPoints.get(i); + + if (prev != null && cur != null) { + Route r = new Route(prev, cur); + if (routeMap.containsKey(r)) { + SortedSet set = routeMap.get(r); + set.add(inputSlot); + } else { + SortedSet set = new TreeSet(Slot.slotFigureComparator); + set.add(inputSlot); + routeMap.put(r, set); + routeList.add(r); + } + } + } + } + + if (routeList.size() == 0) { + clientArea = new Rectangle(); + } else { + for (Route r : routeList) { + + int x = r.from.x; + int y = r.from.y; + + int x2 = r.to.x; + int y2 = r.to.y; + + if (x > x2) { + int tmp = x; + x = x2; + x2 = tmp; + } + + if (y > y2) { + int tmp = y; + y = y2; + y2 = tmp; + } + + int width = x2 - x + 1; + int height = y2 - y + 1; + + Rectangle rect = new Rectangle(x, y, width, height); + if (clientArea == null) { + clientArea = rect; + } else { + clientArea = clientArea.union(rect); + } + } + + clientArea.grow(BORDER, BORDER); + } + } + + private void setHoverPosition(Point location) { + Route r = getNearest(location); + } + + private Route getNearest(Point localLocation) { + + double minDist = Double.MAX_VALUE; + Route result = null; + for (Route r : routeList) { + double dist = Line2D.ptSegDistSq((double) r.from.x, (double) r.from.y, (double) r.to.x, (double) r.to.y, (double) localLocation.x, (double) localLocation.y); + if (dist < minDist) { + result = r; + minDist = dist; + } + } + + assert result != null; + + return result; + } + + @Override + public boolean isHitAt(Point localLocation) { + if (!super.isHitAt(localLocation)) { + return false; + } + + for (Route r : routeList) { + double dist = Line2D.ptSegDistSq((double) r.from.x, (double) r.from.y, (double) r.to.x, (double) r.to.y, (double) localLocation.x, (double) localLocation.y); + if (dist < BORDER * BORDER) { + setHoverPosition(localLocation); + return true; + } + } + + return false; + } + + @Override + protected Rectangle calculateClientArea() { + return clientArea; + } + + @Override + protected void paintWidget() { + Graphics2D g = getScene().getGraphics(); + //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + g.setColor(this.color); + ObjectState state = this.getState(); + float width = 1.0f; + if (state.isHovered() || this.popupVisible) { + width = HOVER_STROKE_WIDTH; + } + + Stroke oldStroke = g.getStroke(); + g.setStroke(new BasicStroke(width)); + for (Route r : routeList) { + g.drawLine(r.from.x, r.from.y, r.to.x, r.to.y); + } + g.setStroke(oldStroke); + } + + @Override + protected void notifyStateChanged(ObjectState previousState, ObjectState state) { + + boolean repaint = false; + + if (state.isHovered() != previousState.isHovered()) { + repaint = true; + } + + repaint(); + } + + public JPopupMenu getPopupMenu(Widget widget, Point localLocation) { + JPopupMenu menu = new JPopupMenu(); + Route r = getNearest(localLocation); + assert r != null; + assert routeMap.containsKey(r); + + menu.add(diagramScene.createGotoAction(outputSlot.getFigure())); + menu.addSeparator(); + + SortedSet set = this.routeMap.get(r); + for (InputSlot s : set) { + menu.add(diagramScene.createGotoAction(s.getFigure())); + } + + final MultiConnectionWidget w = this; + menu.addPopupMenuListener(new PopupMenuListener() { + + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + w.popupVisible = true; + w.repaint(); + } + + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + w.popupVisible = false; + w.repaint(); + } + + public void popupMenuCanceled(PopupMenuEvent e) { + } + }); + + return menu; + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/OutputSlotWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/OutputSlotWidget.java new file mode 100644 index 00000000000..351e6ddd7b4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/OutputSlotWidget.java @@ -0,0 +1,61 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.view.DiagramScene; +import java.awt.Point; +import java.util.List; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public class OutputSlotWidget extends SlotWidget { + + private OutputSlot outputSlot; + + public OutputSlotWidget(OutputSlot slot, DiagramScene scene, Widget parent, FigureWidget fw) { + super(slot, scene, parent, fw); + outputSlot = slot; + init(); + getFigureWidget().getRightWidget().addChild(this); + } + + public OutputSlot getOutputSlot() { + return outputSlot; + } + + protected Point calculateRelativeLocation() { + if (getFigureWidget().getBounds() == null) { + return new Point(0, 0); + } + + double x = this.getFigureWidget().getBounds().width; + List slots = outputSlot.getFigure().getOutputSlots(); + assert slots.contains(outputSlot); + return new Point((int) x, (int) (calculateRelativeY(slots.size(), slots.indexOf(outputSlot)))); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/SlotWidget.java b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/SlotWidget.java new file mode 100644 index 00000000000..d5aac2f6feb --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/SlotWidget.java @@ -0,0 +1,126 @@ +/* + * Copyright 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. + * + * 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.hotspot.igv.view.widgets; + +import com.sun.hotspot.igv.graph.Figure; +import com.sun.hotspot.igv.graph.OutputSlot; +import com.sun.hotspot.igv.graph.Slot; +import com.sun.hotspot.igv.view.*; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.geom.Rectangle2D; +import org.netbeans.api.visual.widget.Widget; + +/** + * + * @author Thomas Wuerthinger + */ +public abstract class SlotWidget extends Widget { + + private Slot slot; + private FigureWidget figureWidget; + private Image bufferImage; + private static double TEXT_ZOOM_FACTOR = 0.9; + private static double ZOOM_FACTOR = 0.6; + private DiagramScene scene; + + public SlotWidget(Slot slot, DiagramScene scene, Widget parent, FigureWidget fw) { + super(scene); + this.scene = scene; + this.slot = slot; + figureWidget = fw; + this.setToolTipText("" + slot.getName() + ""); + this.setCheckClipping(true); + } + + public Point getAnchorPosition() { + Point p = new Point(figureWidget.getFigure().getPosition()); + Point p2 = slot.getRelativePosition(); + p.translate(p2.x, p2.y); + return p; + } + + protected void init() { + + Point p = calculateRelativeLocation(); + Rectangle r = calculateClientArea(); + p = new Point(p.x, p.y - r.height / 2); + this.setPreferredLocation(p); + } + + public Slot getSlot() { + return slot; + } + + public FigureWidget getFigureWidget() { + return figureWidget; + } + + @Override + protected void paintWidget() { + + if (scene.getRealZoomFactor() < ZOOM_FACTOR) { + return; + } + + if (bufferImage == null) { + Graphics2D g = this.getGraphics(); + g.setColor(Color.DARK_GRAY); + int w = this.getBounds().width; + int h = this.getBounds().height; + + if (getSlot().getShortName() != null && getSlot().getShortName().length() > 0 && scene.getRealZoomFactor() >= TEXT_ZOOM_FACTOR) { + Font f = new Font("Arial", Font.PLAIN, 8); + g.setFont(f.deriveFont(7.5f)); + Rectangle2D r1 = g.getFontMetrics().getStringBounds(getSlot().getShortName(), g); + g.drawString(getSlot().getShortName(), (int) (this.getBounds().width - r1.getWidth()) / 2, (int) (this.getBounds().height + r1.getHeight()) / 2); + } else { + + if (slot instanceof OutputSlot) { + g.fillArc(w / 4, -h / 4 - 1, w / 2, h / 2, 180, 180); + } else { + g.fillArc(w / 4, 3 * h / 4, w / 2, h / 2, 0, 180); + } + } + } + } + + @Override + protected Rectangle calculateClientArea() { + return new Rectangle(0, 0, Figure.SLOT_WIDTH, Figure.SLOT_WIDTH); + } + + protected abstract Point calculateRelativeLocation(); + + protected double calculateRelativeY(int size, int index) { + assert index >= 0 && index < size; + assert size > 0; + double height = getFigureWidget().getBounds().getHeight(); + return height * (index + 1) / (size + 1); + } +} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties new file mode 100644 index 00000000000..196dde41698 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -0,0 +1,7 @@ +currentVersion=IdealGraphVisualizer {0} +LBL_splash_window_title=Starting IdealGraphVisualizer +SPLASH_WIDTH=475 +SplashProgressBarBounds=0,268,473,6 +SplashProgressBarColor=0xFFFFFF +SplashRunningTextBounds=269,253,205,12 +SplashRunningTextColor=0xFFFFFF diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/frame.gif b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/frame.gif new file mode 100644 index 00000000000..43353c9e2e1 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/frame.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/splash.gif b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/splash.gif new file mode 100644 index 00000000000..949861e8fd7 Binary files /dev/null and b/hotspot/src/share/tools/IdealGraphVisualizer/branding/core/core.jar/org/netbeans/core/startup/splash.gif differ diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/hotspot/src/share/tools/IdealGraphVisualizer/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties new file mode 100644 index 00000000000..1263cad01ec --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -0,0 +1,2 @@ +CTL_MainWindow_Title=IdealGraphVisualizer {0} +CTL_MainWindow_Title_No_Project=IdealGraphVisualizer {0} diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/build.xml b/hotspot/src/share/tools/IdealGraphVisualizer/build.xml new file mode 100644 index 00000000000..fb95e5f39d5 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/build.xml @@ -0,0 +1,8 @@ + + + + + + Builds the module suite IdealGraphVisualizer. + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/build-impl.xml b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/build-impl.xml new file mode 100644 index 00000000000..f056e104db4 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/build-impl.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/genfiles.properties b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/genfiles.properties new file mode 100644 index 00000000000..758cede0149 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=72833581 +build.xml.script.CRC32=e9c757c5 +build.xml.stylesheet.CRC32=531c622b +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=72833581 +nbproject/build-impl.xml.script.CRC32=1b6f3648 +nbproject/build-impl.xml.stylesheet.CRC32=196c7090 diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties new file mode 100644 index 00000000000..4768730f129 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/platform.properties @@ -0,0 +1,29 @@ +# Deprecated since 5.0u1; for compatibility with 5.0: +disabled.clusters=\ + apisupport1,\ + harness,\ + ide8,\ + java1,\ + nb6.0,\ + profiler2 +disabled.modules=\ + org.netbeans.core.execution,\ + org.netbeans.core.multiview,\ + org.netbeans.core.output2,\ + org.netbeans.modules.applemenu,\ + org.netbeans.modules.autoupdate.services,\ + org.netbeans.modules.autoupdate.ui,\ + org.netbeans.modules.core.kit,\ + org.netbeans.modules.favorites,\ + org.netbeans.modules.javahelp,\ + org.netbeans.modules.masterfs,\ + org.netbeans.modules.options.keymap,\ + org.netbeans.modules.sendopts,\ + org.netbeans.modules.templates,\ + org.openide.compat,\ + org.openide.execution,\ + org.openide.util.enumerations +enabled.clusters=\ + platform7 +nbjdk.active=default +nbplatform.active=default diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties new file mode 100644 index 00000000000..1b524d231f3 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.properties @@ -0,0 +1,40 @@ +app.icon=branding/core/core.jar/org/netbeans/core/startup/frame48.gif +app.name=idealgraphvisualizer +app.title=IdealGraphVisualizer +branding.token=${app.name} +modules=\ + ${project.com.sun.hotspot.igv.graph}:\ + ${project.com.sun.hotspot.igv.coordinator}:\ + ${project.com.sun.hotspot.igv.filter}:\ + ${project.com.sun.hotspot.igv.hierarchicallayout}:\ + ${project.com.sun.hotspot.igv.layout}:\ + ${project.com.sun.hotspot.igv.controlflow}:\ + ${project.com.sun.hotspot.igv.data}:\ + ${project.com.sun.hotspot.igv.view}:\ + ${project.com.sun.hotspot.igv.bytecodes}:\ + ${project.com.sun.hotspot.igv.difference}:\ + ${project.com.sun.hotspot.igv.settings}:\ + ${project.com.sun.hotspot.igv.util}:\ + ${project.com.sun.hotspot.igv.rhino}:\ + ${project.com.sun.hotspot.igv.svg}:\ + ${project.com.sun.hotspot.connection}:\ + ${project.com.sun.hotspot.igv.servercompilerscheduler}:\ + ${project.com.sun.hotspot.igv.filterwindow} +project.com.sun.hotspot.connection=NetworkConnection +project.com.sun.hotspot.igv.bytecodes=Bytecodes +project.com.sun.hotspot.igv.controlflow=ControlFlow +project.com.sun.hotspot.igv.coordinator=Coordinator +project.com.sun.hotspot.igv.data=Data +project.com.sun.hotspot.igv.difference=Difference +project.com.sun.hotspot.igv.filter=Filter +project.com.sun.hotspot.igv.filterwindow=FilterWindow +project.com.sun.hotspot.igv.graph=Graph +project.com.sun.hotspot.igv.hierarchicallayout=HierarchicalLayout +project.com.sun.hotspot.igv.layout=Layout +project.com.sun.hotspot.igv.rhino=RhinoScriptEngineProxy +project.com.sun.hotspot.igv.servercompilerscheduler=ServerCompiler +project.com.sun.hotspot.igv.settings=Settings +project.com.sun.hotspot.igv.svg=BatikSVGProxy +project.com.sun.hotspot.igv.view=View +project.com.sun.hotspot.igv.util=Util +run.args = -server -J-Xms64m -J-Xmx512m -J-da diff --git a/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.xml b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.xml new file mode 100644 index 00000000000..47400216ae9 --- /dev/null +++ b/hotspot/src/share/tools/IdealGraphVisualizer/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.apisupport.project.suite + + + IdealGraphVisualizer + + + diff --git a/hotspot/src/share/tools/MakeDeps/Database.java b/hotspot/src/share/tools/MakeDeps/Database.java index c26ef1d6fc3..5cec93b7d03 100644 --- a/hotspot/src/share/tools/MakeDeps/Database.java +++ b/hotspot/src/share/tools/MakeDeps/Database.java @@ -36,6 +36,7 @@ public class Database { private FileList outerFiles; private FileList indivIncludes; private FileList grandInclude; // the results for the grand include file + private HashMap platformDepFiles; private long threshold; private int nOuterFiles; private int nPrecompiledFiles; @@ -57,6 +58,7 @@ public class Database { outerFiles = new FileList("outerFiles", plat); indivIncludes = new FileList("IndivIncludes", plat); grandInclude = new FileList(plat.getGIFileTemplate().nameOfList(), plat); + platformDepFiles = new HashMap(); threshold = t; nOuterFiles = 0; @@ -209,6 +211,10 @@ public class Database { FileList p = allFiles.listForFile(includer); p.setPlatformDependentInclude(pdName.dirPreStemSuff()); + // Record the implicit include of this file so that the + // dependencies for precompiled headers can mention it. + platformDepFiles.put(newIncluder, includer); + // Add an implicit dependency on platform // specific file for the generic file @@ -408,6 +414,12 @@ public class Database { for (Iterator iter = grandInclude.iterator(); iter.hasNext(); ) { FileList list = (FileList) iter.next(); gd.println(list.getName() + " \\"); + String platformDep = platformDepFiles.get(list.getName()); + if (platformDep != null) { + // make sure changes to the platform dependent file will + // cause regeneration of the pch file. + gd.println(platformDep + " \\"); + } } gd.println(); gd.println(); diff --git a/hotspot/src/share/vm/adlc/adlc.hpp b/hotspot/src/share/vm/adlc/adlc.hpp index fc81ee00a5e..14bc5d6b738 100644 --- a/hotspot/src/share/vm/adlc/adlc.hpp +++ b/hotspot/src/share/vm/adlc/adlc.hpp @@ -29,11 +29,7 @@ // standard library constants #include "stdio.h" #include "stdlib.h" -#if _MSC_VER >= 1300 // Visual C++ 7.0 or later #include -#else -#include -#endif #include "string.h" #include "ctype.h" #include "stdarg.h" diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp index 534c62a3311..0aa15064c5b 100644 --- a/hotspot/src/share/vm/adlc/archDesc.cpp +++ b/hotspot/src/share/vm/adlc/archDesc.cpp @@ -1,5 +1,5 @@ // -// Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +// 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 diff --git a/hotspot/src/share/vm/adlc/filebuff.hpp b/hotspot/src/share/vm/adlc/filebuff.hpp index fa84e09bd2a..fdfa985db4c 100644 --- a/hotspot/src/share/vm/adlc/filebuff.hpp +++ b/hotspot/src/share/vm/adlc/filebuff.hpp @@ -23,13 +23,9 @@ */ // FILEBUFF.HPP - Definitions for parser file buffering routines - -#if _MSC_VER >= 1300 // Visual C++ 7.0 or later #include -#else -#include -#endif +using namespace std; // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES typedef struct { const char *_name; diff --git a/hotspot/src/share/vm/adlc/forms.cpp b/hotspot/src/share/vm/adlc/forms.cpp index 7bd2093851e..e9d7de211ea 100644 --- a/hotspot/src/share/vm/adlc/forms.cpp +++ b/hotspot/src/share/vm/adlc/forms.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -252,6 +252,7 @@ Form::DataType Form::is_load_from_memory(const char *opType) const { if( strcmp(opType,"LoadF")==0 ) return Form::idealF; if( strcmp(opType,"LoadI")==0 ) return Form::idealI; if( strcmp(opType,"LoadKlass")==0 ) return Form::idealP; + if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN; if( strcmp(opType,"LoadL")==0 ) return Form::idealL; if( strcmp(opType,"LoadL_unaligned")==0 ) return Form::idealL; if( strcmp(opType,"LoadPLocked")==0 ) return Form::idealP; diff --git a/hotspot/src/share/vm/adlc/forms.hpp b/hotspot/src/share/vm/adlc/forms.hpp index dfa34454733..c510ac43aef 100644 --- a/hotspot/src/share/vm/adlc/forms.hpp +++ b/hotspot/src/share/vm/adlc/forms.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index eab02499c2d..47fe6ae04eb 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -729,6 +729,7 @@ bool InstructForm::captures_bottom_type() const { !strcmp(_matrule->_rChild->_opType,"DecodeN") || !strcmp(_matrule->_rChild->_opType,"EncodeP") || !strcmp(_matrule->_rChild->_opType,"LoadN") || + !strcmp(_matrule->_rChild->_opType,"LoadNKlass") || !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception !strcmp(_matrule->_rChild->_opType,"CheckCastPP")) ) return true; else if ( is_ideal_load() == Form::idealP ) return true; @@ -3313,7 +3314,7 @@ int MatchNode::needs_ideal_memory_edge(FormDict &globals) const { "Store8B","Store4B","Store8C","Store4C","Store2C", "Load4I" ,"Load2I" ,"Load2L" ,"Load2D" ,"Load4F" ,"Load2F" ,"Load16B" , "Load8B" ,"Load4B" ,"Load8C" ,"Load4C" ,"Load2C" ,"Load8S", "Load4S","Load2S", - "LoadRange", "LoadKlass", "LoadL_unaligned", "LoadD_unaligned", + "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned", "LoadPLocked", "LoadLLocked", "StorePConditional", "StoreLConditional", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN", diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp index 168b932179c..eb33e67b376 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp index 0640f0a3250..78f16078381 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index 62c9d232f72..dcf1f0dcd94 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -246,6 +246,24 @@ void AbstractAssembler::block_comment(const char* comment) { } } +bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { + // Exception handler checks the nmethod's implicit null checks table + // only when this method returns false. +#ifndef SPARC + // Sparc does not have based addressing + if (UseCompressedOops) { + // The first page after heap_base is unmapped and + // the 'offset' is equal to [heap_base + offset] for + // narrow oop implicit null checks. + uintptr_t heap_base = (uintptr_t)Universe::heap_base(); + if ((uintptr_t)offset >= heap_base) { + // Normalize offset for the next check. + offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1)); + } + } +#endif // SPARC + return offset < 0 || os::vm_page_size() <= offset; +} #ifndef PRODUCT void Label::print_instructions(MacroAssembler* masm) const { diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index cd88a2ab160..cbd16d3e8b3 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 87f02215d97..6880fc59d5f 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 46e725b5a14..7335abb0731 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 8f42fe14327..e7321ccc351 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index fc875ca552d..4b3526df31b 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -218,6 +218,13 @@ void BCEscapeAnalyzer::invoke(StateInfo &state, Bytecodes::Code code, ciMethod* ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder); ciInstanceKlass* actual_recv = callee_holder; + // some methods are obviously bindable without any type checks so + // convert them directly to an invokespecial. + if (target->is_loaded() && !target->is_abstract() && + target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) { + code = Bytecodes::_invokespecial; + } + // compute size of arguments int arg_size = target->arg_size(); if (!target->is_loaded() && code == Bytecodes::_invokestatic) { diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp index 3af67e1fd59..8c5122c1486 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/ci/ciField.hpp b/hotspot/src/share/vm/ci/ciField.hpp index 72a64c03a63..193d848d41c 100644 --- a/hotspot/src/share/vm/ci/ciField.hpp +++ b/hotspot/src/share/vm/ci/ciField.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp index ab9b059f0ce..1053727a93f 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -392,12 +392,12 @@ int ciInstanceKlass::compute_nonstatic_fields() { assert(!is_java_lang_Object(), "bootstrap OK"); // Size in bytes of my fields, including inherited fields. - int fsize = nonstatic_field_size() * wordSize; + int fsize = nonstatic_field_size() * heapOopSize; ciInstanceKlass* super = this->super(); GrowableArray* super_fields = NULL; if (super != NULL && super->has_nonstatic_fields()) { - int super_fsize = super->nonstatic_field_size() * wordSize; + int super_fsize = super->nonstatic_field_size() * heapOopSize; int super_flen = super->nof_nonstatic_fields(); super_fields = super->_nonstatic_fields; assert(super_flen == 0 || super_fields != NULL, "first get nof_fields"); @@ -438,7 +438,7 @@ int ciInstanceKlass::compute_nonstatic_fields() { // This is a minor inefficiency classFileParser.cpp. last_offset = offset + size; } - assert(last_offset <= (int)sizeof(oopDesc) + fsize, "no overflow"); + assert(last_offset <= (int)instanceOopDesc::base_offset_in_bytes() + fsize, "no overflow"); #endif _nonstatic_fields = fields; diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index a843a9251ea..a60020adc34 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index 2c6c5aa272d..c23944d35c6 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -878,7 +878,7 @@ int ciMethod::instructions_size() { (TieredCompilation && code->compiler() != NULL && code->compiler()->is_c1())) { return 0; } - return code->code_size(); + return code->code_end() - code->verified_entry_point(); ) } diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp index 4c596bbc4fb..9bfba219b88 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.hpp b/hotspot/src/share/vm/ci/ciMethodBlocks.hpp index b4398f39f4a..edfdf19b07e 100644 --- a/hotspot/src/share/vm/ci/ciMethodBlocks.hpp +++ b/hotspot/src/share/vm/ci/ciMethodBlocks.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp index 68591961bce..adb854680d8 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.cpp +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp index 91ed83f61eb..cd7fa830e22 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.hpp +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index 649b7354315..1f862f85e12 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 580aa41ef0c..7ee8ce98403 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -44,6 +44,7 @@ // Used for backward compatibility reasons: // - to check for javac bug fixes that happened after 1.5 +// - also used as the max version when running in jdk6 #define JAVA_6_VERSION 50 @@ -2664,8 +2665,8 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, fac.static_byte_count ), wordSize ); static_field_size = (next_static_type_offset - next_static_oop_offset) / wordSize; - first_nonstatic_field_offset = (instanceOopDesc::header_size() + - nonstatic_field_size) * wordSize; + first_nonstatic_field_offset = instanceOopDesc::base_offset_in_bytes() + + nonstatic_field_size * heapOopSize; next_nonstatic_field_offset = first_nonstatic_field_offset; // Add fake fields for java.lang.Class instances (also see below) @@ -2734,9 +2735,9 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, next_nonstatic_byte_offset = next_nonstatic_short_offset + (nonstatic_short_count * BytesPerShort); next_nonstatic_type_offset = align_size_up((next_nonstatic_byte_offset + - nonstatic_byte_count ), wordSize ); + nonstatic_byte_count ), heapOopSize ); orig_nonstatic_field_size = nonstatic_field_size + - ((next_nonstatic_type_offset - first_nonstatic_field_offset)/wordSize); + ((next_nonstatic_type_offset - first_nonstatic_field_offset)/heapOopSize); } #endif bool compact_fields = CompactFields; @@ -2791,18 +2792,8 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, int nonstatic_short_space_offset; int nonstatic_byte_space_offset; - bool compact_into_header = (UseCompressedOops && - allocation_style == 1 && compact_fields && - !super_has_nonstatic_fields); - - if( compact_into_header || nonstatic_double_count > 0 ) { - int offset; - // Pack something in with the header if no super klass has done so. - if (compact_into_header) { - offset = oopDesc::klass_gap_offset_in_bytes(); - } else { - offset = next_nonstatic_double_offset; - } + if( nonstatic_double_count > 0 ) { + int offset = next_nonstatic_double_offset; next_nonstatic_double_offset = align_size_up(offset, BytesPerLong); if( compact_fields && offset != next_nonstatic_double_offset ) { // Allocate available fields into the gap before double field. @@ -2830,8 +2821,7 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, } // Allocate oop field in the gap if there are no other fields for that. nonstatic_oop_space_offset = offset; - if(!compact_into_header && length >= heapOopSize && - nonstatic_oop_count > 0 && + if( length >= heapOopSize && nonstatic_oop_count > 0 && allocation_style != 0 ) { // when oop fields not first nonstatic_oop_count -= 1; nonstatic_oop_space_count = 1; // Only one will fit @@ -2854,14 +2844,13 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, } else { // allocation_style == 1 next_nonstatic_oop_offset = next_nonstatic_byte_offset + nonstatic_byte_count; if( nonstatic_oop_count > 0 ) { - notaligned_offset = next_nonstatic_oop_offset; next_nonstatic_oop_offset = align_size_up(next_nonstatic_oop_offset, heapOopSize); } notaligned_offset = next_nonstatic_oop_offset + (nonstatic_oop_count * heapOopSize); } - next_nonstatic_type_offset = align_size_up(notaligned_offset, wordSize ); + next_nonstatic_type_offset = align_size_up(notaligned_offset, heapOopSize ); nonstatic_field_size = nonstatic_field_size + ((next_nonstatic_type_offset - - first_nonstatic_field_offset)/wordSize); + - first_nonstatic_field_offset)/heapOopSize); // Iterate over fields again and compute correct offsets. // The field allocation type was temporarily stored in the offset slot. @@ -2962,9 +2951,10 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, // Size of instances int instance_size; + next_nonstatic_type_offset = align_size_up(notaligned_offset, wordSize ); instance_size = align_object_size(next_nonstatic_type_offset / wordSize); - assert(instance_size == align_object_size(instanceOopDesc::header_size() + nonstatic_field_size), "consistent layout helper value"); + assert(instance_size == align_object_size(align_size_up((instanceOopDesc::base_offset_in_bytes() + nonstatic_field_size*heapOopSize), wordSize) / wordSize), "consistent layout helper value"); // Size of non-static oop map blocks (in words) allocated at end of klass int nonstatic_oop_map_size = compute_oop_map_size(super_klass, nonstatic_oop_map_count, first_nonstatic_oop_offset); @@ -3122,13 +3112,15 @@ instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, #ifndef PRODUCT if( PrintCompactFieldsSavings ) { if( nonstatic_field_size < orig_nonstatic_field_size ) { - tty->print("[Saved %d of %3d words in %s]\n", - orig_nonstatic_field_size - nonstatic_field_size, - orig_nonstatic_field_size, this_klass->external_name()); + tty->print("[Saved %d of %d bytes in %s]\n", + (orig_nonstatic_field_size - nonstatic_field_size)*heapOopSize, + orig_nonstatic_field_size*heapOopSize, + this_klass->external_name()); } else if( nonstatic_field_size > orig_nonstatic_field_size ) { - tty->print("[Wasted %d over %3d words in %s]\n", - nonstatic_field_size - orig_nonstatic_field_size, - orig_nonstatic_field_size, this_klass->external_name()); + tty->print("[Wasted %d over %d bytes in %s]\n", + (nonstatic_field_size - orig_nonstatic_field_size)*heapOopSize, + orig_nonstatic_field_size*heapOopSize, + this_klass->external_name()); } } #endif @@ -3516,9 +3508,11 @@ 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; return (major >= JAVA_MIN_SUPPORTED_VERSION) && - (major <= JAVA_MAX_SUPPORTED_VERSION) && - ((major != JAVA_MAX_SUPPORTED_VERSION) || + (major <= max_version) && + ((major != max_version) || (minor <= JAVA_MAX_SUPPORTED_MINOR_VERSION)); } diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index 43d1ab9030d..5ec717c5857 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 713ee547520..65a07231a72 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1872,7 +1872,7 @@ oop java_lang_boxing_object::create(BasicType type, jvalue* value, TRAPS) { box->float_field_put(value_offset, value->f); break; case T_DOUBLE: - box->double_field_put(value_offset, value->d); + box->double_field_put(long_value_offset, value->d); break; case T_BYTE: box->byte_field_put(value_offset, value->b); @@ -1884,7 +1884,7 @@ oop java_lang_boxing_object::create(BasicType type, jvalue* value, TRAPS) { box->int_field_put(value_offset, value->i); break; case T_LONG: - box->long_field_put(value_offset, value->j); + box->long_field_put(long_value_offset, value->j); break; default: return NULL; @@ -1915,7 +1915,7 @@ BasicType java_lang_boxing_object::get_value(oop box, jvalue* value) { value->f = box->float_field(value_offset); break; case T_DOUBLE: - value->d = box->double_field(value_offset); + value->d = box->double_field(long_value_offset); break; case T_BYTE: value->b = box->byte_field(value_offset); @@ -1927,7 +1927,7 @@ BasicType java_lang_boxing_object::get_value(oop box, jvalue* value) { value->i = box->int_field(value_offset); break; case T_LONG: - value->j = box->long_field(value_offset); + value->j = box->long_field(long_value_offset); break; default: return T_ILLEGAL; @@ -1949,7 +1949,7 @@ BasicType java_lang_boxing_object::set_value(oop box, jvalue* value) { box->float_field_put(value_offset, value->f); break; case T_DOUBLE: - box->double_field_put(value_offset, value->d); + box->double_field_put(long_value_offset, value->d); break; case T_BYTE: box->byte_field_put(value_offset, value->b); @@ -1961,7 +1961,7 @@ BasicType java_lang_boxing_object::set_value(oop box, jvalue* value) { box->int_field_put(value_offset, value->i); break; case T_LONG: - box->long_field_put(value_offset, value->j); + box->long_field_put(long_value_offset, value->j); break; default: return T_ILLEGAL; @@ -2163,6 +2163,7 @@ int java_lang_reflect_Field::modifiers_offset; int java_lang_reflect_Field::signature_offset; int java_lang_reflect_Field::annotations_offset; int java_lang_boxing_object::value_offset; +int java_lang_boxing_object::long_value_offset; int java_lang_ref_Reference::referent_offset; int java_lang_ref_Reference::queue_offset; int java_lang_ref_Reference::next_offset; @@ -2282,10 +2283,7 @@ oop java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj( // are not available to determine the offset_of_static_fields. void JavaClasses::compute_hard_coded_offsets() { const int x = heapOopSize; - // Objects don't get allocated in the gap in the header with compressed oops - // for these special classes because hard coded offsets can't be conditional - // so base_offset_in_bytes() is wrong here, allocate after the header. - const int header = sizeof(instanceOopDesc); + const int header = instanceOopDesc::base_offset_in_bytes(); // Do the String Class java_lang_String::value_offset = java_lang_String::hc_value_offset * x + header; @@ -2308,7 +2306,8 @@ void JavaClasses::compute_hard_coded_offsets() { java_lang_Throwable::stackTrace_offset = java_lang_Throwable::hc_stackTrace_offset * x + header; // java_lang_boxing_object - java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset * x + header; + java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset + header; + java_lang_boxing_object::long_value_offset = align_size_up((java_lang_boxing_object::hc_value_offset + header), BytesPerLong); // java_lang_ref_Reference: java_lang_ref_Reference::referent_offset = java_lang_ref_Reference::hc_referent_offset * x + header; @@ -2322,7 +2321,7 @@ void JavaClasses::compute_hard_coded_offsets() { java_lang_ref_Reference::number_of_fake_oop_fields = 1; // java_lang_ref_SoftReference Class - java_lang_ref_SoftReference::timestamp_offset = java_lang_ref_SoftReference::hc_timestamp_offset * x + header; + java_lang_ref_SoftReference::timestamp_offset = align_size_up((java_lang_ref_SoftReference::hc_timestamp_offset * x + header), BytesPerLong); // Don't multiply static fields because they are always in wordSize units java_lang_ref_SoftReference::static_clock_offset = java_lang_ref_SoftReference::hc_static_clock_offset * x; @@ -2469,6 +2468,9 @@ void JavaClasses::check_offsets() { #define CHECK_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \ valid &= check_offset(klass_name, cpp_klass_name :: field_name ## _offset, #field_name, field_sig) +#define CHECK_LONG_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \ + valid &= check_offset(klass_name, cpp_klass_name :: long_ ## field_name ## _offset, #field_name, field_sig) + #define CHECK_STATIC_OFFSET(klass_name, cpp_klass_name, field_name, field_sig) \ valid &= check_static_offset(klass_name, cpp_klass_name :: static_ ## field_name ## _offset, #field_name, field_sig) @@ -2501,11 +2503,11 @@ void JavaClasses::check_offsets() { CHECK_OFFSET("java/lang/Boolean", java_lang_boxing_object, value, "Z"); CHECK_OFFSET("java/lang/Character", java_lang_boxing_object, value, "C"); CHECK_OFFSET("java/lang/Float", java_lang_boxing_object, value, "F"); - CHECK_OFFSET("java/lang/Double", java_lang_boxing_object, value, "D"); + CHECK_LONG_OFFSET("java/lang/Double", java_lang_boxing_object, value, "D"); CHECK_OFFSET("java/lang/Byte", java_lang_boxing_object, value, "B"); CHECK_OFFSET("java/lang/Short", java_lang_boxing_object, value, "S"); CHECK_OFFSET("java/lang/Integer", java_lang_boxing_object, value, "I"); - CHECK_OFFSET("java/lang/Long", java_lang_boxing_object, value, "J"); + CHECK_LONG_OFFSET("java/lang/Long", java_lang_boxing_object, value, "J"); // java.lang.ClassLoader diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 0331be3e12b..933d5b82d83 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -653,6 +653,7 @@ class java_lang_boxing_object: AllStatic { hc_value_offset = 0 }; static int value_offset; + static int long_value_offset; static oop initialize_and_allocate(BasicType type, TRAPS); public: @@ -665,7 +666,10 @@ class java_lang_boxing_object: AllStatic { static bool is_instance(oop box) { return basic_type(box) != T_ILLEGAL; } static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; } - static int value_offset_in_bytes() { return value_offset; } + static int value_offset_in_bytes(BasicType type) { + return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset : + value_offset; + } // Debugging friend class JavaClasses; @@ -747,7 +751,7 @@ class java_lang_ref_SoftReference: public java_lang_ref_Reference { public: enum { // The timestamp is a long field and may need to be adjusted for alignment. - hc_timestamp_offset = align_object_offset_(hc_discovered_offset + 1) + hc_timestamp_offset = hc_discovered_offset + 1 }; enum { hc_static_clock_offset = 0 diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 8d06a8abe90..772716311a2 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index 4b5bc16ff38..38d27d84841 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 5ece3847b77..8373f9beaa0 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index 36bab9ae5ac..c805af344e7 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 00a131f4e97..6a5a796d010 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -283,6 +283,7 @@ template(cache_field_name, "cache") \ template(value_name, "value") \ template(frontCacheEnabled_name, "frontCacheEnabled") \ + template(stringCacheEnabled_name, "stringCacheEnabled") \ \ /* non-intrinsic name/signature pairs: */ \ template(register_method_name, "register") \ @@ -564,6 +565,10 @@ do_name( copyOfRange_name, "copyOfRange") \ do_signature(copyOfRange_signature, "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;") \ \ + do_intrinsic(_equalsC, java_util_Arrays, equals_name, equalsC_signature, F_S) \ + do_name( equals_name, "equals") \ + do_signature(equalsC_signature, "([C[C)Z") \ + \ do_intrinsic(_invoke, java_lang_reflect_Method, invoke_name, object_array_object_object_signature, F_R) \ /* (symbols invoke_name and invoke_signature defined above) */ \ \ diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 3c027641ab3..6327bd11045 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/code/debugInfo.cpp b/hotspot/src/share/vm/code/debugInfo.cpp index a84cee16fab..59ad7a6b771 100644 --- a/hotspot/src/share/vm/code/debugInfo.cpp +++ b/hotspot/src/share/vm/code/debugInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index 5660b84b7e9..8af296fd489 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 14b10ea410c..282a4876262 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 4cfb4b9c3f5..d2c4af89501 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/code/scopeDesc.cpp b/hotspot/src/share/vm/code/scopeDesc.cpp index 96942b2ec59..7aed17f76a3 100644 --- a/hotspot/src/share/vm/code/scopeDesc.cpp +++ b/hotspot/src/share/vm/code/scopeDesc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/code/vmreg.cpp b/hotspot/src/share/vm/code/vmreg.cpp index 3d2aa69274d..bd11f3ca57d 100644 --- a/hotspot/src/share/vm/code/vmreg.cpp +++ b/hotspot/src/share/vm/code/vmreg.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 399cba3497b..af3942b196a 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 2984d647ea8..ccad14450d4 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/compiler/oopMap.hpp b/hotspot/src/share/vm/compiler/oopMap.hpp index ac05d570c04..5dc1046cd15 100644 --- a/hotspot/src/share/vm/compiler/oopMap.hpp +++ b/hotspot/src/share/vm/compiler/oopMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp index 91d381d5501..2bef9fe5a1f 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp index faedf5f7fdf..d45193be9fb 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -130,6 +130,7 @@ class TreeChunk : public FreeChunk { const size_t MIN_TREE_CHUNK_SIZE = sizeof(TreeChunk)/HeapWordSize; class BinaryTreeDictionary: public FreeBlockDictionary { + friend class VMStructs; bool _splay; size_t _totalSize; size_t _totalFreeBlocks; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp index 09d0db5e02b..6bddefce163 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -805,28 +805,30 @@ size_t CompactibleFreeListSpace::block_size(const HeapWord* p) const { // This must be volatile, or else there is a danger that the compiler // will compile the code below into a sometimes-infinite loop, by keeping // the value read the first time in a register. - oop o = (oop)p; - volatile oop* second_word_addr = o->klass_addr(); while (true) { - klassOop k = (klassOop)(*second_word_addr); // We must do this until we get a consistent view of the object. - if (FreeChunk::secondWordIndicatesFreeChunk((intptr_t)k)) { - FreeChunk* fc = (FreeChunk*)p; - volatile size_t* sz_addr = (volatile size_t*)(fc->size_addr()); - size_t res = (*sz_addr); - klassOop k2 = (klassOop)(*second_word_addr); // Read to confirm. - if (k == k2) { + if (FreeChunk::indicatesFreeChunk(p)) { + volatile FreeChunk* fc = (volatile FreeChunk*)p; + size_t res = fc->size(); + // If the object is still a free chunk, return the size, else it + // has been allocated so try again. + if (FreeChunk::indicatesFreeChunk(p)) { + assert(res != 0, "Block size should not be 0"); + return res; + } + } else { + // must read from what 'p' points to in each loop. + klassOop k = ((volatile oopDesc*)p)->klass_or_null(); + if (k != NULL) { + assert(k->is_oop(true /* ignore mark word */), "Should really be klass oop."); + oop o = (oop)p; + assert(o->is_parsable(), "Should be parsable"); + assert(o->is_oop(true /* ignore mark word */), "Should be an oop."); + size_t res = o->size_given_klass(k->klass_part()); + res = adjustObjectSize(res); assert(res != 0, "Block size should not be 0"); return res; } - } else if (k != NULL) { - assert(k->is_oop(true /* ignore mark word */), "Should really be klass oop."); - assert(o->is_parsable(), "Should be parsable"); - assert(o->is_oop(true /* ignore mark word */), "Should be an oop."); - size_t res = o->size_given_klass(k->klass_part()); - res = adjustObjectSize(res); - assert(res != 0, "Block size should not be 0"); - return res; } } } @@ -845,31 +847,31 @@ const { // This must be volatile, or else there is a danger that the compiler // will compile the code below into a sometimes-infinite loop, by keeping // the value read the first time in a register. - oop o = (oop)p; - volatile oop* second_word_addr = o->klass_addr(); DEBUG_ONLY(uint loops = 0;) while (true) { - klassOop k = (klassOop)(*second_word_addr); // We must do this until we get a consistent view of the object. - if (FreeChunk::secondWordIndicatesFreeChunk((intptr_t)k)) { - FreeChunk* fc = (FreeChunk*)p; - volatile size_t* sz_addr = (volatile size_t*)(fc->size_addr()); - size_t res = (*sz_addr); - klassOop k2 = (klassOop)(*second_word_addr); // Read to confirm. - if (k == k2) { + if (FreeChunk::indicatesFreeChunk(p)) { + volatile FreeChunk* fc = (volatile FreeChunk*)p; + size_t res = fc->size(); + if (FreeChunk::indicatesFreeChunk(p)) { assert(res != 0, "Block size should not be 0"); assert(loops == 0, "Should be 0"); return res; } - } else if (k != NULL && o->is_parsable()) { - assert(k->is_oop(), "Should really be klass oop."); - assert(o->is_oop(), "Should be an oop"); - size_t res = o->size_given_klass(k->klass_part()); - res = adjustObjectSize(res); - assert(res != 0, "Block size should not be 0"); - return res; } else { - return c->block_size_if_printezis_bits(p); + // must read from what 'p' points to in each loop. + klassOop k = ((volatile oopDesc*)p)->klass_or_null(); + if (k != NULL && ((oopDesc*)p)->is_parsable()) { + assert(k->is_oop(), "Should really be klass oop."); + oop o = (oop)p; + assert(o->is_oop(), "Should be an oop"); + size_t res = o->size_given_klass(k->klass_part()); + res = adjustObjectSize(res); + assert(res != 0, "Block size should not be 0"); + return res; + } else { + return c->block_size_if_printezis_bits(p); + } } assert(loops == 0, "Can loop at most once"); DEBUG_ONLY(loops++;) @@ -907,9 +909,8 @@ bool CompactibleFreeListSpace::block_is_obj(const HeapWord* p) const { // and those objects (if garbage) may have been modified to hold // live range information. // assert(ParallelGCThreads > 0 || _bt.block_start(p) == p, "Should be a block boundary"); - klassOop k = oop(p)->klass(); - intptr_t ki = (intptr_t)k; - if (FreeChunk::secondWordIndicatesFreeChunk(ki)) return false; + if (FreeChunk::indicatesFreeChunk(p)) return false; + klassOop k = oop(p)->klass_or_null(); if (k != NULL) { // Ignore mark word because it may have been used to // chain together promoted objects (the last one @@ -1027,7 +1028,7 @@ HeapWord* CompactibleFreeListSpace::allocate(size_t size) { FreeChunk* fc = (FreeChunk*)res; fc->markNotFree(); assert(!fc->isFree(), "shouldn't be marked free"); - assert(oop(fc)->klass() == NULL, "should look uninitialized"); + assert(oop(fc)->klass_or_null() == NULL, "should look uninitialized"); // Verify that the block offset table shows this to // be a single block, but not one which is unallocated. _bt.verify_single_block(res, size); @@ -2593,7 +2594,7 @@ HeapWord* CFLS_LAB::alloc(size_t word_sz) { } res->markNotFree(); assert(!res->isFree(), "shouldn't be marked free"); - assert(oop(res)->klass() == NULL, "should look uninitialized"); + assert(oop(res)->klass_or_null() == NULL, "should look uninitialized"); // mangle a just allocated object with a distinct pattern. debug_only(res->mangleAllocated(word_sz)); return (HeapWord*)res; diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp index 729556baecf..9ac7b03d40d 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 8ab7bdd1b58..83854fe202c 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -190,7 +190,8 @@ ConcurrentMarkSweepGeneration::ConcurrentMarkSweepGeneration( // depends on this property. debug_only( FreeChunk* junk = NULL; - assert(junk->prev_addr() == (void*)(oop(junk)->klass_addr()), + assert(UseCompressedOops || + junk->prev_addr() == (void*)(oop(junk)->klass_addr()), "Offset of FreeChunk::_prev within FreeChunk must match" " that of OopDesc::_klass within OopDesc"); ) @@ -1039,7 +1040,7 @@ void CMSCollector::direct_allocated(HeapWord* start, size_t size) { // mark end of object } // check that oop looks uninitialized - assert(oop(start)->klass() == NULL, "_klass should be NULL"); + assert(oop(start)->klass_or_null() == NULL, "_klass should be NULL"); } void CMSCollector::promoted(bool par, HeapWord* start, @@ -1309,17 +1310,25 @@ ConcurrentMarkSweepGeneration::par_promote(int thread_num, } } oop obj = oop(obj_ptr); - assert(obj->klass() == NULL, "Object should be uninitialized here."); + assert(obj->klass_or_null() == NULL, "Object should be uninitialized here."); // Otherwise, copy the object. Here we must be careful to insert the // klass pointer last, since this marks the block as an allocated object. + // Except with compressed oops it's the mark word. HeapWord* old_ptr = (HeapWord*)old; if (word_sz > (size_t)oopDesc::header_size()) { Copy::aligned_disjoint_words(old_ptr + oopDesc::header_size(), obj_ptr + oopDesc::header_size(), word_sz - oopDesc::header_size()); } + + if (UseCompressedOops) { + // Copy gap missed by (aligned) header size calculation above + obj->set_klass_gap(old->klass_gap()); + } + // Restore the mark word copied above. obj->set_mark(m); + // Now we can track the promoted object, if necessary. We take care // To delay the transition from uninitialized to full object // (i.e., insertion of klass pointer) until after, so that it @@ -1327,7 +1336,8 @@ ConcurrentMarkSweepGeneration::par_promote(int thread_num, if (promoInfo->tracking()) { promoInfo->track((PromotedObject*)obj, old->klass()); } - // Finally, install the klass pointer. + + // Finally, install the klass pointer (this should be volatile). obj->set_klass(old->klass()); assert(old->is_oop(), "Will dereference klass ptr below"); @@ -6165,7 +6175,7 @@ size_t CMSCollector::block_size_if_printezis_bits(HeapWord* addr) const { HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const { size_t sz = 0; oop p = (oop)addr; - if (p->klass() != NULL && p->is_parsable()) { + if (p->klass_or_null() != NULL && p->is_parsable()) { sz = CompactibleFreeListSpace::adjustObjectSize(p->size()); } else { sz = block_size_using_printezis_bits(addr); @@ -6602,7 +6612,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m( } if (_bitMap->isMarked(addr)) { // it's marked; is it potentially uninitialized? - if (p->klass() != NULL) { + if (p->klass_or_null() != NULL) { if (CMSPermGenPrecleaningEnabled && !p->is_parsable()) { // Signal precleaning to redirty the card since // the klass pointer is already installed. @@ -6615,11 +6625,8 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m( if (p->is_objArray()) { // objArrays are precisely marked; restrict scanning // to dirty cards only. - size = p->oop_iterate(_scanningClosure, mr); - assert(size == CompactibleFreeListSpace::adjustObjectSize(size), - "adjustObjectSize should be the identity for array sizes, " - "which are necessarily larger than minimum object size of " - "two heap words"); + size = CompactibleFreeListSpace::adjustObjectSize( + p->oop_iterate(_scanningClosure, mr)); } else { // A non-array may have been imprecisely marked; we need // to scan object in its entirety. @@ -6653,7 +6660,7 @@ size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m( } } else { // Either a not yet marked object or an uninitialized object - if (p->klass() == NULL || !p->is_parsable()) { + if (p->klass_or_null() == NULL || !p->is_parsable()) { // An uninitialized object, skip to the next card, since // we may not be able to read its P-bits yet. assert(size == 0, "Initial value"); @@ -6710,7 +6717,7 @@ size_t SurvivorSpacePrecleanClosure::do_object_careful(oop p) { HeapWord* addr = (HeapWord*)p; DEBUG_ONLY(_collector->verify_work_stacks_empty();) assert(!_span.contains(addr), "we are scanning the survivor spaces"); - assert(p->klass() != NULL, "object should be initializd"); + assert(p->klass_or_null() != NULL, "object should be initializd"); assert(p->is_parsable(), "must be parsable."); // an initialized object; ignore mark word in verification below // since we are running concurrent with mutators @@ -6868,7 +6875,7 @@ void MarkFromRootsClosure::do_bit(size_t offset) { assert(_skipBits == 0, "tautology"); _skipBits = 2; // skip next two marked bits ("Printezis-marks") oop p = oop(addr); - if (p->klass() == NULL || !p->is_parsable()) { + if (p->klass_or_null() == NULL || !p->is_parsable()) { DEBUG_ONLY(if (!_verifying) {) // We re-dirty the cards on which this object lies and increase // the _threshold so that we'll come back to scan this object @@ -6890,7 +6897,7 @@ void MarkFromRootsClosure::do_bit(size_t offset) { if (_threshold < end_card_addr) { _threshold = end_card_addr; } - if (p->klass() != NULL) { + if (p->klass_or_null() != NULL) { // Redirty the range of cards... _mut->mark_range(redirty_range); } // ...else the setting of klass will dirty the card anyway. @@ -7048,7 +7055,7 @@ void Par_MarkFromRootsClosure::do_bit(size_t offset) { assert(_skip_bits == 0, "tautology"); _skip_bits = 2; // skip next two marked bits ("Printezis-marks") oop p = oop(addr); - if (p->klass() == NULL || !p->is_parsable()) { + if (p->klass_or_null() == NULL || !p->is_parsable()) { // in the case of Clean-on-Enter optimization, redirty card // and avoid clearing card by increasing the threshold. return; @@ -8023,7 +8030,7 @@ size_t SweepClosure::doLiveChunk(FreeChunk* fc) { "alignment problem"); #ifdef DEBUG - if (oop(addr)->klass() != NULL && + if (oop(addr)->klass_or_null() != NULL && ( !_collector->should_unload_classes() || oop(addr)->is_parsable())) { // Ignore mark word because we are running concurrent with mutators @@ -8036,7 +8043,7 @@ size_t SweepClosure::doLiveChunk(FreeChunk* fc) { } else { // This should be an initialized object that's alive. - assert(oop(addr)->klass() != NULL && + assert(oop(addr)->klass_or_null() != NULL && (!_collector->should_unload_classes() || oop(addr)->is_parsable()), "Should be an initialized object"); diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp index 6d5546eeb95..dd8956cfd0b 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp index 8dd2ca4abe4..208bafd86b6 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp index 2b140d0e369..309bc7a19c6 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeBlockDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -22,88 +22,6 @@ * */ -// -// Free block maintenance for Concurrent Mark Sweep Generation -// -// The main data structure for free blocks are -// . an indexed array of small free blocks, and -// . a dictionary of large free blocks -// - -// No virtuals in FreeChunk (don't want any vtables). - -// A FreeChunk is merely a chunk that can be in a doubly linked list -// and has a size field. NOTE: FreeChunks are distinguished from allocated -// objects in two ways (by the sweeper). The second word (prev) has the -// LSB set to indicate a free chunk; allocated objects' klass() pointers -// don't have their LSB set. The corresponding bit in the CMSBitMap is -// set when the chunk is allocated. There are also blocks that "look free" -// but are not part of the free list and should not be coalesced into larger -// free blocks. These free blocks have their two LSB's set. - -class FreeChunk VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; - FreeChunk* _next; - FreeChunk* _prev; - size_t _size; - - public: - NOT_PRODUCT(static const size_t header_size();) - // Returns "true" if the "wrd", which is required to be the second word - // of a block, indicates that the block represents a free chunk. - static bool secondWordIndicatesFreeChunk(intptr_t wrd) { - return (wrd & 0x1) == 0x1; - } - bool isFree() const { - return secondWordIndicatesFreeChunk((intptr_t)_prev); - } - bool cantCoalesce() const { return (((intptr_t)_prev) & 0x3) == 0x3; } - FreeChunk* next() const { return _next; } - FreeChunk* prev() const { return (FreeChunk*)(((intptr_t)_prev) & ~(0x3)); } - debug_only(void* prev_addr() const { return (void*)&_prev; }) - - void linkAfter(FreeChunk* ptr) { - linkNext(ptr); - if (ptr != NULL) ptr->linkPrev(this); - } - void linkAfterNonNull(FreeChunk* ptr) { - assert(ptr != NULL, "precondition violation"); - linkNext(ptr); - ptr->linkPrev(this); - } - void linkNext(FreeChunk* ptr) { _next = ptr; } - void linkPrev(FreeChunk* ptr) { _prev = (FreeChunk*)((intptr_t)ptr | 0x1); } - void clearPrev() { _prev = NULL; } - void clearNext() { _next = NULL; } - void dontCoalesce() { - // the block should be free - assert(isFree(), "Should look like a free block"); - _prev = (FreeChunk*)(((intptr_t)_prev) | 0x2); - } - void markFree() { _prev = (FreeChunk*)((intptr_t)_prev | 0x1); } - void markNotFree() { _prev = NULL; } - - size_t size() const { return _size; } - void setSize(size_t size) { _size = size; } - - // For volatile reads: - size_t* size_addr() { return &_size; } - - // Return the address past the end of this chunk - HeapWord* end() const { return ((HeapWord*) this) + _size; } - - // debugging - void verify() const PRODUCT_RETURN; - void verifyList() const PRODUCT_RETURN; - void mangleAllocated(size_t size) PRODUCT_RETURN; - void mangleFreed(size_t size) PRODUCT_RETURN; -}; - -// Alignment helpers etc. -#define numQuanta(x,y) ((x+y-1)/y) -enum AlignmentConstants { - MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment -}; // A FreeBlockDictionary is an abstract superclass that will allow // a number of alternative implementations in the future. diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp index b5153971b4e..494c090c6fb 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -47,15 +47,15 @@ void FreeChunk::mangleAllocated(size_t size) { Copy::fill_to_words(addr + hdr, size - hdr, baadbabeHeapWord); } -void FreeChunk::mangleFreed(size_t size) { +void FreeChunk::mangleFreed(size_t sz) { assert(baadbabeHeapWord != deadbeefHeapWord, "Need distinct patterns"); // mangle all but the header of a just-freed block of storage // just prior to passing it to the storage dictionary - assert(size >= MinChunkSize, "smallest size of object"); - assert(size == _size, "just checking"); + assert(sz >= MinChunkSize, "smallest size of object"); + assert(sz == size(), "just checking"); HeapWord* addr = (HeapWord*)this; size_t hdr = header_size(); - Copy::fill_to_words(addr + hdr, size - hdr, deadbeefHeapWord); + Copy::fill_to_words(addr + hdr, sz - hdr, deadbeefHeapWord); } void FreeChunk::verifyList() const { diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp new file mode 100644 index 00000000000..10112108386 --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeChunk.hpp @@ -0,0 +1,137 @@ +/* + * Copyright 2001-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. + * + * 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. + * + */ + +// +// Free block maintenance for Concurrent Mark Sweep Generation +// +// The main data structure for free blocks are +// . an indexed array of small free blocks, and +// . a dictionary of large free blocks +// + +// No virtuals in FreeChunk (don't want any vtables). + +// A FreeChunk is merely a chunk that can be in a doubly linked list +// and has a size field. NOTE: FreeChunks are distinguished from allocated +// objects in two ways (by the sweeper), depending on whether the VM is 32 or +// 64 bits. +// In 32 bits or 64 bits without CompressedOops, the second word (prev) has the +// LSB set to indicate a free chunk; allocated objects' klass() pointers +// don't have their LSB set. The corresponding bit in the CMSBitMap is +// set when the chunk is allocated. There are also blocks that "look free" +// but are not part of the free list and should not be coalesced into larger +// free blocks. These free blocks have their two LSB's set. + +class FreeChunk VALUE_OBJ_CLASS_SPEC { + friend class VMStructs; + // For 64 bit compressed oops, the markOop encodes both the size and the + // indication that this is a FreeChunk and not an object. + volatile size_t _size; + FreeChunk* _prev; + FreeChunk* _next; + + markOop mark() const volatile { return (markOop)_size; } + void set_mark(markOop m) { _size = (size_t)m; } + + public: + NOT_PRODUCT(static const size_t header_size();) + + // Returns "true" if the address indicates that the block represents + // a free chunk. + static bool indicatesFreeChunk(const HeapWord* addr) { + // Force volatile read from addr because value might change between + // calls. We really want the read of _mark and _prev from this pointer + // to be volatile but making the fields volatile causes all sorts of + // compilation errors. + return ((volatile FreeChunk*)addr)->isFree(); + } + + bool isFree() const volatile { + LP64_ONLY(if (UseCompressedOops) return mark()->is_cms_free_chunk(); else) + return (((intptr_t)_prev) & 0x1) == 0x1; + } + bool cantCoalesce() const { + assert(isFree(), "can't get coalesce bit on not free"); + return (((intptr_t)_prev) & 0x2) == 0x2; + } + void dontCoalesce() { + // the block should be free + assert(isFree(), "Should look like a free block"); + _prev = (FreeChunk*)(((intptr_t)_prev) | 0x2); + } + FreeChunk* prev() const { + return (FreeChunk*)(((intptr_t)_prev) & ~(0x3)); + } + + debug_only(void* prev_addr() const { return (void*)&_prev; }) + + size_t size() const volatile { + LP64_ONLY(if (UseCompressedOops) return mark()->get_size(); else ) + return _size; + } + void setSize(size_t sz) { + LP64_ONLY(if (UseCompressedOops) set_mark(markOopDesc::set_size_and_free(sz)); else ) + _size = sz; + } + + FreeChunk* next() const { return _next; } + + void linkAfter(FreeChunk* ptr) { + linkNext(ptr); + if (ptr != NULL) ptr->linkPrev(this); + } + void linkAfterNonNull(FreeChunk* ptr) { + assert(ptr != NULL, "precondition violation"); + linkNext(ptr); + ptr->linkPrev(this); + } + void linkNext(FreeChunk* ptr) { _next = ptr; } + void linkPrev(FreeChunk* ptr) { + LP64_ONLY(if (UseCompressedOops) _prev = ptr; else) + _prev = (FreeChunk*)((intptr_t)ptr | 0x1); + } + void clearPrev() { _prev = NULL; } + void clearNext() { _next = NULL; } + void markNotFree() { + LP64_ONLY(if (UseCompressedOops) set_mark(markOopDesc::prototype());) + // Also set _prev to null + _prev = NULL; + } + + // Return the address past the end of this chunk + HeapWord* end() const { return ((HeapWord*) this) + size(); } + + // debugging + void verify() const PRODUCT_RETURN; + void verifyList() const PRODUCT_RETURN; + void mangleAllocated(size_t size) PRODUCT_RETURN; + void mangleFreed(size_t size) PRODUCT_RETURN; +}; + +// Alignment helpers etc. +#define numQuanta(x,y) ((x+y-1)/y) +enum AlignmentConstants { + MinChunkSize = numQuanta(sizeof(FreeChunk), MinObjAlignmentInBytes) * MinObjAlignment +}; + diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp index e7b1b3aae8d..79503deb81d 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp index b553dd3fe47..581317643c7 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/freeList.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -38,6 +38,7 @@ class Mutex; class FreeList VALUE_OBJ_CLASS_SPEC { friend class CompactibleFreeListSpace; + friend class VMStructs; friend class printTreeCensusClosure; FreeChunk* _head; // List of free chunks FreeChunk* _tail; // Tail of list of free chunks diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp index bce90cab897..4bebd43810e 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmStructs_cms.hpp @@ -23,6 +23,7 @@ */ #define VM_STRUCTS_CMS(nonstatic_field, \ + volatile_nonstatic_field, \ static_field) \ nonstatic_field(CompactibleFreeListSpace, _collector, CMSCollector*) \ nonstatic_field(CompactibleFreeListSpace, _bt, BlockOffsetArrayNonContigSpace) \ @@ -36,9 +37,17 @@ nonstatic_field(CMSCollector, _markBitMap, CMSBitMap) \ nonstatic_field(ConcurrentMarkSweepGeneration, _cmsSpace, CompactibleFreeListSpace*) \ static_field(ConcurrentMarkSweepThread, _collector, CMSCollector*) \ + volatile_nonstatic_field(FreeChunk, _size, size_t) \ nonstatic_field(FreeChunk, _next, FreeChunk*) \ nonstatic_field(FreeChunk, _prev, FreeChunk*) \ - nonstatic_field(FreeChunk, _size, size_t) + nonstatic_field(LinearAllocBlock, _word_size, size_t) \ + nonstatic_field(FreeList, _size, size_t) \ + nonstatic_field(FreeList, _count, ssize_t) \ + nonstatic_field(BinaryTreeDictionary, _totalSize, size_t) \ + nonstatic_field(CompactibleFreeListSpace, _dictionary, FreeBlockDictionary*) \ + nonstatic_field(CompactibleFreeListSpace, _indexedFreeList[0], FreeList) \ + nonstatic_field(CompactibleFreeListSpace, _smallLinearAllocBlock, LinearAllocBlock) + #define VM_TYPES_CMS(declare_type, \ declare_toplevel_type) \ @@ -57,7 +66,14 @@ declare_toplevel_type(SurrogateLockerThread*) \ declare_toplevel_type(CompactibleFreeListSpace*) \ declare_toplevel_type(CMSCollector*) \ - declare_toplevel_type(FreeChunk*) + declare_toplevel_type(FreeChunk*) \ + declare_toplevel_type(BinaryTreeDictionary*) \ + declare_toplevel_type(FreeBlockDictionary*) \ + declare_toplevel_type(FreeList*) \ + declare_toplevel_type(FreeList) \ + declare_toplevel_type(LinearAllocBlock) \ + declare_toplevel_type(FreeBlockDictionary) \ + declare_type(BinaryTreeDictionary, FreeBlockDictionary) #define VM_INT_CONSTANTS_CMS(declare_constant) \ declare_constant(Generation::ConcurrentMarkSweep) \ diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep index f715c15c0b0..580a83167fa 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep @@ -1,5 +1,5 @@ // -// Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2004-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 @@ -206,6 +206,7 @@ freeBlockDictionary.cpp thread_.inline.hpp freeBlockDictionary.hpp allocation.hpp freeBlockDictionary.hpp debug.hpp +freeBlockDictionary.hpp freeChunk.hpp freeBlockDictionary.hpp globalDefinitions.hpp freeBlockDictionary.hpp memRegion.hpp freeBlockDictionary.hpp mutex.hpp @@ -214,6 +215,14 @@ freeBlockDictionary.hpp ostream.hpp freeChunk.cpp copy.hpp freeChunk.cpp freeBlockDictionary.hpp +freeChunk.hpp allocation.hpp +freeChunk.hpp debug.hpp +freeChunk.hpp globalDefinitions.hpp +freeChunk.hpp markOop.hpp +freeChunk.hpp memRegion.hpp +freeChunk.hpp mutex.hpp +freeChunk.hpp ostream.hpp + freeList.cpp freeBlockDictionary.hpp freeList.cpp freeList.hpp freeList.cpp globals.hpp diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge b/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge index 8a2a7a6127b..98ce44ea95d 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge @@ -1,5 +1,5 @@ // -// Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared b/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared index ca8a47fa2fa..f1d70f8bbba 100644 --- a/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared +++ b/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared @@ -1,5 +1,5 @@ // -// Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2001-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 @@ -54,6 +54,7 @@ isGCActiveMark.hpp parallelScavengeHeap.hpp markSweep.inline.hpp psParallelCompact.hpp mutableNUMASpace.cpp mutableNUMASpace.hpp +mutableNUMASpace.cpp oop.inline.hpp mutableNUMASpace.cpp sharedHeap.hpp mutableNUMASpace.cpp thread_.inline.hpp diff --git a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp index fa4a554b976..203bd7ddc70 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp index 4a3bf249229..94377a3beb4 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp index d8caac661e2..89331a81bd3 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parGCAllocBuffer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp index 36b8bb2476b..ed990a463a1 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -1169,18 +1169,18 @@ ParNewGeneration::take_from_overflow_list(ParScanThreadState* par_scan_state) { // Trim off a prefix of at most objsFromOverflow items int i = 1; oop cur = prefix; - while (i < objsFromOverflow && cur->klass() != NULL) { + while (i < objsFromOverflow && cur->klass_or_null() != NULL) { i++; cur = oop(cur->klass()); } // Reattach remaining (suffix) to overflow list - if (cur->klass() != NULL) { + if (cur->klass_or_null() != NULL) { oop suffix = oop(cur->klass()); cur->set_klass_to_list_ptr(NULL); // Find last item of suffix list oop last = suffix; - while (last->klass() != NULL) { + while (last->klass_or_null() != NULL) { last = oop(last->klass()); } // Atomically prepend suffix to current overflow list diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp index 19564e7b670..a9e2d199f6c 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp index 7ef34bb89bd..c8555fdfcaa 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp index 2b2c6f87c51..c0a4d5857bc 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp index 8722e0f3b28..df1e6e2aeae 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp index 4f284a5d572..b3322db384f 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/generationSizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp index 7281b10f7db..204bf39171b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -61,6 +61,8 @@ ParMarkBitMap::initialize(MemRegion covered_region) if (_virtual_space != NULL) { delete _virtual_space; _virtual_space = NULL; + // Release memory reserved in the space. + rs.release(); } return false; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index 6fd50b39fc5..6814abf6b44 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -108,8 +108,8 @@ jint ParallelScavengeHeap::initialize() { // size than is needed or wanted for the perm gen. Use the "compound // alignment" ReservedSpace ctor to avoid having to use the same page size for // all gens. - ReservedSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size, - og_align); + ReservedHeapSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size, + og_align); os::trace_page_sizes("ps perm", pg_min_size, pg_max_size, pg_page_sz, heap_rs.base(), pg_max_size); os::trace_page_sizes("ps main", og_min_size + yg_min_size, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp index d26eec48882..75c6830cdc1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp index 994e627ed9d..2237542f523 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/prefetchQueue.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/prefetchQueue.hpp index 53775a79de6..5266d67319b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/prefetchQueue.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/prefetchQueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp index cec3a48db1a..8c8bff54dff 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp index 98b347cf6e1..7bfbdb53978 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -422,6 +422,8 @@ ParallelCompactData::create_vspace(size_t count, size_t element_size) return vspace; } delete vspace; + // Release memory reserved in the space. + rs.release(); } return 0; @@ -1004,6 +1006,9 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) DEBUG_ONLY(mark_bitmap()->verify_clear();) DEBUG_ONLY(summary_data().verify_clear();) + + // Have worker threads release resources the next time they run a task. + gc_task_manager()->release_all_resources(); } void PSParallelCompact::post_compact() @@ -1949,12 +1954,6 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { TimeStamp compaction_start; TimeStamp collection_exit; - // "serial_CM" is needed until the parallel implementation - // of the move and update is done. - ParCompactionManager* serial_CM = new ParCompactionManager(); - // Don't initialize more than once. - // serial_CM->initialize(&summary_data(), mark_bitmap()); - ParallelScavengeHeap* heap = gc_heap(); GCCause::Cause gc_cause = heap->gc_cause(); PSYoungGen* young_gen = heap->young_gen(); @@ -1969,6 +1968,10 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { PreGCValues pre_gc_values; pre_compact(&pre_gc_values); + // Get the compaction manager reserved for the VM thread. + ParCompactionManager* const vmthread_cm = + ParCompactionManager::manager_array(gc_task_manager()->workers()); + // Place after pre_compact() where the number of invocations is incremented. AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); @@ -2008,7 +2011,7 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { bool marked_for_unloading = false; marking_start.update(); - marking_phase(serial_CM, maximum_heap_compaction); + marking_phase(vmthread_cm, maximum_heap_compaction); #ifndef PRODUCT if (TraceParallelOldGCMarkingPhase) { @@ -2039,7 +2042,7 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { #endif bool max_on_system_gc = UseMaximumCompactionOnSystemGC && is_system_gc; - summary_phase(serial_CM, maximum_heap_compaction || max_on_system_gc); + summary_phase(vmthread_cm, maximum_heap_compaction || max_on_system_gc); #ifdef ASSERT if (VerifyParallelOldWithMarkSweep && @@ -2067,13 +2070,13 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { // code can use the the forwarding pointers to // check the new pointer calculation. The restore_marks() // has to be done before the real compact. - serial_CM->set_action(ParCompactionManager::VerifyUpdate); - compact_perm(serial_CM); - compact_serial(serial_CM); - serial_CM->set_action(ParCompactionManager::ResetObjects); - compact_perm(serial_CM); - compact_serial(serial_CM); - serial_CM->set_action(ParCompactionManager::UpdateAndCopy); + vmthread_cm->set_action(ParCompactionManager::VerifyUpdate); + compact_perm(vmthread_cm); + compact_serial(vmthread_cm); + vmthread_cm->set_action(ParCompactionManager::ResetObjects); + compact_perm(vmthread_cm); + compact_serial(vmthread_cm); + vmthread_cm->set_action(ParCompactionManager::UpdateAndCopy); // For debugging only PSMarkSweep::restore_marks(); @@ -2084,16 +2087,14 @@ void PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { compaction_start.update(); // Does the perm gen always have to be done serially because // klasses are used in the update of an object? - compact_perm(serial_CM); + compact_perm(vmthread_cm); if (UseParallelOldGCCompacting) { compact(); } else { - compact_serial(serial_CM); + compact_serial(vmthread_cm); } - delete serial_CM; - // Reset the mark bitmap, summary data, and do other bookkeeping. Must be // done before resizing. post_compact(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp index 9566821169b..e680a000919 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp index 8a1893f2132..fc35aa33f60 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp index ee8c2d78338..f5af16546e7 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp index 92a5002d80e..dd74617ebb3 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp index b18674ea819..674a951bfcc 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp index 73cc15f32ae..f1a9e64fe93 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp index 5f960dc9ece..cd5652de3f1 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp index 1f8ad940713..1ca050823a4 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp index 08b576c775e..40b14d4b88d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp index dd5d1045fc1..52913e07518 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp index 912f5414cc9..001f579e5d2 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psVirtualspace.cpp @@ -71,13 +71,8 @@ bool PSVirtualSpace::contains(void* p) const { void PSVirtualSpace::release() { DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this)); - if (reserved_low_addr() != NULL) { - if (special()) { - os::release_memory_special(reserved_low_addr(), reserved_size()); - } else { - (void)os::release_memory(reserved_low_addr(), reserved_size()); - } - } + // This may not release memory it didn't reserve. + // Use rs.release() to release the underlying memory instead. _reserved_low_addr = _reserved_high_addr = NULL; _committed_low_addr = _committed_high_addr = NULL; _special = false; diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp index b7088556bdc..26452649c6b 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp index 2145394123b..fc8518f1ac3 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp index a60fc2bc164..4772f7c45bc 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp index 2485fee4a05..35af5fcf60f 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -66,7 +66,7 @@ void ImmutableSpace::print() const { #endif -void ImmutableSpace::verify(bool allow_dirty) const { +void ImmutableSpace::verify(bool allow_dirty) { HeapWord* p = bottom(); HeapWord* t = end(); HeapWord* prev_p = NULL; diff --git a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp index 4d62bd8e7ae..3f28ec710e4 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/immutableSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -59,5 +59,5 @@ class ImmutableSpace: public CHeapObj { // Debugging virtual void print() const PRODUCT_RETURN; virtual void print_short() const PRODUCT_RETURN; - virtual void verify(bool allow_dirty) const; + virtual void verify(bool allow_dirty); }; diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp index ee77a7f52df..c18d6e877bd 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp index d0ede4efba7..b2e8d22d153 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp index c4045ee988e..fdcf48db842 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp index 959c4e1b6bf..48bfea8b6ff 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @@ -1,6 +1,6 @@ /* - * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 @@ -599,12 +599,28 @@ void MutableNUMASpace::initialize(MemRegion mr, bool clear_space) { // Mark the the holes in chunks below the top() as invalid. void MutableNUMASpace::set_top(HeapWord* value) { bool found_top = false; - for (int i = 0; i < lgrp_spaces()->length(); i++) { + for (int i = 0; i < lgrp_spaces()->length();) { LGRPSpace *ls = lgrp_spaces()->at(i); MutableSpace *s = ls->space(); HeapWord *top = MAX2((HeapWord*)round_down((intptr_t)s->top(), page_size()), s->bottom()); if (s->contains(value)) { + // Check if setting the chunk's top to a given value would create a hole less than + // a minimal object; assuming that's not the last chunk in which case we don't care. + if (i < lgrp_spaces()->length() - 1) { + size_t remainder = pointer_delta(s->end(), value); + const size_t minimal_object_size = oopDesc::header_size(); + if (remainder < minimal_object_size && remainder > 0) { + // Add a filler object of a minimal size, it will cross the chunk boundary. + SharedHeap::fill_region_with_object(MemRegion(value, minimal_object_size)); + value += minimal_object_size; + assert(!s->contains(value), "Should be in the next chunk"); + // Restart the loop from the same chunk, since the value has moved + // to the next one. + continue; + } + } + if (!os::numa_has_static_binding() && top < value && top < s->end()) { ls->add_invalid_region(MemRegion(top, value)); } @@ -620,6 +636,7 @@ void MutableNUMASpace::set_top(HeapWord* value) { s->set_top(s->end()); } } + i++; } MutableSpace::set_top(value); } @@ -700,12 +717,14 @@ HeapWord* MutableNUMASpace::cas_allocate(size_t size) { MutableSpace *s = lgrp_spaces()->at(i)->space(); HeapWord *p = s->cas_allocate(size); if (p != NULL) { - size_t remainder = pointer_delta(s->end(), p); + size_t remainder = pointer_delta(s->end(), p + size); if (remainder < (size_t)oopDesc::header_size() && remainder > 0) { if (s->cas_deallocate(p, size)) { // We were the last to allocate and created a fragment less than // a minimal object. p = NULL; + } else { + guarantee(false, "Deallocation should always succeed"); } } } @@ -761,10 +780,12 @@ void MutableNUMASpace::print_on(outputStream* st) const { } } -void MutableNUMASpace::verify(bool allow_dirty) const { - for (int i = 0; i < lgrp_spaces()->length(); i++) { - lgrp_spaces()->at(i)->space()->verify(allow_dirty); - } +void MutableNUMASpace::verify(bool allow_dirty) { + // This can be called after setting an arbitary value to the space's top, + // so an object can cross the chunk boundary. We ensure the parsablity + // of the space and just walk the objects in linear fashion. + ensure_parsability(); + MutableSpace::verify(allow_dirty); } // Scan pages and gather stats about page placement and size. diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp index a0fd5791ad7..2cde6413eda 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 @@ -192,7 +192,7 @@ class MutableNUMASpace : public MutableSpace { // Debugging virtual void print_on(outputStream* st) const; virtual void print_short_on(outputStream* st) const; - virtual void verify(bool allow_dirty) const; + virtual void verify(bool allow_dirty); virtual void set_top(HeapWord* value); }; diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp index 5c3a9e01029..26621da944e 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -118,7 +118,7 @@ void MutableSpace::print_on(outputStream* st) const { bottom(), top(), end()); } -void MutableSpace::verify(bool allow_dirty) const { +void MutableSpace::verify(bool allow_dirty) { HeapWord* p = bottom(); HeapWord* t = top(); HeapWord* prev_p = NULL; diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp index f9d43ba262f..91586c5068f 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -98,5 +98,5 @@ class MutableSpace: public ImmutableSpace { virtual void print_on(outputStream* st) const; virtual void print_short() const; virtual void print_short_on(outputStream* st) const; - virtual void verify(bool allow_dirty) const; + virtual void verify(bool allow_dirty); }; diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index 7cab57dd727..eee135f67df 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 7777dc71c84..fcce0cc3b51 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index ecfab9ed6cd..8ddf46a48e2 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index ef55f14676e..492801e983e 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp index 556cd490f96..c2f3caeb507 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -90,11 +90,12 @@ void CollectedHeap::post_allocation_setup_array(KlassHandle klass, HeapWord* obj, size_t size, int length) { + // Set array length before setting the _klass field + // in post_allocation_setup_common() because the klass field + // indicates that the object is parsable by concurrent GC. assert(length >= 0, "length should be non-negative"); - post_allocation_setup_common(klass, obj, size); - // Must set length after installing klass as set_klass zeros the length - // field in UseCompressedOops ((arrayOop)obj)->set_length(length); + post_allocation_setup_common(klass, obj, size); assert(((oop)obj)->blueprint()->oop_is_array(), "must be an array"); // notify jvmti and dtrace (must be after length is set for dtrace) post_allocation_notify(klass, (oop)obj); @@ -224,6 +225,7 @@ void CollectedHeap::init_obj(HeapWord* obj, size_t size) { assert(obj != NULL, "cannot initialize NULL object"); const size_t hs = oopDesc::header_size(); assert(size >= hs, "unexpected object size"); + ((oop)obj)->set_klass_gap(0); Copy::fill_to_aligned_words(obj + hs, size - hs); } diff --git a/hotspot/src/share/vm/includeDB_compiler1 b/hotspot/src/share/vm/includeDB_compiler1 index ae500d2f6d7..3509507f10b 100644 --- a/hotspot/src/share/vm/includeDB_compiler1 +++ b/hotspot/src/share/vm/includeDB_compiler1 @@ -1,5 +1,5 @@ // -// Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 1999-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 diff --git a/hotspot/src/share/vm/includeDB_compiler2 b/hotspot/src/share/vm/includeDB_compiler2 index 43233ad41dd..1d2cb6d8b15 100644 --- a/hotspot/src/share/vm/includeDB_compiler2 +++ b/hotspot/src/share/vm/includeDB_compiler2 @@ -1,5 +1,5 @@ // -// Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +// Copyright 2000-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 @@ -1084,6 +1084,7 @@ idealGraphPrinter.hpp dict.hpp idealGraphPrinter.hpp vectset.hpp idealGraphPrinter.hpp growableArray.hpp idealGraphPrinter.hpp ostream.hpp +idealGraphPrinter.hpp xmlstream.hpp idealGraphPrinter.cpp idealGraphPrinter.hpp idealGraphPrinter.cpp chaitin.hpp diff --git a/hotspot/src/share/vm/includeDB_core b/hotspot/src/share/vm/includeDB_core index 616a974bb20..0c53185fd0e 100644 --- a/hotspot/src/share/vm/includeDB_core +++ b/hotspot/src/share/vm/includeDB_core @@ -1,5 +1,5 @@ // -// Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +// 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 @@ -3492,6 +3492,7 @@ relocInfo.hpp top.hpp relocInfo_.cpp assembler.inline.hpp relocInfo_.cpp assembler_.inline.hpp relocInfo_.cpp nativeInst_.hpp +relocInfo_.cpp oop.inline.hpp relocInfo_.cpp relocInfo.hpp relocInfo_.cpp safepoint.hpp diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 547b440e177..b4204414a94 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 @@ -1931,6 +1931,7 @@ run: } else { result->set_mark(markOopDesc::prototype()); } + result->set_klass_gap(0); result->set_klass(k_entry); SET_STACK_OBJECT(result, 0); UPDATE_PC_AND_TOS_AND_CONTINUE(3, 1); diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml index 56d97c6ee29..a5696213db9 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xml @@ -1,7 +1,25 @@ diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl index 28cd8712d28..ddac81c6d41 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterWithChecks.xsl @@ -1,10 +1,29 @@ + @@ -15,7 +34,6 @@ - diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 82f73d8ac96..3f096580e55 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/interpreter/oopMapCache.cpp b/hotspot/src/share/vm/interpreter/oopMapCache.cpp index 32d731ddd1c..3b45b5956ec 100644 --- a/hotspot/src/share/vm/interpreter/oopMapCache.cpp +++ b/hotspot/src/share/vm/interpreter/oopMapCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp index aa56fa9e883..5d04d673c17 100644 --- a/hotspot/src/share/vm/memory/barrierSet.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/barrierSet.inline.hpp b/hotspot/src/share/vm/memory/barrierSet.inline.hpp index ab89a4d4668..c6ddc55a5bb 100644 --- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index fab92e0f698..5f32640497e 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -196,6 +196,8 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { assert(_whole_heap.contains(new_region), "attempt to cover area not in reserved area"); debug_only(verify_guard();) + // collided is true if the expansion would push into another committed region + debug_only(bool collided = false;) int const ind = find_covering_region_by_base(new_region.start()); MemRegion const old_region = _covered[ind]; assert(old_region.start() == new_region.start(), "just checking"); @@ -211,12 +213,36 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { } // Align the end up to a page size (starts are already aligned). jbyte* const new_end = byte_after(new_region.last()); - HeapWord* const new_end_aligned = + HeapWord* new_end_aligned = (HeapWord*) align_size_up((uintptr_t)new_end, _page_size); assert(new_end_aligned >= (HeapWord*) new_end, "align up, but less"); + int ri = 0; + for (ri = 0; ri < _cur_covered_regions; ri++) { + if (ri != ind) { + if (_committed[ri].contains(new_end_aligned)) { + assert((new_end_aligned >= _committed[ri].start()) && + (_committed[ri].start() > _committed[ind].start()), + "New end of committed region is inconsistent"); + new_end_aligned = _committed[ri].start(); + assert(new_end_aligned > _committed[ind].start(), + "New end of committed region is before start"); + debug_only(collided = true;) + // Should only collide with 1 region + break; + } + } + } +#ifdef ASSERT + for (++ri; ri < _cur_covered_regions; ri++) { + assert(!_committed[ri].contains(new_end_aligned), + "New end of committed region is in a second committed region"); + } +#endif // The guard page is always committed and should not be committed over. - HeapWord* const new_end_for_commit = MIN2(new_end_aligned, _guard_region.start()); + HeapWord* const new_end_for_commit = MIN2(new_end_aligned, + _guard_region.start()); + if (new_end_for_commit > cur_committed.end()) { // Must commit new pages. MemRegion const new_committed = @@ -239,9 +265,11 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { if (!uncommit_region.is_empty()) { if (!os::uncommit_memory((char*)uncommit_region.start(), uncommit_region.byte_size())) { - // Do better than this for Merlin - vm_exit_out_of_memory(uncommit_region.byte_size(), - "card table contraction"); + assert(false, "Card table contraction failed"); + // The call failed so don't change the end of the + // committed region. This is better than taking the + // VM down. + new_end_aligned = _committed[ind].end(); } } } @@ -257,8 +285,25 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { } assert(index_for(new_region.last()) < (int) _guard_index, "The guard card will be overwritten"); - jbyte* const end = byte_after(new_region.last()); + // This line commented out cleans the newly expanded region and + // not the aligned up expanded region. + // jbyte* const end = byte_after(new_region.last()); + jbyte* const end = (jbyte*) new_end_for_commit; + assert((end >= byte_after(new_region.last())) || collided, + "Expect to be beyond new region unless impacting another region"); // do nothing if we resized downward. +#ifdef ASSERT + for (int ri = 0; ri < _cur_covered_regions; ri++) { + if (ri != ind) { + // The end of the new committed region should not + // be in any existing region unless it matches + // the start of the next region. + assert(!_committed[ri].contains(end) || + (_committed[ri].start() == (HeapWord*) end), + "Overlapping committed regions"); + } + } +#endif if (entry < end) { memset(entry, clean_card, pointer_delta(end, entry, sizeof(jbyte))); } diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp index dcc457111df..fa1db5f74b7 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp index e84cc57f085..287cbd85751 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.cpp +++ b/hotspot/src/share/vm/memory/cardTableRS.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp index c2180de67d3..dab96d3991b 100644 --- a/hotspot/src/share/vm/memory/cardTableRS.hpp +++ b/hotspot/src/share/vm/memory/cardTableRS.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index b26158e247b..2d86d6466d3 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/collectorPolicy.hpp b/hotspot/src/share/vm/memory/collectorPolicy.hpp index da98dfd0106..a1cea1544bc 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.hpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/compactingPermGenGen.cpp b/hotspot/src/share/vm/memory/compactingPermGenGen.cpp index 78ada701405..2ba5222cde1 100644 --- a/hotspot/src/share/vm/memory/compactingPermGenGen.cpp +++ b/hotspot/src/share/vm/memory/compactingPermGenGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/memory/defNewGeneration.cpp b/hotspot/src/share/vm/memory/defNewGeneration.cpp index d13c9e9adff..a18734ec673 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.cpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/defNewGeneration.hpp b/hotspot/src/share/vm/memory/defNewGeneration.hpp index 893afc055c7..9f7d6329137 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.hpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp index 23a96984564..677e2862a92 100644 --- a/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp +++ b/hotspot/src/share/vm/memory/defNewGeneration.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/dump.cpp b/hotspot/src/share/vm/memory/dump.cpp index 9499336282b..0b088528270 100644 --- a/hotspot/src/share/vm/memory/dump.cpp +++ b/hotspot/src/share/vm/memory/dump.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/memory/gcLocker.cpp b/hotspot/src/share/vm/memory/gcLocker.cpp index 4e770e01b36..445884e4ea1 100644 --- a/hotspot/src/share/vm/memory/gcLocker.cpp +++ b/hotspot/src/share/vm/memory/gcLocker.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/gcLocker.hpp b/hotspot/src/share/vm/memory/gcLocker.hpp index b14b75797f1..109f4619772 100644 --- a/hotspot/src/share/vm/memory/gcLocker.hpp +++ b/hotspot/src/share/vm/memory/gcLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index dc3ba9b3cf3..e77e86a0096 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -222,8 +222,8 @@ char* GenCollectedHeap::allocate(size_t alignment, *_total_reserved = total_reserved; *_n_covered_regions = n_covered_regions; - *heap_rs = ReservedSpace(total_reserved, alignment, - UseLargePages, heap_address); + *heap_rs = ReservedHeapSpace(total_reserved, alignment, + UseLargePages, heap_address); return heap_address; } diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.hpp b/hotspot/src/share/vm/memory/genCollectedHeap.hpp index 54dce33bb80..c85a2a307a1 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/genMarkSweep.cpp b/hotspot/src/share/vm/memory/genMarkSweep.cpp index e98f6793001..6885a73c773 100644 --- a/hotspot/src/share/vm/memory/genMarkSweep.cpp +++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/genOopClosures.hpp b/hotspot/src/share/vm/memory/genOopClosures.hpp index d0f142f65a3..85121ee0b63 100644 --- a/hotspot/src/share/vm/memory/genOopClosures.hpp +++ b/hotspot/src/share/vm/memory/genOopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp index a6699d74b18..6746c8804f0 100644 --- a/hotspot/src/share/vm/memory/genOopClosures.inline.hpp +++ b/hotspot/src/share/vm/memory/genOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/genRemSet.hpp b/hotspot/src/share/vm/memory/genRemSet.hpp index c2ef23061af..bf06e3647dc 100644 --- a/hotspot/src/share/vm/memory/genRemSet.hpp +++ b/hotspot/src/share/vm/memory/genRemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/genRemSet.inline.hpp b/hotspot/src/share/vm/memory/genRemSet.inline.hpp index 3ae0e7f6820..381ee950e16 100644 --- a/hotspot/src/share/vm/memory/genRemSet.inline.hpp +++ b/hotspot/src/share/vm/memory/genRemSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/generation.cpp b/hotspot/src/share/vm/memory/generation.cpp index 5ed3ec09b7b..04cce2e59fe 100644 --- a/hotspot/src/share/vm/memory/generation.cpp +++ b/hotspot/src/share/vm/memory/generation.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/generation.hpp b/hotspot/src/share/vm/memory/generation.hpp index 2e146d53844..4a4cecd3f41 100644 --- a/hotspot/src/share/vm/memory/generation.hpp +++ b/hotspot/src/share/vm/memory/generation.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp index c1d43d7ea36..b0986d1e3ff 100644 --- a/hotspot/src/share/vm/memory/heap.cpp +++ b/hotspot/src/share/vm/memory/heap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp index 9fc47755608..28e68260831 100644 --- a/hotspot/src/share/vm/memory/heapInspection.cpp +++ b/hotspot/src/share/vm/memory/heapInspection.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp index f235d510b06..ac2c708a532 100644 --- a/hotspot/src/share/vm/memory/heapInspection.hpp +++ b/hotspot/src/share/vm/memory/heapInspection.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/memory/iterator.hpp b/hotspot/src/share/vm/memory/iterator.hpp index 1b92ddd4bc5..47b9b28d2b7 100644 --- a/hotspot/src/share/vm/memory/iterator.hpp +++ b/hotspot/src/share/vm/memory/iterator.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp index c85a18e7ac5..62255e11680 100644 --- a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp +++ b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/permGen.cpp b/hotspot/src/share/vm/memory/permGen.cpp index 1c8fa9681ec..e31c19c80ed 100644 --- a/hotspot/src/share/vm/memory/permGen.cpp +++ b/hotspot/src/share/vm/memory/permGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/permGen.hpp b/hotspot/src/share/vm/memory/permGen.hpp index 263a589b272..454b10f7986 100644 --- a/hotspot/src/share/vm/memory/permGen.hpp +++ b/hotspot/src/share/vm/memory/permGen.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index c9ba9b81c43..11edba7f7f4 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/referenceProcessor.hpp b/hotspot/src/share/vm/memory/referenceProcessor.hpp index e11f9564509..7ef57bdee00 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.hpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/restore.cpp b/hotspot/src/share/vm/memory/restore.cpp index 0a84749bcfa..cd32a1adbca 100644 --- a/hotspot/src/share/vm/memory/restore.cpp +++ b/hotspot/src/share/vm/memory/restore.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/memory/serialize.cpp b/hotspot/src/share/vm/memory/serialize.cpp index 6f9ba38b1d6..d09055c2507 100644 --- a/hotspot/src/share/vm/memory/serialize.cpp +++ b/hotspot/src/share/vm/memory/serialize.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/memory/sharedHeap.cpp b/hotspot/src/share/vm/memory/sharedHeap.cpp index 015f9807a06..14bd6d47ba3 100644 --- a/hotspot/src/share/vm/memory/sharedHeap.cpp +++ b/hotspot/src/share/vm/memory/sharedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp index eeab52e60a0..894bd57279f 100644 --- a/hotspot/src/share/vm/memory/space.cpp +++ b/hotspot/src/share/vm/memory/space.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -815,6 +815,7 @@ void ContiguousSpace::allocate_temporary_filler(int factor) { "size for smallest fake object doesn't match"); instanceOop obj = (instanceOop) allocate(size); obj->set_mark(markOopDesc::prototype()); + obj->set_klass_gap(0); obj->set_klass(SystemDictionary::object_klass()); } } diff --git a/hotspot/src/share/vm/memory/space.hpp b/hotspot/src/share/vm/memory/space.hpp index 37f726e5b3f..b8af6e695c7 100644 --- a/hotspot/src/share/vm/memory/space.hpp +++ b/hotspot/src/share/vm/memory/space.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/tenuredGeneration.cpp b/hotspot/src/share/vm/memory/tenuredGeneration.cpp index 8e04fd38814..dcd6626e80d 100644 --- a/hotspot/src/share/vm/memory/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/memory/tenuredGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index d69016370ad..bfa85393d49 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index 7cf8da13b72..118800f780b 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/arrayOop.hpp b/hotspot/src/share/vm/oops/arrayOop.hpp index 5e54a86ee93..8ede056496a 100644 --- a/hotspot/src/share/vm/oops/arrayOop.hpp +++ b/hotspot/src/share/vm/oops/arrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -41,11 +41,10 @@ class arrayOopDesc : public oopDesc { // Header size computation. // The header is considered the oop part of this type plus the length. // Returns the aligned header_size_in_bytes. This is not equivalent to - // sizeof(arrayOopDesc) which should not appear in the code, except here. + // sizeof(arrayOopDesc) which should not appear in the code. static int header_size_in_bytes() { - size_t hs = UseCompressedOops ? - sizeof(arrayOopDesc) : - align_size_up(sizeof(arrayOopDesc) + sizeof(int), HeapWordSize); + size_t hs = align_size_up(length_offset_in_bytes() + sizeof(int), + HeapWordSize); #ifdef ASSERT // make sure it isn't called before UseCompressedOops is initialized. static size_t arrayoopdesc_hs = 0; diff --git a/hotspot/src/share/vm/oops/constantPoolKlass.cpp b/hotspot/src/share/vm/oops/constantPoolKlass.cpp index 229007f6208..c112597ab11 100644 --- a/hotspot/src/share/vm/oops/constantPoolKlass.cpp +++ b/hotspot/src/share/vm/oops/constantPoolKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/constantPoolKlass.hpp b/hotspot/src/share/vm/oops/constantPoolKlass.hpp index b563f7ddd4a..324efbec023 100644 --- a/hotspot/src/share/vm/oops/constantPoolKlass.hpp +++ b/hotspot/src/share/vm/oops/constantPoolKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/constantPoolOop.hpp b/hotspot/src/share/vm/oops/constantPoolOop.hpp index b10db6bb068..907d71dfd64 100644 --- a/hotspot/src/share/vm/oops/constantPoolOop.hpp +++ b/hotspot/src/share/vm/oops/constantPoolOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/cpCacheKlass.cpp b/hotspot/src/share/vm/oops/cpCacheKlass.cpp index b57ccda8cd0..241914dca65 100644 --- a/hotspot/src/share/vm/oops/cpCacheKlass.cpp +++ b/hotspot/src/share/vm/oops/cpCacheKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/oops/cpCacheKlass.hpp b/hotspot/src/share/vm/oops/cpCacheKlass.hpp index 9c20eb9a94e..ea826671dbc 100644 --- a/hotspot/src/share/vm/oops/cpCacheKlass.hpp +++ b/hotspot/src/share/vm/oops/cpCacheKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/oops/cpCacheOop.cpp b/hotspot/src/share/vm/oops/cpCacheOop.cpp index a8f5c051ba6..1356775a716 100644 --- a/hotspot/src/share/vm/oops/cpCacheOop.cpp +++ b/hotspot/src/share/vm/oops/cpCacheOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/oops/cpCacheOop.hpp b/hotspot/src/share/vm/oops/cpCacheOop.hpp index fc810361880..ccdb4472e2c 100644 --- a/hotspot/src/share/vm/oops/cpCacheOop.hpp +++ b/hotspot/src/share/vm/oops/cpCacheOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 2ce60748519..8862efd299b 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index b7b71d930ff..2dd61e56802 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -180,9 +180,8 @@ class instanceKlass: public Klass { // End of the oop block. // - // number of words used by non-static fields in this klass (including - // inherited fields but after header_size()). If fields are compressed into - // header, this can be zero so it's not the same as number of static fields. + // Number of heapOopSize words used by non-static fields in this klass + // (including inherited fields but after header_size()). int _nonstatic_field_size; int _static_field_size; // number words used by static fields (oop and non-oop) in this klass int _static_oop_field_size;// number of static oop fields in this klass diff --git a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp index f0a150408db..66e884f395a 100644 --- a/hotspot/src/share/vm/oops/instanceKlassKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlassKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -581,7 +581,7 @@ void instanceKlassKlass::oop_print_on(oop obj, outputStream* st) { OopMapBlock* map = ik->start_of_nonstatic_oop_maps(); OopMapBlock* end_map = map + ik->nonstatic_oop_map_size(); while (map < end_map) { - st->print("%d-%d ", map->offset(), map->offset() + oopSize*(map->length() - 1)); + st->print("%d-%d ", map->offset(), map->offset() + heapOopSize*(map->length() - 1)); map++; } st->cr(); diff --git a/hotspot/src/share/vm/oops/instanceOop.hpp b/hotspot/src/share/vm/oops/instanceOop.hpp index e0f0cca1ffa..0375d195ddd 100644 --- a/hotspot/src/share/vm/oops/instanceOop.hpp +++ b/hotspot/src/share/vm/oops/instanceOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -39,14 +39,7 @@ class instanceOopDesc : public oopDesc { static bool contains_field_offset(int offset, int nonstatic_field_size) { int base_in_bytes = base_offset_in_bytes(); - if (UseCompressedOops) { - return (offset >= base_in_bytes && - // field can be embedded in header, or is after header. - (offset < (int)sizeof(instanceOopDesc) || - (offset-(int)sizeof(instanceOopDesc))/wordSize < nonstatic_field_size)); - } else { - return (offset >= base_in_bytes && - (offset-base_in_bytes)/wordSize < nonstatic_field_size); - } + return (offset >= base_in_bytes && + (offset-base_in_bytes) < nonstatic_field_size * heapOopSize); } }; diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.cpp b/hotspot/src/share/vm/oops/instanceRefKlass.cpp index 634a8c7fb9e..686aabf6a15 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 04d350197bf..8d1fba0f4e7 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index d8aac3de60d..b2a3260a216 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index 447d6e92958..27b32d09760 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/markOop.cpp b/hotspot/src/share/vm/oops/markOop.cpp index 75a2d506b46..ac1a99c2cd7 100644 --- a/hotspot/src/share/vm/oops/markOop.cpp +++ b/hotspot/src/share/vm/oops/markOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/markOop.hpp b/hotspot/src/share/vm/oops/markOop.hpp index ac42fef74f2..bc5d965c60c 100644 --- a/hotspot/src/share/vm/oops/markOop.hpp +++ b/hotspot/src/share/vm/oops/markOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -29,8 +29,10 @@ // // Bit-format of an object header (most significant first): // -// -// unused:0/25 hash:25/31 age:4 biased_lock:1 lock:2 = 32/64 bits +// 32 bits: unused:0 hash:25 age:4 biased_lock:1 lock:2 +// 64 bits: unused:24 hash:31 cms:2 age:4 biased_lock:1 lock:2 +// unused:20 size:35 cms:2 age:4 biased_lock:1 lock:2 (if cms +// free chunk) // // - hash contains the identity hash value: largest value is // 31 bits, see os::random(). Also, 64-bit vm's require @@ -91,6 +93,7 @@ class markOopDesc: public oopDesc { biased_lock_bits = 1, max_hash_bits = BitsPerWord - age_bits - lock_bits - biased_lock_bits, hash_bits = max_hash_bits > 31 ? 31 : max_hash_bits, + cms_bits = LP64_ONLY(1) NOT_LP64(0), epoch_bits = 2 }; @@ -106,7 +109,8 @@ class markOopDesc: public oopDesc { enum { lock_shift = 0, biased_lock_shift = lock_bits, age_shift = lock_bits + biased_lock_bits, - hash_shift = lock_bits + biased_lock_bits + age_bits, + cms_shift = age_shift + age_bits, + hash_shift = cms_shift + cms_bits, epoch_shift = hash_shift }; @@ -118,7 +122,9 @@ class markOopDesc: public oopDesc { age_mask = right_n_bits(age_bits), age_mask_in_place = age_mask << age_shift, epoch_mask = right_n_bits(epoch_bits), - epoch_mask_in_place = epoch_mask << epoch_shift + epoch_mask_in_place = epoch_mask << epoch_shift, + cms_mask = right_n_bits(cms_bits), + cms_mask_in_place = cms_mask << cms_shift #ifndef _WIN64 ,hash_mask = right_n_bits(hash_bits), hash_mask_in_place = (address_word)hash_mask << hash_shift @@ -360,4 +366,40 @@ class markOopDesc: public oopDesc { // see the definition in markOop.cpp for the gory details bool should_not_be_cached() const; + + // These markOops indicate cms free chunk blocks and not objects. + // In 64 bit, the markOop is set to distinguish them from oops. + // These are defined in 32 bit mode for vmStructs. + const static uintptr_t cms_free_chunk_pattern = 0x1; + + // Constants for the size field. + enum { size_shift = cms_shift + cms_bits, + size_bits = 35 // need for compressed oops 32G + }; + // These values are too big for Win64 + const static uintptr_t size_mask = LP64_ONLY(right_n_bits(size_bits)) + NOT_LP64(0); + const static uintptr_t size_mask_in_place = + (address_word)size_mask << size_shift; + +#ifdef _LP64 + static markOop cms_free_prototype() { + return markOop(((intptr_t)prototype() & ~cms_mask_in_place) | + ((cms_free_chunk_pattern & cms_mask) << cms_shift)); + } + uintptr_t cms_encoding() const { + return mask_bits(value() >> cms_shift, cms_mask); + } + bool is_cms_free_chunk() const { + return is_neutral() && + (cms_encoding() & cms_free_chunk_pattern) == cms_free_chunk_pattern; + } + + size_t get_size() const { return (size_t)(value() >> size_shift); } + static markOop set_size_and_free(size_t size) { + assert((size & ~size_mask) == 0, "shouldn't overflow size field"); + return markOop(((intptr_t)cms_free_prototype() & ~size_mask_in_place) | + (((intptr_t)size & size_mask) << size_shift)); + } +#endif // _LP64 }; diff --git a/hotspot/src/share/vm/oops/methodDataKlass.cpp b/hotspot/src/share/vm/oops/methodDataKlass.cpp index feddbddb06e..56592b0ee24 100644 --- a/hotspot/src/share/vm/oops/methodDataKlass.cpp +++ b/hotspot/src/share/vm/oops/methodDataKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/oops/methodDataOop.cpp b/hotspot/src/share/vm/oops/methodDataOop.cpp index 77f10e0587d..e9751e58fb4 100644 --- a/hotspot/src/share/vm/oops/methodDataOop.cpp +++ b/hotspot/src/share/vm/oops/methodDataOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/oops/methodDataOop.hpp b/hotspot/src/share/vm/oops/methodDataOop.hpp index 9c19f9b3a70..760d4eb7a42 100644 --- a/hotspot/src/share/vm/oops/methodDataOop.hpp +++ b/hotspot/src/share/vm/oops/methodDataOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -158,7 +158,6 @@ public: assert(ProfileTraps, "used only under +ProfileTraps"); uint old_flags = (_header._struct._flags & flag_mask); _header._struct._flags = (new_state << trap_shift) | old_flags; - assert(trap_state() == new_state, "sanity"); } u1 flags() { diff --git a/hotspot/src/share/vm/oops/methodOop.cpp b/hotspot/src/share/vm/oops/methodOop.cpp index cb1ad91807e..8a5507cbac8 100644 --- a/hotspot/src/share/vm/oops/methodOop.cpp +++ b/hotspot/src/share/vm/oops/methodOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/methodOop.hpp b/hotspot/src/share/vm/oops/methodOop.hpp index 0d936e251f1..965181c664d 100644 --- a/hotspot/src/share/vm/oops/methodOop.hpp +++ b/hotspot/src/share/vm/oops/methodOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index 193249bcf8e..8ca45f28703 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index 6fabe837bc8..963b9ac5cf8 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/objArrayOop.cpp b/hotspot/src/share/vm/oops/objArrayOop.cpp index c1ae6830a8e..f05d837b431 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.cpp +++ b/hotspot/src/share/vm/oops/objArrayOop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index 6f12c0f1fa1..9e4b3674fbf 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/oop.cpp b/hotspot/src/share/vm/oops/oop.cpp index badba6d4fc5..505a81f263e 100644 --- a/hotspot/src/share/vm/oops/oop.cpp +++ b/hotspot/src/share/vm/oops/oop.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index eb7959096d0..4b84a802e14 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -77,10 +77,15 @@ class oopDesc { void init_mark(); klassOop klass() const; + klassOop klass_or_null() const volatile; oop* klass_addr(); narrowOop* compressed_klass_addr(); void set_klass(klassOop k); + + // For klass field compression + int klass_gap() const; + void set_klass_gap(int z); // For when the klass pointer is being used as a linked list "next" field. void set_klass_to_list_ptr(oop k); diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 222c0d4c262..454a4f609aa 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -36,7 +36,15 @@ inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { inline klassOop oopDesc::klass() const { if (UseCompressedOops) { return (klassOop)decode_heap_oop_not_null(_metadata._compressed_klass); - // can be NULL in CMS, but isn't supported on CMS yet. + } else { + return _metadata._klass; + } +} + +inline klassOop oopDesc::klass_or_null() const volatile { + // can be NULL in CMS + if (UseCompressedOops) { + return (klassOop)decode_heap_oop(_metadata._compressed_klass); } else { return _metadata._klass; } @@ -64,15 +72,22 @@ inline void oopDesc::set_klass(klassOop k) { assert(Universe::is_bootstrapping() || k != NULL, "must be a real klassOop"); assert(Universe::is_bootstrapping() || k->is_klass(), "not a klassOop"); if (UseCompressedOops) { - // zero the gap when the klass is set, by zeroing the pointer sized - // part of the union. - _metadata._klass = NULL; oop_store_without_check(compressed_klass_addr(), (oop)k); } else { oop_store_without_check(klass_addr(), (oop) k); } } +inline int oopDesc::klass_gap() const { + return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()); +} + +inline void oopDesc::set_klass_gap(int v) { + if (UseCompressedOops) { + *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v; + } +} + inline void oopDesc::set_klass_to_list_ptr(oop k) { // This is only to be used during GC, for from-space objects, so no // barrier is needed. @@ -505,7 +520,7 @@ inline bool oopDesc::is_oop(bool ignore_mark_word) const { // try to find metaclass cycle safely without seg faulting on bad input // we should reach klassKlassObj by following klass link at most 3 times for (int i = 0; i < 3; i++) { - obj = obj->klass(); + obj = obj->klass_or_null(); // klass should be aligned and in permspace if (!check_obj_alignment(obj)) return false; if (!Universe::heap()->is_in_permanent(obj)) return false; diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp index 1db005569f8..e513efdfa3d 100644 --- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/oops/oopsHierarchy.hpp b/hotspot/src/share/vm/oops/oopsHierarchy.hpp index 32c9823272e..597dafe3de8 100644 --- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp +++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/oops/symbolKlass.cpp b/hotspot/src/share/vm/oops/symbolKlass.cpp index 68732510c1b..d0b6e2f33b5 100644 --- a/hotspot/src/share/vm/oops/symbolKlass.cpp +++ b/hotspot/src/share/vm/oops/symbolKlass.cpp @@ -209,10 +209,7 @@ int symbolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, void symbolKlass::oop_print_on(oop obj, outputStream* st) { st->print("Symbol: '"); - symbolOop sym = symbolOop(obj); - for (int i = 0; i < sym->utf8_length(); i++) { - st->print("%c", sym->byte_at(i)); - } + symbolOop(obj)->print_symbol_on(st); st->print("'"); } diff --git a/hotspot/src/share/vm/oops/symbolOop.cpp b/hotspot/src/share/vm/oops/symbolOop.cpp index 9d343257082..6308735223d 100644 --- a/hotspot/src/share/vm/oops/symbolOop.cpp +++ b/hotspot/src/share/vm/oops/symbolOop.cpp @@ -68,8 +68,17 @@ char* symbolOopDesc::as_C_string_flexible_buffer(Thread* t, void symbolOopDesc::print_symbol_on(outputStream* st) { st = st ? st : tty; - for (int index = 0; index < utf8_length(); index++) - st->put((char)byte_at(index)); + int length = UTF8::unicode_length((const char*)bytes(), utf8_length()); + const char *ptr = (const char *)bytes(); + jchar value; + for (int index = 0; index < length; index++) { + ptr = UTF8::next(ptr, &value); + if (value >= 32 && value < 127 || value == '\'' || value == '\\') { + st->put(value); + } else { + st->print("\\u%04x", value); + } + } } jchar* symbolOopDesc::as_unicode(int& length) const { diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index 35e3846ce16..e5cc05b6b1f 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 8d3adc78d71..30a9d2684d0 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp index 1b12ee877ad..5a919b916d9 100644 --- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp +++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index bdf07f63f48..26b288e660e 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -390,5 +390,8 @@ \ product(intx, MaxLabelRootDepth, 1100, \ "Maximum times call Label_Root to prevent stack overflow") \ + \ + diagnostic(intx, DominatorSearchLimit, 1000, \ + "Iterations limit in Node::dominates") \ C2_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_NOTPRODUCT_FLAG) diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 591b7ea05c2..6be045c8078 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/opto/c2compiler.hpp b/hotspot/src/share/vm/opto/c2compiler.hpp index a1d578797af..9e5d3796332 100644 --- a/hotspot/src/share/vm/opto/c2compiler.hpp +++ b/hotspot/src/share/vm/opto/c2compiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 2699072efda..84015b5335c 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -632,12 +632,12 @@ bool CallNode::may_modify(const TypePtr *addr_t, PhaseTransform *phase) { const TypeOopPtr *adrInst_t = addr_t->isa_oopptr(); // if not an InstPtr or not an instance type, assume the worst - if (adrInst_t == NULL || !adrInst_t->is_instance_field()) { + if (adrInst_t == NULL || !adrInst_t->is_known_instance_field()) { return true; } Compile *C = phase->C; int offset = adrInst_t->offset(); - assert(offset >= 0, "should be valid offset"); + assert(adrInst_t->klass_is_exact() && offset >= 0, "should be valid offset"); ciKlass* adr_k = adrInst_t->klass(); assert(adr_k->is_loaded() && adr_k->is_java_klass() && @@ -674,12 +674,11 @@ bool CallNode::may_modify(const TypePtr *addr_t, PhaseTransform *phase) { ciKlass* at_k = at_ptr->klass(); if ((adrInst_t->base() == at_ptr->base()) && at_k->is_loaded() && - at_k->is_java_klass() && - !at_k->is_interface()) { + at_k->is_java_klass()) { // If we have found an argument matching addr_t, check if the field // at the specified offset is modified. - int at_idx = C->get_alias_index(at_ptr->add_offset(offset)->isa_oopptr()); - if (base_idx == at_idx && + if ((at_k->is_interface() || adr_k == at_k || + adr_k->is_subclass_of(at_k) && !at_ptr->klass_is_exact()) && (bcea == NULL || bcea->is_arg_modified(i - TypeFunc::Parms, offset, size))) { return true; diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index daa572e78a8..0f9b26e154c 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -388,9 +388,6 @@ public: void set_next_exception(SafePointNode* n); bool has_exceptions() const { return next_exception() != NULL; } - // Does this node have a use of n other than in debug information? - virtual bool has_non_debug_use(Node *n) {return false; } - // Standard Node stuff virtual int Opcode() const; virtual bool pinned() const { return true; } @@ -497,7 +494,7 @@ public: // Returns true if the call may modify n virtual bool may_modify(const TypePtr *addr_t, PhaseTransform *phase); // Does this node have a use of n other than in debug information? - virtual bool has_non_debug_use(Node *n); + bool has_non_debug_use(Node *n); // Returns the unique CheckCastPP of a call // or result projection is there are several CheckCastPP // or returns NULL if there is no one. diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index 30ab6a59eed..6087c17e0dd 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -707,8 +707,14 @@ PhiNode* PhiNode::slice_memory(const TypePtr* adr_type) const { //------------------------split_out_instance----------------------------------- // Split out an instance type from a bottom phi. PhiNode* PhiNode::split_out_instance(const TypePtr* at, PhaseIterGVN *igvn) const { - assert(type() == Type::MEMORY && (adr_type() == TypePtr::BOTTOM || - adr_type() == TypeRawPtr::BOTTOM) , "bottom or raw memory required"); + const TypeOopPtr *t_oop = at->isa_oopptr(); + assert(t_oop != NULL && t_oop->is_known_instance(), "expecting instance oopptr"); + const TypePtr *t = adr_type(); + assert(type() == Type::MEMORY && + (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM || + t->isa_oopptr() && !t->is_oopptr()->is_known_instance() && + t->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop), + "bottom or raw memory required"); // Check if an appropriate node already exists. Node *region = in(0); @@ -848,7 +854,8 @@ const Type *PhiNode::Value( PhaseTransform *phase ) const { // Until we have harmony between classes and interfaces in the type // lattice, we must tread carefully around phis which implicitly // convert the one to the other. - const TypeInstPtr* ttip = _type->isa_narrowoop() ? _type->isa_narrowoop()->make_oopptr()->isa_instptr() :_type->isa_instptr(); + const TypePtr* ttp = _type->make_ptr(); + const TypeInstPtr* ttip = (ttp != NULL) ? ttp->isa_instptr() : NULL; bool is_intf = false; if (ttip != NULL) { ciKlass* k = ttip->klass(); @@ -867,7 +874,8 @@ const Type *PhiNode::Value( PhaseTransform *phase ) const { // of all the input types. The lattice is not distributive in // such cases. Ward off asserts in type.cpp by refusing to do // meets between interfaces and proper classes. - const TypeInstPtr* tiip = ti->isa_narrowoop() ? ti->is_narrowoop()->make_oopptr()->isa_instptr() : ti->isa_instptr(); + const TypePtr* tip = ti->make_ptr(); + const TypeInstPtr* tiip = (tip != NULL) ? tip->isa_instptr() : NULL; if (tiip) { bool ti_is_intf = false; ciKlass* k = tiip->klass(); @@ -924,13 +932,14 @@ const Type *PhiNode::Value( PhaseTransform *phase ) const { // class-typed Phi and an interface flows in, it's possible that the meet & // join report an interface back out. This isn't possible but happens // because the type system doesn't interact well with interfaces. - const TypeInstPtr *jtip = jt->isa_narrowoop() ? jt->isa_narrowoop()->make_oopptr()->isa_instptr() : jt->isa_instptr(); + const TypePtr *jtp = jt->make_ptr(); + const TypeInstPtr *jtip = (jtp != NULL) ? jtp->isa_instptr() : NULL; if( jtip && ttip ) { if( jtip->is_loaded() && jtip->klass()->is_interface() && ttip->is_loaded() && !ttip->klass()->is_interface() ) { // Happens in a CTW of rt.jar, 320-341, no extra flags assert(ft == ttip->cast_to_ptr_type(jtip->ptr()) || - ft->isa_narrowoop() && ft->isa_narrowoop()->make_oopptr() == ttip->cast_to_ptr_type(jtip->ptr()), ""); + ft->isa_narrowoop() && ft->make_ptr() == ttip->cast_to_ptr_type(jtip->ptr()), ""); jt = ft; } } @@ -1342,7 +1351,7 @@ static Node* split_flow_path(PhaseGVN *phase, PhiNode *phi) { Node *n = phi->in(i); if( !n ) return NULL; if( phase->type(n) == Type::TOP ) return NULL; - if( n->Opcode() == Op_ConP ) + if( n->Opcode() == Op_ConP || n->Opcode() == Op_ConN ) break; } if( i >= phi->req() ) // Only split for constants @@ -1615,64 +1624,6 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (opt != NULL) return opt; } - if (in(1) != NULL && in(1)->Opcode() == Op_AddP && can_reshape) { - // Try to undo Phi of AddP: - // (Phi (AddP base base y) (AddP base2 base2 y)) - // becomes: - // newbase := (Phi base base2) - // (AddP newbase newbase y) - // - // This occurs as a result of unsuccessful split_thru_phi and - // interferes with taking advantage of addressing modes. See the - // clone_shift_expressions code in matcher.cpp - Node* addp = in(1); - const Type* type = addp->in(AddPNode::Base)->bottom_type(); - Node* y = addp->in(AddPNode::Offset); - if (y != NULL && addp->in(AddPNode::Base) == addp->in(AddPNode::Address)) { - // make sure that all the inputs are similar to the first one, - // i.e. AddP with base == address and same offset as first AddP - bool doit = true; - for (uint i = 2; i < req(); i++) { - if (in(i) == NULL || - in(i)->Opcode() != Op_AddP || - in(i)->in(AddPNode::Base) != in(i)->in(AddPNode::Address) || - in(i)->in(AddPNode::Offset) != y) { - doit = false; - break; - } - // Accumulate type for resulting Phi - type = type->meet(in(i)->in(AddPNode::Base)->bottom_type()); - } - Node* base = NULL; - if (doit) { - // Check for neighboring AddP nodes in a tree. - // If they have a base, use that it. - for (DUIterator_Fast kmax, k = this->fast_outs(kmax); k < kmax; k++) { - Node* u = this->fast_out(k); - if (u->is_AddP()) { - Node* base2 = u->in(AddPNode::Base); - if (base2 != NULL && !base2->is_top()) { - if (base == NULL) - base = base2; - else if (base != base2) - { doit = false; break; } - } - } - } - } - if (doit) { - if (base == NULL) { - base = new (phase->C, in(0)->req()) PhiNode(in(0), type, NULL); - for (uint i = 1; i < req(); i++) { - base->init_req(i, in(i)->in(AddPNode::Base)); - } - phase->is_IterGVN()->register_new_node_with_optimizer(base); - } - return new (phase->C, 4) AddPNode(base, base, y); - } - } - } - // Split phis through memory merges, so that the memory merges will go away. // Piggy-back this transformation on the search for a unique input.... // It will be as if the merged memory is the unique value of the phi. diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index f4c4b0e2fae..8fd493a308e 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -129,7 +129,7 @@ public: }; PhiNode( Node *r, const Type *t, const TypePtr* at = NULL, - const int iid = TypeOopPtr::UNKNOWN_INSTANCE, + const int iid = TypeOopPtr::InstanceTop, const int iidx = Compile::AliasIdxTop, const int ioffs = Type::OffsetTop ) : TypeNode(t,r->req()), diff --git a/hotspot/src/share/vm/opto/chaitin.cpp b/hotspot/src/share/vm/opto/chaitin.cpp index bc31285bf56..5d7efdb7637 100644 --- a/hotspot/src/share/vm/opto/chaitin.cpp +++ b/hotspot/src/share/vm/opto/chaitin.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -1385,7 +1385,7 @@ void PhaseChaitin::fixup_spills() { cisc->ins_req(1,src); // Requires a memory edge } b->_nodes.map(j,cisc); // Insert into basic block - n->replace_by(cisc); // Correct graph + n->subsume_by(cisc); // Correct graph // ++_used_cisc_instructions; #ifndef PRODUCT diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp index fd952ab281d..273fb03206f 100644 --- a/hotspot/src/share/vm/opto/chaitin.hpp +++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index e61bdd73168..0371736cf10 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -37,6 +37,7 @@ macro(Allocate) macro(AllocateArray) macro(AndI) macro(AndL) +macro(AryEq) macro(AtanD) macro(Binary) macro(Bool) @@ -64,6 +65,7 @@ macro(CMoveF) macro(CMoveI) macro(CMoveL) macro(CMoveP) +macro(CMoveN) macro(CmpN) macro(CmpD) macro(CmpD3) @@ -133,6 +135,7 @@ macro(LoadD_unaligned) macro(LoadF) macro(LoadI) macro(LoadKlass) +macro(LoadNKlass) macro(LoadL) macro(LoadL_unaligned) macro(LoadPLocked) diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 6559cb4c621..3904dd5155a 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -313,9 +313,6 @@ CompileWrapper::CompileWrapper(Compile* compile) : _compile(compile) { _compile->begin_method(); } CompileWrapper::~CompileWrapper() { - if (_compile->failing()) { - _compile->print_method("Failed"); - } _compile->end_method(); if (_compile->scratch_buffer_blob() != NULL) BufferBlob::free(_compile->scratch_buffer_blob()); @@ -368,7 +365,12 @@ void Compile::init_scratch_buffer_blob() { BufferBlob* blob = BufferBlob::create("Compile::scratch_buffer", size); // Record the buffer blob for next time. set_scratch_buffer_blob(blob); - guarantee(scratch_buffer_blob() != NULL, "Need BufferBlob for code generation"); + // Have we run out of code space? + if (scratch_buffer_blob() == NULL) { + // Let CompilerBroker disable further compilations. + record_failure("Not enough space for scratch buffer in CodeCache"); + return; + } // Initialize the relocation buffers relocInfo* locs_buf = (relocInfo*) blob->instructions_end() - MAX_locs_size; @@ -599,6 +601,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr if (failing()) return; NOT_PRODUCT( verify_graph_edges(); ) + print_method("Before Matching"); + #ifndef PRODUCT if (PrintIdeal) { ttyLocker ttyl; // keep the following output all in one block @@ -1065,6 +1069,8 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const { // No constant oop pointers (such as Strings); they alias with // unknown strings. tj = to = TypeInstPtr::make(TypePtr::BotPTR,to->klass(),false,0,offset); + } else if( to->is_known_instance_field() ) { + tj = to; // Keep NotNull and klass_is_exact for instance type } else if( ptr == TypePtr::NotNull || to->klass_is_exact() ) { // During the 2nd round of IterGVN, NotNull castings are removed. // Make sure the Bottom and NotNull variants alias the same. @@ -1084,7 +1090,7 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const { } else { ciInstanceKlass *canonical_holder = k->get_canonical_holder(offset); if (!k->equals(canonical_holder) || tj->offset() != offset) { - tj = to = TypeInstPtr::make(TypePtr::BotPTR, canonical_holder, false, NULL, offset, to->instance_id()); + tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, false, NULL, offset, to->instance_id()); } } } @@ -1184,8 +1190,8 @@ void Compile::AliasType::Init(int i, const TypePtr* at) { _field = NULL; _is_rewritable = true; // default const TypeOopPtr *atoop = (at != NULL) ? at->isa_oopptr() : NULL; - if (atoop != NULL && atoop->is_instance()) { - const TypeOopPtr *gt = atoop->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); + if (atoop != NULL && atoop->is_known_instance()) { + const TypeOopPtr *gt = atoop->cast_to_instance_id(TypeOopPtr::InstanceBot); _general_index = Compile::current()->get_alias_index(gt); } else { _general_index = 0; @@ -1474,7 +1480,7 @@ void Compile::Optimize() { NOT_PRODUCT( verify_graph_edges(); ) - print_method("Start"); + print_method("After Parsing"); { // Iterative Global Value Numbering, including ideal transforms @@ -1681,7 +1687,7 @@ void Compile::Code_Gen() { Output(); } - print_method("End"); + print_method("Final Code"); // He's dead, Jim. _cfg = (PhaseCFG*)0xdeadbeef; @@ -1835,6 +1841,7 @@ static bool oop_offset_is_sane(const TypeInstPtr* tp) { // Implement items 1-5 from final_graph_reshaping below. static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { + if ( n->outcnt() == 0 ) return; // dead node uint nop = n->Opcode(); // Check for 2-input instruction with "last use" on right input. @@ -1901,7 +1908,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { break; case Op_Opaque1: // Remove Opaque Nodes before matching case Op_Opaque2: // Remove Opaque Nodes before matching - n->replace_by(n->in(1)); + n->subsume_by(n->in(1)); break; case Op_CallStaticJava: case Op_CallJava: @@ -1961,6 +1968,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { case Op_LoadC: case Op_LoadI: case Op_LoadKlass: + case Op_LoadNKlass: case Op_LoadL: case Op_LoadL_unaligned: case Op_LoadPLocked: @@ -1983,14 +1991,94 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { } case Op_AddP: { // Assert sane base pointers - const Node *addp = n->in(AddPNode::Address); + Node *addp = n->in(AddPNode::Address); assert( !addp->is_AddP() || addp->in(AddPNode::Base)->is_top() || // Top OK for allocation addp->in(AddPNode::Base) == n->in(AddPNode::Base), "Base pointers must match" ); +#ifdef _LP64 + if (UseCompressedOops && + addp->Opcode() == Op_ConP && + addp == n->in(AddPNode::Base) && + n->in(AddPNode::Offset)->is_Con()) { + // Use addressing with narrow klass to load with offset on x86. + // On sparc loading 32-bits constant and decoding it have less + // instructions (4) then load 64-bits constant (7). + // Do this transformation here since IGVN will convert ConN back to ConP. + const Type* t = addp->bottom_type(); + if (t->isa_oopptr()) { + Node* nn = NULL; + + // Look for existing ConN node of the same exact type. + Compile* C = Compile::current(); + Node* r = C->root(); + uint cnt = r->outcnt(); + for (uint i = 0; i < cnt; i++) { + Node* m = r->raw_out(i); + if (m!= NULL && m->Opcode() == Op_ConN && + m->bottom_type()->make_ptr() == t) { + nn = m; + break; + } + } + if (nn != NULL) { + // Decode a narrow oop to match address + // [R12 + narrow_oop_reg<<3 + offset] + nn = new (C, 2) DecodeNNode(nn, t); + n->set_req(AddPNode::Base, nn); + n->set_req(AddPNode::Address, nn); + if (addp->outcnt() == 0) { + addp->disconnect_inputs(NULL); + } + } + } + } +#endif break; } +#ifdef _LP64 + case Op_CmpP: + // Do this transformation here to preserve CmpPNode::sub() and + // other TypePtr related Ideal optimizations (for example, ptr nullness). + if( n->in(1)->is_DecodeN() ) { + Compile* C = Compile::current(); + Node* in2 = NULL; + if( n->in(2)->is_DecodeN() ) { + in2 = n->in(2)->in(1); + } else if ( n->in(2)->Opcode() == Op_ConP ) { + const Type* t = n->in(2)->bottom_type(); + if (t == TypePtr::NULL_PTR) { + Node *in1 = n->in(1); + if (Matcher::clone_shift_expressions) { + // x86, ARM and friends can handle 2 adds in addressing mode. + // Decode a narrow oop and do implicit NULL check in address + // [R12 + narrow_oop_reg<<3 + offset] + in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); + } else { + // Don't replace CmpP(o ,null) if 'o' is used in AddP + // to generate implicit NULL check on Sparc where + // narrow oops can't be used in address. + uint i = 0; + for (; i < in1->outcnt(); i++) { + if (in1->raw_out(i)->is_AddP()) + break; + } + if (i >= in1->outcnt()) { + in2 = ConNode::make(C, TypeNarrowOop::NULL_PTR); + } + } + } else if (t->isa_oopptr()) { + in2 = ConNode::make(C, t->make_narrowoop()); + } + } + if( in2 != NULL ) { + Node* cmpN = new (C, 3) CmpNNode(n->in(1)->in(1), in2); + n->subsume_by( cmpN ); + } + } +#endif + case Op_ModI: if (UseDivMod) { // Check if a%b and a/b both exist @@ -2000,13 +2088,13 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { Compile* C = Compile::current(); if (Matcher::has_match_rule(Op_DivModI)) { DivModINode* divmod = DivModINode::make(C, n); - d->replace_by(divmod->div_proj()); - n->replace_by(divmod->mod_proj()); + d->subsume_by(divmod->div_proj()); + n->subsume_by(divmod->mod_proj()); } else { // replace a%b with a-((a/b)*b) Node* mult = new (C, 3) MulINode(d, d->in(2)); Node* sub = new (C, 3) SubINode(d->in(1), mult); - n->replace_by( sub ); + n->subsume_by( sub ); } } } @@ -2021,13 +2109,13 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { Compile* C = Compile::current(); if (Matcher::has_match_rule(Op_DivModL)) { DivModLNode* divmod = DivModLNode::make(C, n); - d->replace_by(divmod->div_proj()); - n->replace_by(divmod->mod_proj()); + d->subsume_by(divmod->div_proj()); + n->subsume_by(divmod->mod_proj()); } else { // replace a%b with a-((a/b)*b) Node* mult = new (C, 3) MulLNode(d, d->in(2)); Node* sub = new (C, 3) SubLNode(d->in(1), mult); - n->replace_by( sub ); + n->subsume_by( sub ); } } } @@ -2073,7 +2161,7 @@ static void final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &fpu ) { // Replace many operand PackNodes with a binary tree for matching PackNode* p = (PackNode*) n; Node* btp = p->binaryTreePack(Compile::current(), 1, n->req()); - n->replace_by(btp); + n->subsume_by(btp); } break; default: @@ -2377,6 +2465,9 @@ void Compile::record_failure(const char* reason) { // Record the first failure reason. _failure_reason = reason; } + if (!C->failure_reason_is(C2Compiler::retry_no_subsuming_loads())) { + C->print_method(_failure_reason); + } _root = NULL; // flush the graph, too } diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 279b448516e..455df6bda30 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/connode.cpp b/hotspot/src/share/vm/opto/connode.cpp index c542ce397e4..8b441c99439 100644 --- a/hotspot/src/share/vm/opto/connode.cpp +++ b/hotspot/src/share/vm/opto/connode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -35,16 +35,16 @@ uint ConNode::hash() const { //------------------------------make------------------------------------------- ConNode *ConNode::make( Compile* C, const Type *t ) { - if (t->isa_narrowoop()) return new (C, 1) ConNNode( t->is_narrowoop() ); switch( t->basic_type() ) { case T_INT: return new (C, 1) ConINode( t->is_int() ); - case T_ARRAY: return new (C, 1) ConPNode( t->is_aryptr() ); case T_LONG: return new (C, 1) ConLNode( t->is_long() ); case T_FLOAT: return new (C, 1) ConFNode( t->is_float_constant() ); case T_DOUBLE: return new (C, 1) ConDNode( t->is_double_constant() ); case T_VOID: return new (C, 1) ConNode ( Type::TOP ); case T_OBJECT: return new (C, 1) ConPNode( t->is_oopptr() ); + case T_ARRAY: return new (C, 1) ConPNode( t->is_aryptr() ); case T_ADDRESS: return new (C, 1) ConPNode( t->is_ptr() ); + case T_NARROWOOP: return new (C, 1) ConNNode( t->is_narrowoop() ); // Expected cases: TypePtr::NULL_PTR, any is_rawptr() // Also seen: AnyPtr(TopPTR *+top); from command line: // r -XX:+PrintOpto -XX:CIStart=285 -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=660 @@ -185,6 +185,7 @@ CMoveNode *CMoveNode::make( Compile *C, Node *c, Node *bol, Node *left, Node *ri case T_LONG: return new (C, 4) CMoveLNode( bol, left, right, t->is_long() ); case T_OBJECT: return new (C, 4) CMovePNode( c, bol, left, right, t->is_oopptr() ); case T_ADDRESS: return new (C, 4) CMovePNode( c, bol, left, right, t->is_ptr() ); + case T_NARROWOOP: return new (C, 4) CMoveNNode( c, bol, left, right, t ); default: ShouldNotReachHere(); return NULL; @@ -556,7 +557,7 @@ Node* DecodeNNode::Identity(PhaseTransform* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); - if (in(1)->Opcode() == Op_EncodeP) { + if (in(1)->is_EncodeP()) { // (DecodeN (EncodeP p)) -> p return in(1)->in(1); } @@ -564,30 +565,19 @@ Node* DecodeNNode::Identity(PhaseTransform* phase) { } const Type *DecodeNNode::Value( PhaseTransform *phase ) const { - if (phase->type( in(1) ) == TypeNarrowOop::NULL_PTR) { - return TypePtr::NULL_PTR; - } - return bottom_type(); -} + const Type *t = phase->type( in(1) ); + if (t == Type::TOP) return Type::TOP; + if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR; -Node* DecodeNNode::decode(PhaseGVN* phase, Node* value) { - if (value->Opcode() == Op_EncodeP) { - // (DecodeN (EncodeP p)) -> p - return value->in(1); - } - const Type* newtype = value->bottom_type(); - if (newtype == TypeNarrowOop::NULL_PTR) { - return phase->transform(new (phase->C, 1) ConPNode(TypePtr::NULL_PTR)); - } else { - return phase->transform(new (phase->C, 2) DecodeNNode(value, newtype->is_narrowoop()->make_oopptr())); - } + assert(t->isa_narrowoop(), "only narrowoop here"); + return t->make_ptr(); } Node* EncodePNode::Identity(PhaseTransform* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); - if (in(1)->Opcode() == Op_DecodeN) { + if (in(1)->is_DecodeN()) { // (EncodeP (DecodeN p)) -> p return in(1)->in(1); } @@ -595,28 +585,18 @@ Node* EncodePNode::Identity(PhaseTransform* phase) { } const Type *EncodePNode::Value( PhaseTransform *phase ) const { - if (phase->type( in(1) ) == TypePtr::NULL_PTR) { - return TypeNarrowOop::NULL_PTR; - } - return bottom_type(); + const Type *t = phase->type( in(1) ); + if (t == Type::TOP) return Type::TOP; + if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR; + + assert(t->isa_oopptr(), "only oopptr here"); + return t->make_narrowoop(); } -Node* EncodePNode::encode(PhaseGVN* phase, Node* value) { - if (value->Opcode() == Op_DecodeN) { - // (EncodeP (DecodeN p)) -> p - return value->in(1); - } - const Type* newtype = value->bottom_type(); - if (newtype == TypePtr::NULL_PTR) { - return phase->transform(new (phase->C, 1) ConNNode(TypeNarrowOop::NULL_PTR)); - } else if (newtype->isa_oopptr()) { - return phase->transform(new (phase->C, 2) EncodePNode(value, newtype->is_oopptr()->make_narrowoop())); - } else { - ShouldNotReachHere(); - return NULL; // to make C++ compiler happy. - } -} +Node *EncodePNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { + return MemNode::Ideal_common_DU_postCCP(ccp, this, in(1)); +} //============================================================================= //------------------------------Identity--------------------------------------- diff --git a/hotspot/src/share/vm/opto/connode.hpp b/hotspot/src/share/vm/opto/connode.hpp index 247a364c845..a16d7f2ee84 100644 --- a/hotspot/src/share/vm/opto/connode.hpp +++ b/hotspot/src/share/vm/opto/connode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -70,11 +70,6 @@ public: else return new (C, 1) ConPNode( TypeRawPtr::make(con) ); } - - static ConPNode* make( Compile *C, ciObject* con ) { - return new (C, 1) ConPNode( TypeOopPtr::make_from_constant(con) ); - } - }; @@ -84,11 +79,6 @@ class ConNNode : public ConNode { public: ConNNode( const TypeNarrowOop *t ) : ConNode(t) {} virtual int Opcode() const; - - static ConNNode* make( Compile *C, ciObject* con ) { - return new (C, 1) ConNNode( TypeNarrowOop::make_from_constant(con) ); - } - }; @@ -210,7 +200,14 @@ public: virtual int Opcode() const; }; -//------------------------------ConstraintCastNode------------------------------------- +//------------------------------CMoveNNode------------------------------------- +class CMoveNNode : public CMoveNode { +public: + CMoveNNode( Node *c, Node *bol, Node *left, Node *right, const Type* t ) : CMoveNode(bol,left,right,t) { init_req(Control,c); } + virtual int Opcode() const; +}; + +//------------------------------ConstraintCastNode----------------------------- // cast to a different range class ConstraintCastNode: public TypeNode { public: @@ -274,6 +271,7 @@ class EncodePNode : public TypeNode { public: EncodePNode(Node* value, const Type* type): TypeNode(type, 2) { + init_class_id(Class_EncodeP); init_req(0, NULL); init_req(1, value); } @@ -282,7 +280,7 @@ class EncodePNode : public TypeNode { virtual const Type *Value( PhaseTransform *phase ) const; virtual uint ideal_reg() const { return Op_RegN; } - static Node* encode(PhaseGVN* phase, Node* value); + virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); }; //------------------------------DecodeN-------------------------------- @@ -293,6 +291,7 @@ class DecodeNNode : public TypeNode { public: DecodeNNode(Node* value, const Type* type): TypeNode(type, 2) { + init_class_id(Class_DecodeN); init_req(0, NULL); init_req(1, value); } @@ -300,8 +299,6 @@ class DecodeNNode : public TypeNode { virtual Node *Identity( PhaseTransform *phase ); virtual const Type *Value( PhaseTransform *phase ) const; virtual uint ideal_reg() const { return Op_RegP; } - - static Node* decode(PhaseGVN* phase, Node* value); }; //------------------------------Conv2BNode------------------------------------- @@ -549,10 +546,18 @@ class Opaque1Node : public Node { virtual uint hash() const ; // { return NO_HASH; } virtual uint cmp( const Node &n ) const; public: - Opaque1Node( Node *n ) : Node(0,n) {} + Opaque1Node( Compile* C, Node *n ) : Node(0,n) { + // Put it on the Macro nodes list to removed during macro nodes expansion. + init_flags(Flag_is_macro); + C->add_macro_node(this); + } // Special version for the pre-loop to hold the original loop limit // which is consumed by range check elimination. - Opaque1Node( Node *n, Node* orig_limit ) : Node(0,n,orig_limit) {} + Opaque1Node( Compile* C, Node *n, Node* orig_limit ) : Node(0,n,orig_limit) { + // Put it on the Macro nodes list to removed during macro nodes expansion. + init_flags(Flag_is_macro); + C->add_macro_node(this); + } Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } @@ -572,7 +577,11 @@ class Opaque2Node : public Node { virtual uint hash() const ; // { return NO_HASH; } virtual uint cmp( const Node &n ) const; public: - Opaque2Node( Node *n ) : Node(0,n) {} + Opaque2Node( Compile* C, Node *n ) : Node(0,n) { + // Put it on the Macro nodes list to removed during macro nodes expansion. + init_flags(Flag_is_macro); + C->add_macro_node(this); + } virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } }; diff --git a/hotspot/src/share/vm/opto/divnode.cpp b/hotspot/src/share/vm/opto/divnode.cpp index d05ef9fd316..90e198d0763 100644 --- a/hotspot/src/share/vm/opto/divnode.cpp +++ b/hotspot/src/share/vm/opto/divnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index edf71c0caf0..99772d4450c 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -580,7 +580,7 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { Node* ex_klass_node = NULL; if (has_ex_handler() && !ex_type->klass_is_exact()) { Node* p = basic_plus_adr( ex_node, ex_node, oopDesc::klass_offset_in_bytes()); - ex_klass_node = _gvn.transform(new (C, 3) LoadKlassNode(NULL, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT)); + ex_klass_node = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) ); // Compute the exception klass a little more cleverly. // Obvious solution is to simple do a LoadKlass from the 'ex_node'. @@ -592,7 +592,7 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) { ex_klass_node = new (C, ex_node->req()) PhiNode( ex_node->in(0), TypeKlassPtr::OBJECT ); for( uint i = 1; i < ex_node->req(); i++ ) { Node* p = basic_plus_adr( ex_node->in(i), ex_node->in(i), oopDesc::klass_offset_in_bytes() ); - Node* k = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT)); + Node* k = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) ); ex_klass_node->init_req( i, k ); } _gvn.set_type(ex_klass_node, TypeKlassPtr::OBJECT); diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 93a49b94127..5aa90ea1f3d 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -417,11 +417,18 @@ static Node* get_addp_base(Node *addp) { // | | // AddP ( base == address ) // + // case #8. narrow Klass's field reference. + // LoadNKlass + // | + // DecodeN + // | | + // AddP ( base == address ) + // Node *base = addp->in(AddPNode::Base)->uncast(); if (base->is_top()) { // The AddP case #3 and #6. base = addp->in(AddPNode::Address)->uncast(); assert(base->Opcode() == Op_ConP || base->Opcode() == Op_ThreadLocal || - base->Opcode() == Op_CastX2P || + base->Opcode() == Op_CastX2P || base->is_DecodeN() || (base->is_Mem() && base->bottom_type() == TypeRawPtr::NOTNULL) || (base->is_Proj() && base->in(0)->is_Allocate()), "sanity"); } @@ -476,7 +483,7 @@ static Node* find_second_addp(Node* addp, Node* n) { // void ConnectionGraph::split_AddP(Node *addp, Node *base, PhaseGVN *igvn) { const TypeOopPtr *base_t = igvn->type(base)->isa_oopptr(); - assert(base_t != NULL && base_t->is_instance(), "expecting instance oopptr"); + assert(base_t != NULL && base_t->is_known_instance(), "expecting instance oopptr"); const TypeOopPtr *t = igvn->type(addp)->isa_oopptr(); if (t == NULL) { // We are computing a raw address for a store captured by an Initialize @@ -487,8 +494,8 @@ void ConnectionGraph::split_AddP(Node *addp, Node *base, PhaseGVN *igvn) { assert(offs != Type::OffsetBot, "offset must be a constant"); t = base_t->add_offset(offs)->is_oopptr(); } - uint inst_id = base_t->instance_id(); - assert(!t->is_instance() || t->instance_id() == inst_id, + int inst_id = base_t->instance_id(); + assert(!t->is_known_instance() || t->instance_id() == inst_id, "old type must be non-instance or match new type"); const TypeOopPtr *tinst = base_t->add_offset(t->offset())->is_oopptr(); // Do NOT remove the next call: ensure an new alias index is allocated @@ -502,7 +509,7 @@ void ConnectionGraph::split_AddP(Node *addp, Node *base, PhaseGVN *igvn) { Node *adr = addp->in(AddPNode::Address); const TypeOopPtr *atype = igvn->type(adr)->isa_oopptr(); if (atype != NULL && atype->instance_id() != inst_id) { - assert(!atype->is_instance(), "no conflicting instances"); + assert(!atype->is_known_instance(), "no conflicting instances"); const TypeOopPtr *new_atype = base_t->add_offset(atype->offset())->isa_oopptr(); Node *acast = new (_compile, 2) CastPPNode(adr, new_atype); acast->set_req(0, adr->in(0)); @@ -656,7 +663,7 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra return orig_mem; Compile* C = phase->C; const TypeOopPtr *tinst = C->get_adr_type(alias_idx)->isa_oopptr(); - bool is_instance = (tinst != NULL) && tinst->is_instance(); + bool is_instance = (tinst != NULL) && tinst->is_known_instance(); Node *prev = NULL; Node *result = orig_mem; while (prev != result) { @@ -686,7 +693,7 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra AllocateNode* alloc = proj_in->as_Initialize()->allocation(); // Stop if this is the initialization for the object instance which // which contains this memory slice, otherwise skip over it. - if (alloc == NULL || alloc->_idx != tinst->instance_id()) { + if (alloc == NULL || alloc->_idx != (uint)tinst->instance_id()) { result = proj_in->in(TypeFunc::Memory); } } else if (proj_in->is_MemBar()) { @@ -880,7 +887,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) const TypeOopPtr *t = igvn->type(n)->isa_oopptr(); if (t == NULL) continue; // not a TypeInstPtr - tinst = t->cast_to_instance(ni); + tinst = t->cast_to_instance_id(ni); igvn->hash_delete(n); igvn->set_type(n, tinst); n->raise_bottom_type(tinst); @@ -888,6 +895,23 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) record_for_optimizer(n); if (alloc->is_Allocate() && ptn->_scalar_replaceable && (t->isa_instptr() || t->isa_aryptr())) { + + // First, put on the worklist all Field edges from Connection Graph + // which is more accurate then putting immediate users from Ideal Graph. + for (uint e = 0; e < ptn->edge_count(); e++) { + Node *use = _nodes->adr_at(ptn->edge_target(e))->_node; + assert(ptn->edge_type(e) == PointsToNode::FieldEdge && use->is_AddP(), + "only AddP nodes are Field edges in CG"); + if (use->outcnt() > 0) { // Don't process dead nodes + Node* addp2 = find_second_addp(use, use->in(AddPNode::Base)); + if (addp2 != NULL) { + assert(alloc->is_AllocateArray(),"array allocation was expected"); + alloc_worklist.append_if_missing(addp2); + } + alloc_worklist.append_if_missing(use); + } + } + // An allocation may have an Initialize which has raw stores. Scan // the users of the raw allocation result and push AddP users // on alloc_worklist. @@ -919,6 +943,8 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) tinst = igvn->type(base)->isa_oopptr(); } else if (n->is_Phi() || n->is_CheckCastPP() || + n->is_EncodeP() || + n->is_DecodeN() || (n->is_ConstraintCast() && n->Opcode() == Op_CastPP)) { if (visited.test_set(n->_idx)) { assert(n->is_Phi(), "loops only through Phi's"); @@ -933,15 +959,27 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) Node *val = get_map(elem); // CheckCastPP node TypeNode *tn = n->as_Type(); tinst = igvn->type(val)->isa_oopptr(); - assert(tinst != NULL && tinst->is_instance() && - tinst->instance_id() == elem , "instance type expected."); - const TypeOopPtr *tn_t = igvn->type(tn)->isa_oopptr(); + assert(tinst != NULL && tinst->is_known_instance() && + (uint)tinst->instance_id() == elem , "instance type expected."); + + const Type *tn_type = igvn->type(tn); + const TypeOopPtr *tn_t; + if (tn_type->isa_narrowoop()) { + tn_t = tn_type->make_ptr()->isa_oopptr(); + } else { + tn_t = tn_type->isa_oopptr(); + } if (tn_t != NULL && - tinst->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE)->higher_equal(tn_t)) { + tinst->cast_to_instance_id(TypeOopPtr::InstanceBot)->higher_equal(tn_t)) { + if (tn_type->isa_narrowoop()) { + tn_type = tinst->make_narrowoop(); + } else { + tn_type = tinst; + } igvn->hash_delete(tn); - igvn->set_type(tn, tinst); - tn->set_type(tinst); + igvn->set_type(tn, tn_type); + tn->set_type(tn_type); igvn->hash_insert(tn); record_for_optimizer(n); } @@ -978,6 +1016,8 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) alloc_worklist.append_if_missing(use); } else if (use->is_Phi() || use->is_CheckCastPP() || + use->is_EncodeP() || + use->is_DecodeN() || (use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) { alloc_worklist.append_if_missing(use); } @@ -1199,7 +1239,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) void ConnectionGraph::compute_escape() { - // 1. Populate Connection Graph with Ideal nodes. + // 1. Populate Connection Graph (CG) with Ideal nodes. Unique_Node_List worklist_init; worklist_init.map(_compile->unique(), NULL); // preallocate space @@ -1281,11 +1321,13 @@ void ConnectionGraph::compute_escape() { remove_deferred(ni, &deferred_edges, &visited); if (n->is_AddP()) { // If this AddP computes an address which may point to more that one - // object, nothing the address points to can be scalar replaceable. + // object or more then one field (array's element), nothing the address + // points to can be scalar replaceable. Node *base = get_addp_base(n); ptset.Clear(); PointsTo(ptset, base, igvn); - if (ptset.Size() > 1) { + if (ptset.Size() > 1 || + (ptset.Size() != 0 && ptn->offset() == Type::OffsetBot)) { for( VectorSetI j(&ptset); j.test(); ++j ) { uint pt = j.elem; ptnode_adr(pt)->_scalar_replaceable = false; @@ -1538,6 +1580,7 @@ void ConnectionGraph::process_call_result(ProjNode *resproj, PhaseTransform *pha if (k->Opcode() == Op_LoadKlass) { kt = k->as_Load()->type()->isa_klassptr(); } else { + // Also works for DecodeN(LoadNKlass). kt = k->as_Type()->type()->isa_klassptr(); } assert(kt != NULL, "TypeKlassPtr required."); @@ -1776,6 +1819,7 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) break; } case Op_LoadKlass: + case Op_LoadNKlass: { add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true); break; @@ -1877,9 +1921,7 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) case Op_StoreN: { const Type *adr_type = phase->type(n->in(MemNode::Address)); - if (adr_type->isa_narrowoop()) { - adr_type = adr_type->is_narrowoop()->make_oopptr(); - } + adr_type = adr_type->make_ptr(); if (adr_type->isa_oopptr()) { add_node(n, PointsToNode::UnknownType, PointsToNode::UnknownEscape, false); } else { @@ -1904,9 +1946,7 @@ void ConnectionGraph::record_for_escape_analysis(Node *n, PhaseTransform *phase) case Op_CompareAndSwapN: { const Type *adr_type = phase->type(n->in(MemNode::Address)); - if (adr_type->isa_narrowoop()) { - adr_type = adr_type->is_narrowoop()->make_oopptr(); - } + adr_type = adr_type->make_ptr(); if (adr_type->isa_oopptr()) { add_node(n, PointsToNode::UnknownType, PointsToNode::UnknownEscape, false); } else { @@ -1979,12 +2019,18 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { assert(false, "Op_ConP"); break; } + case Op_ConN: + { + assert(false, "Op_ConN"); + break; + } case Op_CreateEx: { assert(false, "Op_CreateEx"); break; } case Op_LoadKlass: + case Op_LoadNKlass: { assert(false, "Op_LoadKlass"); break; @@ -2081,10 +2127,7 @@ void ConnectionGraph::build_connection_graph(Node *n, PhaseTransform *phase) { case Op_CompareAndSwapN: { Node *adr = n->in(MemNode::Address); - const Type *adr_type = phase->type(adr); - if (adr_type->isa_narrowoop()) { - adr_type = adr_type->is_narrowoop()->make_oopptr(); - } + const Type *adr_type = phase->type(adr)->make_ptr(); #ifdef ASSERT if (!adr_type->isa_oopptr()) assert(phase->type(adr) == TypeRawPtr::NOTNULL, "Op_StoreP"); diff --git a/hotspot/src/share/vm/opto/escape.hpp b/hotspot/src/share/vm/opto/escape.hpp index 1d2c83511e7..c969f0dcd6c 100644 --- a/hotspot/src/share/vm/opto/escape.hpp +++ b/hotspot/src/share/vm/opto/escape.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index c02989e04d0..0627e50505b 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -307,7 +307,6 @@ static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark, // Test and set the visited bit. if (mid->raise_LCA_visited() == mark) continue; // already visited - mid->set_raise_LCA_visited(mark); // Don't process the current LCA, otherwise the search may terminate early if (mid != LCA && mid->raise_LCA_mark() == mark) { @@ -317,6 +316,8 @@ static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark, assert(early->dominates(LCA), "early is high enough"); // Resume searching at that point, skipping intermediate levels. worklist.push(LCA); + if (LCA == mid) + continue; // Don't mark as visited to avoid early termination. } else { // Keep searching through this block's predecessors. for (uint j = 1, jmax = mid->num_preds(); j < jmax; j++) { @@ -324,6 +325,7 @@ static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark, worklist.push(mid_parent); } } + mid->set_raise_LCA_visited(mark); } return LCA; } diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 49e05b8425e..ebd0d051cb8 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -532,7 +532,7 @@ void GraphKit::builtin_throw(Deoptimization::DeoptReason reason, Node* arg) { C->log()->elem("hot_throw preallocated='1' reason='%s'", Deoptimization::trap_reason_name(reason)); const TypeInstPtr* ex_con = TypeInstPtr::make(ex_obj); - Node* ex_node = _gvn.transform(new (C, 1) ConPNode(ex_con)); + Node* ex_node = _gvn.transform( ConNode::make(C, ex_con) ); // Clear the detail message of the preallocated exception object. // Weblogic sometimes mutates the detail message of exceptions @@ -1043,7 +1043,7 @@ Node* GraphKit::load_object_klass(Node* obj) { Node* akls = AllocateNode::Ideal_klass(obj, &_gvn); if (akls != NULL) return akls; Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes()); - return _gvn.transform( new (C, 3) LoadKlassNode(0, immutable_memory(), k_adr, TypeInstPtr::KLASS) ); + return _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), k_adr, TypeInstPtr::KLASS) ); } //-------------------------load_array_length----------------------------------- @@ -2210,7 +2210,7 @@ Node* GraphKit::gen_subtype_check(Node* subklass, Node* superklass) { // cache which is mutable so can't use immutable memory. Other // types load from the super-class display table which is immutable. Node *kmem = might_be_cache ? memory(p2) : immutable_memory(); - Node *nkls = _gvn.transform( new (C, 3) LoadKlassNode( NULL, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) ); + Node *nkls = _gvn.transform( LoadKlassNode::make( _gvn, kmem, p2, _gvn.type(p2)->is_ptr(), TypeKlassPtr::OBJECT_OR_NULL ) ); // Compile speed common case: ARE a subtype and we canNOT fail if( superklass == nkls ) @@ -2801,7 +2801,6 @@ Node* GraphKit::set_output_for_allocation(AllocateNode* alloc, // initialization, and source them from the new InitializeNode. // This will allow us to observe initializations when they occur, // and link them properly (as a group) to the InitializeNode. - Node* klass_node = alloc->in(AllocateNode::KlassNode); assert(init->in(InitializeNode::Memory) == malloc, ""); MergeMemNode* minit_in = MergeMemNode::make(C, malloc); init->set_req(InitializeNode::Memory, minit_in); diff --git a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp index e65cc72b43f..114a7ea17c7 100644 --- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp +++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp @@ -100,16 +100,18 @@ void IdealGraphPrinter::clean_up() { // Constructor, either file or network output IdealGraphPrinter::IdealGraphPrinter() { - _traverse_outs = false; + // By default dump both ins and outs since dead or unreachable code + // needs to appear in the graph. There are also some special cases + // in the mach where kill projections have no users but should + // appear in the dump. + _traverse_outs = true; _should_send_method = true; _output = NULL; buffer[0] = 0; _depth = 0; _current_method = NULL; assert(!_current_method, "current method must be initialized to NULL"); - _arena = new Arena(); - - _stream = new (ResourceObj::C_HEAP) networkStream(); + _stream = NULL; if (PrintIdealGraphFile != NULL) { ThreadCritical tc; @@ -124,12 +126,16 @@ IdealGraphPrinter::IdealGraphPrinter() { } else { st.print("%s%d", PrintIdealGraphFile, _file_count); } - _output = new (ResourceObj::C_HEAP) fileStream(st.as_string()); + fileStream *stream = new (ResourceObj::C_HEAP) fileStream(st.as_string()); + _output = stream; } else { - _output = new (ResourceObj::C_HEAP) fileStream(PrintIdealGraphFile); + fileStream *stream = new (ResourceObj::C_HEAP) fileStream(PrintIdealGraphFile); + _output = stream; } _file_count++; } else { + _stream = new (ResourceObj::C_HEAP) networkStream(); + // Try to connect to visualizer if (_stream->connect(PrintIdealGraphAddress, PrintIdealGraphPort)) { char c = 0; @@ -149,13 +155,24 @@ IdealGraphPrinter::IdealGraphPrinter() { } } - start_element(TOP_ELEMENT); + _xml = new (ResourceObj::C_HEAP) xmlStream(_output); + + head(TOP_ELEMENT); } // Destructor, close file or network stream IdealGraphPrinter::~IdealGraphPrinter() { - end_element(TOP_ELEMENT); + tail(TOP_ELEMENT); + + // tty->print_cr("Walk time: %d", (int)_walk_time.milliseconds()); + // tty->print_cr("Output time: %d", (int)_output_time.milliseconds()); + // tty->print_cr("Build blocks time: %d", (int)_build_blocks_time.milliseconds()); + + if(_xml) { + delete _xml; + _xml = NULL; + } if (_stream) { delete _stream; @@ -171,94 +188,93 @@ IdealGraphPrinter::~IdealGraphPrinter() { } } -void IdealGraphPrinter::print_ifg(PhaseIFG* ifg) { - // Code to print an interference graph to tty, currently not used +void IdealGraphPrinter::begin_elem(const char *s) { + _xml->begin_elem(s); +} - /* - if (!_current_method) return; - // Remove neighbor colors +void IdealGraphPrinter::end_elem() { + _xml->end_elem(); +} - for (uint i = 0; i < ifg._maxlrg; i++) { +void IdealGraphPrinter::begin_head(const char *s) { + _xml->begin_head(s); +} - IndexSet *s = ifg.neighbors(i); - IndexSetIterator elements(s); - uint neighbor; - while ((neighbor = elements.next()) != 0) { - tty->print_cr("Edge between %d and %d\n", i, neighbor); - } - } +void IdealGraphPrinter::end_head() { + _xml->end_head(); +} +void IdealGraphPrinter::print_attr(const char *name, intptr_t val) { + stringStream stream; + stream.print(INTX_FORMAT, val); + print_attr(name, stream.as_string()); +} - for (uint i = 0; i < ifg._maxlrg; i++) { - LRG &l = ifg.lrgs(i); - if (l._def) { - OptoReg::Name name = l.reg(); - tty->print("OptoReg::dump: "); - OptoReg::dump(name); - tty->print_cr(""); - tty->print_cr("name=%d\n", name); - if (name) { - if (OptoReg::is_stack(name)) { - tty->print_cr("Stack number %d\n", OptoReg::reg2stack(name)); +void IdealGraphPrinter::print_attr(const char *name, const char *val) { + _xml->print(" %s='", name); + text(val); + _xml->print("'"); +} - } else if (!OptoReg::is_valid(name)) { - tty->print_cr("BAD!!!"); - } else { +void IdealGraphPrinter::head(const char *name) { + _xml->head(name); +} - if (OptoReg::is_reg(name)) { - tty->print_cr(OptoReg::regname(name)); - } else { - int x = 0; - } - } - int x = 0; - } +void IdealGraphPrinter::tail(const char *name) { + _xml->tail(name); +} - if (l._def == NodeSentinel) { - tty->print("multiple mapping from %d: ", i); - for (int j=0; jlength(); j++) { - tty->print("%d ", l._defs->at(j)->_idx); - } - tty->print_cr(""); - } else { - tty->print_cr("mapping between %d and %d\n", i, l._def->_idx); - } - } - }*/ +void IdealGraphPrinter::text(const char *s) { + _xml->text(s); +} + +void IdealGraphPrinter::print_prop(const char *name, int val) { + + stringStream stream; + stream.print("%d", val); + print_prop(name, stream.as_string()); +} + +void IdealGraphPrinter::print_prop(const char *name, const char *val) { + begin_head(PROPERTY_ELEMENT); + print_attr(PROPERTY_NAME_PROPERTY, name); + end_head(); + text(val); + tail(PROPERTY_ELEMENT); } void IdealGraphPrinter::print_method(ciMethod *method, int bci, InlineTree *tree) { + begin_head(METHOD_ELEMENT); - Properties properties; stringStream str; method->print_name(&str); stringStream shortStr; method->print_short_name(&shortStr); + print_attr(METHOD_NAME_PROPERTY, str.as_string()); + print_attr(METHOD_SHORT_NAME_PROPERTY, shortStr.as_string()); + print_attr(METHOD_BCI_PROPERTY, bci); - properties.add(new Property(METHOD_NAME_PROPERTY, str.as_string())); - properties.add(new Property(METHOD_SHORT_NAME_PROPERTY, shortStr.as_string())); - properties.add(new Property(METHOD_BCI_PROPERTY, bci)); - start_element(METHOD_ELEMENT, &properties); + end_head(); - start_element(BYTECODES_ELEMENT); + head(BYTECODES_ELEMENT); output()->print_cr("print_codes_on(output()); output()->print_cr("]]>"); - end_element(BYTECODES_ELEMENT); + tail(BYTECODES_ELEMENT); - start_element(INLINE_ELEMENT); + head(INLINE_ELEMENT); if (tree != NULL) { GrowableArray subtrees = tree->subtrees(); for (int i = 0; i < subtrees.length(); i++) { print_inline_tree(subtrees.at(i)); } } - end_element(INLINE_ELEMENT); + tail(INLINE_ELEMENT); - end_element(METHOD_ELEMENT); + tail(METHOD_ELEMENT); output()->flush(); } @@ -271,12 +287,6 @@ void IdealGraphPrinter::print_inline_tree(InlineTree *tree) { } -void IdealGraphPrinter::clear_nodes() { - // for (int i = 0; i < _nodes.length(); i++) { - // _nodes.at(i)->clear_node(); - // } -} - void IdealGraphPrinter::print_inlining(Compile* compile) { // Print inline tree @@ -298,143 +308,56 @@ void IdealGraphPrinter::begin_method(Compile* compile) { assert(method, "null methods are not allowed!"); assert(!_current_method, "current method must be null!"); - _arena->destruct_contents(); + head(GROUP_ELEMENT); - start_element(GROUP_ELEMENT); + head(PROPERTIES_ELEMENT); // Print properties - Properties properties; - // Add method name stringStream strStream; method->print_name(&strStream); - properties.add(new Property(METHOD_NAME_PROPERTY, strStream.as_string())); + print_prop(METHOD_NAME_PROPERTY, strStream.as_string()); if (method->flags().is_public()) { - properties.add(new Property(METHOD_IS_PUBLIC_PROPERTY, TRUE_VALUE)); + print_prop(METHOD_IS_PUBLIC_PROPERTY, TRUE_VALUE); } if (method->flags().is_static()) { - properties.add(new Property(METHOD_IS_STATIC_PROPERTY, TRUE_VALUE)); + print_prop(METHOD_IS_STATIC_PROPERTY, TRUE_VALUE); } - properties.print(this); + tail(PROPERTIES_ELEMENT); if (_stream) { char answer = 0; - _stream->flush(); + _xml->flush(); int result = _stream->read(&answer, 1); _should_send_method = (answer == 'y'); } - this->_nodes = GrowableArray(_arena, 2, 0, NULL); - this->_edges = GrowableArray< EdgeDescription * >(_arena, 2, 0, NULL); - - this->_current_method = method; - - - _output->flush(); + _xml->flush(); } // Has to be called whenever a method has finished compilation void IdealGraphPrinter::end_method() { -// if (finish && !in_method) return; - nmethod* method = (nmethod*)this->_current_method->code(); - start_element(ASSEMBLY_ELEMENT); - // Disassembler::decode(method, _output); - end_element(ASSEMBLY_ELEMENT); - - - end_element(GROUP_ELEMENT); + tail(GROUP_ELEMENT); _current_method = NULL; - _output->flush(); - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - delete desc; - _nodes.at_put(i, NULL); - } - } - this->_nodes.clear(); - - - for (int i = 0; i < _edges.length(); i++) { - // for (int j=0; j<_edges.at(i)->length(); j++) { - EdgeDescription *conn = _edges.at(i); - conn->print(this); - if (conn) { - delete conn; - _edges.at_put(i, NULL); - } - //} - //_edges.at(i)->clear(); - //delete _edges.at(i); - //_edges.at_put(i, NULL); - } - this->_edges.clear(); - -// in_method = false; -} - -// Outputs an XML start element -void IdealGraphPrinter::start_element(const char *s, Properties *properties /* = NULL */, bool print_indent /* = false */, bool print_return /* = true */) { - - start_element_helper(s, properties, false, print_indent, print_return); - _depth++; - -} - -// Outputs an XML start element without body -void IdealGraphPrinter::simple_element(const char *s, Properties *properties /* = NULL */, bool print_indent /* = false */) { - start_element_helper(s, properties, true, print_indent, true); -} - -// Outputs an XML start element. If outputEnd is true, the element has no body. -void IdealGraphPrinter::start_element_helper(const char *s, Properties *properties, bool outputEnd, bool print_indent /* = false */, bool print_return /* = true */) { - - assert(_output, "output stream must exist!"); - - if (print_indent) this->print_indent(); - _output->print("<"); - _output->print(s); - if (properties) properties->print_as_attributes(this); - - if (outputEnd) { - _output->print("/"); - } - - _output->print(">"); - if (print_return) _output->print_cr(""); - + _xml->flush(); } // Print indent void IdealGraphPrinter::print_indent() { + tty->print_cr("printing ident %d", _depth); for (int i = 0; i < _depth; i++) { - _output->print(INDENT); + _xml->print(INDENT); } } -// Outputs an XML end element -void IdealGraphPrinter::end_element(const char *s, bool print_indent /* = true */, bool print_return /* = true */) { - - assert(_output, "output stream must exist!"); - - _depth--; - - if (print_indent) this->print_indent(); - _output->print("print(s); - _output->print(">"); - if (print_return) _output->print_cr(""); - -} - bool IdealGraphPrinter::traverse_outs() { return _traverse_outs; } @@ -443,7 +366,255 @@ void IdealGraphPrinter::set_traverse_outs(bool b) { _traverse_outs = b; } -void IdealGraphPrinter::walk(Node *start) { +intptr_t IdealGraphPrinter::get_node_id(Node *n) { + return (intptr_t)(n); +} + +void IdealGraphPrinter::visit_node(Node *n, void *param) { + + if(param) { + + // Output edge + intptr_t dest_id = get_node_id(n); + for ( uint i = 0; i < n->len(); i++ ) { + if ( n->in(i) ) { + Node *source = n->in(i); + begin_elem(EDGE_ELEMENT); + intptr_t source_id = get_node_id(source); + print_attr(FROM_PROPERTY, source_id); + print_attr(TO_PROPERTY, dest_id); + print_attr(INDEX_PROPERTY, i); + end_elem(); + } + } + + } else { + + // Output node + begin_head(NODE_ELEMENT); + print_attr(NODE_ID_PROPERTY, get_node_id(n)); + end_head(); + + head(PROPERTIES_ELEMENT); + + Node *node = n; +#ifndef PRODUCT + node->_in_dump_cnt++; + print_prop(NODE_NAME_PROPERTY, (const char *)node->Name()); + const Type *t = node->bottom_type(); + print_prop("type", (const char *)Type::msg[t->base()]); + print_prop("idx", node->_idx); +#ifdef ASSERT + print_prop("debug_idx", node->_debug_idx); +#endif + + if(C->cfg() != NULL) { + Block *block = C->cfg()->_bbs[node->_idx]; + if(block == NULL) { + print_prop("block", C->cfg()->_blocks[0]->_pre_order); + } else { + print_prop("block", block->_pre_order); + } + } + + const jushort flags = node->flags(); + if (flags & Node::Flag_is_Copy) { + print_prop("is_copy", "true"); + } + if (flags & Node::Flag_is_Call) { + print_prop("is_call", "true"); + } + if (flags & Node::Flag_rematerialize) { + print_prop("rematerialize", "true"); + } + if (flags & Node::Flag_needs_anti_dependence_check) { + print_prop("needs_anti_dependence_check", "true"); + } + if (flags & Node::Flag_is_macro) { + print_prop("is_macro", "true"); + } + if (flags & Node::Flag_is_Con) { + print_prop("is_con", "true"); + } + if (flags & Node::Flag_is_cisc_alternate) { + print_prop("is_cisc_alternate", "true"); + } + if (flags & Node::Flag_is_Branch) { + print_prop("is_branch", "true"); + } + if (flags & Node::Flag_is_block_start) { + print_prop("is_block_start", "true"); + } + if (flags & Node::Flag_is_Goto) { + print_prop("is_goto", "true"); + } + if (flags & Node::Flag_is_dead_loop_safe) { + print_prop("is_dead_loop_safe", "true"); + } + if (flags & Node::Flag_may_be_short_branch) { + print_prop("may_be_short_branch", "true"); + } + if (flags & Node::Flag_is_safepoint_node) { + print_prop("is_safepoint_node", "true"); + } + if (flags & Node::Flag_is_pc_relative) { + print_prop("is_pc_relative", "true"); + } + + if (C->matcher() != NULL) { + if (C->matcher()->is_shared(node)) { + print_prop("is_shared", "true"); + } else { + print_prop("is_shared", "false"); + } + if (C->matcher()->is_dontcare(node)) { + print_prop("is_dontcare", "true"); + } else { + print_prop("is_dontcare", "false"); + } + + Node* old = C->matcher()->find_old_node(node); + if (old != NULL) { + print_prop("old_node_idx", old->_idx); + } + } + + if (node->is_Proj()) { + print_prop("con", (int)node->as_Proj()->_con); + } + + if (node->is_Mach()) { + print_prop("idealOpcode", (const char *)NodeClassNames[node->as_Mach()->ideal_Opcode()]); + } + + buffer[0] = 0; + stringStream s2(buffer, sizeof(buffer) - 1); + + node->dump_spec(&s2); + if (t != NULL && (t->isa_instptr() || t->isa_klassptr())) { + const TypeInstPtr *toop = t->isa_instptr(); + const TypeKlassPtr *tkls = t->isa_klassptr(); + ciKlass* klass = toop ? toop->klass() : (tkls ? tkls->klass() : NULL ); + if( klass && klass->is_loaded() && klass->is_interface() ) { + s2.print(" Interface:"); + } else if( toop ) { + s2.print(" Oop:"); + } else if( tkls ) { + s2.print(" Klass:"); + } + t->dump_on(&s2); + } else if( t == Type::MEMORY ) { + s2.print(" Memory:"); + MemNode::dump_adr_type(node, node->adr_type(), &s2); + } + + assert(s2.size() < sizeof(buffer), "size in range"); + print_prop("dump_spec", buffer); + + if (node->is_block_proj()) { + print_prop("is_block_proj", "true"); + } + + if (node->is_block_start()) { + print_prop("is_block_start", "true"); + } + + const char *short_name = "short_name"; + if (strcmp(node->Name(), "Parm") == 0 && node->as_Proj()->_con >= TypeFunc::Parms) { + int index = node->as_Proj()->_con - TypeFunc::Parms; + if (index >= 10) { + print_prop(short_name, "PA"); + } else { + sprintf(buffer, "P%d", index); + print_prop(short_name, buffer); + } + } else if (strcmp(node->Name(), "IfTrue") == 0) { + print_prop(short_name, "T"); + } else if (strcmp(node->Name(), "IfFalse") == 0) { + print_prop(short_name, "F"); + } else if ((node->is_Con() && node->is_Type()) || node->is_Proj()) { + + if (t->base() == Type::Int && t->is_int()->is_con()) { + const TypeInt *typeInt = t->is_int(); + assert(typeInt->is_con(), "must be constant"); + jint value = typeInt->get_con(); + + // max. 2 chars allowed + if (value >= -9 && value <= 99) { + sprintf(buffer, "%d", value); + print_prop(short_name, buffer); + } else { + print_prop(short_name, "I"); + } + } else if (t == Type::TOP) { + print_prop(short_name, "^"); + } else if (t->base() == Type::Long && t->is_long()->is_con()) { + const TypeLong *typeLong = t->is_long(); + assert(typeLong->is_con(), "must be constant"); + jlong value = typeLong->get_con(); + + // max. 2 chars allowed + if (value >= -9 && value <= 99) { + sprintf(buffer, "%d", value); + print_prop(short_name, buffer); + } else { + print_prop(short_name, "L"); + } + } else if (t->base() == Type::KlassPtr) { + const TypeKlassPtr *typeKlass = t->is_klassptr(); + print_prop(short_name, "CP"); + } else if (t->base() == Type::Control) { + print_prop(short_name, "C"); + } else if (t->base() == Type::Memory) { + print_prop(short_name, "M"); + } else if (t->base() == Type::Abio) { + print_prop(short_name, "IO"); + } else if (t->base() == Type::Return_Address) { + print_prop(short_name, "RA"); + } else if (t->base() == Type::AnyPtr) { + print_prop(short_name, "P"); + } else if (t->base() == Type::RawPtr) { + print_prop(short_name, "RP"); + } else if (t->base() == Type::AryPtr) { + print_prop(short_name, "AP"); + } + } + + JVMState* caller = NULL; + if (node->is_SafePoint()) { + caller = node->as_SafePoint()->jvms(); + } else { + Node_Notes* notes = C->node_notes_at(node->_idx); + if (notes != NULL) { + caller = notes->jvms(); + } + } + + if (caller != NULL) { + stringStream bciStream; + while(caller) { + bciStream.print("%d ", caller->bci()); + caller = caller->caller(); + } + print_prop("bci", bciStream.as_string()); + } + + if (_chaitin && _chaitin != (PhaseChaitin *)0xdeadbeef) { + buffer[0] = 0; + _chaitin->dump_register(node, buffer); + print_prop("reg", buffer); + print_prop("lrg", _chaitin->n2lidx(node)); + } + + node->_in_dump_cnt--; +#endif + + tail(PROPERTIES_ELEMENT); + tail(NODE_ELEMENT); + } +} + +void IdealGraphPrinter::walk_nodes(Node *start, void *param) { VectorSet visited(Thread::current()->resource_area()); @@ -453,7 +624,7 @@ void IdealGraphPrinter::walk(Node *start) { while(nodeStack.length() > 0) { Node *n = nodeStack.pop(); - IdealGraphPrinter::pre_node(n, this); + visit_node(n, param); if (_traverse_outs) { for (DUIterator i = n->outs(); n->has_out(i); i++) { @@ -474,573 +645,6 @@ void IdealGraphPrinter::walk(Node *start) { } } -void IdealGraphPrinter::compress(int index, GrowableArray* blocks) { - Block *block = blocks->adr_at(index); - - int ancestor = block->ancestor(); - assert(ancestor != -1, ""); - - Block *ancestor_block = blocks->adr_at(ancestor); - if (ancestor_block->ancestor() != -1) { - compress(ancestor, blocks); - - int label = block->label(); - Block *label_block = blocks->adr_at(label); - - int ancestor_label = ancestor_block->label(); - Block *ancestor_label_block = blocks->adr_at(label); - if (ancestor_label_block->semi() < label_block->semi()) { - block->set_label(ancestor_label); - } - - block->set_ancestor(ancestor_block->ancestor()); - } -} - -int IdealGraphPrinter::eval(int index, GrowableArray* blocks) { - Block *block = blocks->adr_at(index); - if (block->ancestor() == -1) { - return index; - } else { - compress(index, blocks); - return block->label(); - } -} - -void IdealGraphPrinter::link(int index1, int index2, GrowableArray* blocks) { - Block *block2 = blocks->adr_at(index2); - block2->set_ancestor(index1); -} - -void IdealGraphPrinter::build_dominators(GrowableArray* blocks) { - - if (blocks->length() == 0) return; - - GrowableArray stack; - stack.append(0); - - GrowableArray array; - - assert(blocks->length() > 0, ""); - blocks->adr_at(0)->set_dominator(0); - - int n = 0; - while(!stack.is_empty()) { - int index = stack.pop(); - Block *block = blocks->adr_at(index); - block->set_semi(n); - array.append(block); - n = n + 1; - for (int i = 0; i < block->succs()->length(); i++) { - int succ_index = block->succs()->at(i); - Block *succ = blocks->adr_at(succ_index); - if (succ->semi() == -1) { - succ->set_parent(index); - stack.push(succ_index); - } - succ->add_pred(index); - } - } - - for (int i=n-1; i>0; i--) { - Block *block = array.at(i); - int block_index = block->index(); - for (int j=0; jpred()->length(); j++) { - int pred_index = block->pred()->at(j); - int cur_index = eval(pred_index, blocks); - - Block *cur_block = blocks->adr_at(cur_index); - if (cur_block->semi() < block->semi()) { - block->set_semi(cur_block->semi()); - } - } - - int semi_index = block->semi(); - Block *semi_block = array.at(semi_index); - semi_block->add_to_bucket(block_index); - - link(block->parent(), block_index, blocks); - Block *parent_block = blocks->adr_at(block->parent()); - - for (int j=0; jbucket()->length(); j++) { - int cur_index = parent_block->bucket()->at(j); - int new_index = eval(cur_index, blocks); - Block *cur_block = blocks->adr_at(cur_index); - Block *new_block = blocks->adr_at(new_index); - int dom = block->parent(); - - if (new_block->semi() < cur_block->semi()) { - dom = new_index; - } - - cur_block->set_dominator(dom); - } - - parent_block->clear_bucket(); - } - - for (int i=1; i < n; i++) { - - Block *block = array.at(i); - int block_index = block->index(); - - int semi_index = block->semi(); - Block *semi_block = array.at(semi_index); - - if (block->dominator() != semi_block->index()) { - int new_dom = blocks->adr_at(block->dominator())->dominator(); - block->set_dominator(new_dom); - } - } - - for (int i = 0; i < blocks->length(); i++) { - if (blocks->adr_at(i)->dominator() == -1) { - blocks->adr_at(i)->set_dominator(0); - } - } - - // Build dominates array - for (int i=1; i < blocks->length(); i++) { - Block *block = blocks->adr_at(i); - int dominator = block->dominator(); - Block *dom_block = blocks->adr_at(dominator); - dom_block->add_dominates(i); - dom_block->add_child(i); - - while(dominator != 0) { - dominator = dom_block->dominator(); - dom_block = blocks->adr_at(dominator); - dom_block->add_child(i); - } - } -} - -void IdealGraphPrinter::build_common_dominator(int **common_dominator, int index, GrowableArray* blocks) { - - common_dominator[index][index] = index; - Block *block = blocks->adr_at(index); - for (int i = 0; i < block->dominates()->length(); i++) { - Block *dominated = blocks->adr_at(block->dominates()->at(i)); - - for (int j=0; jchildren()->length(); j++) { - Block *child = blocks->adr_at(dominated->children()->at(j)); - common_dominator[index][child->index()] = common_dominator[child->index()][index] = index; - - for (int k=0; kadr_at(block->dominates()->at(k)); - common_dominator[child->index()][other_dominated->index()] = common_dominator[other_dominated->index()][child->index()] = index; - - for (int l=0 ; lchildren()->length(); l++) { - Block *other_child = blocks->adr_at(other_dominated->children()->at(l)); - common_dominator[child->index()][other_child->index()] = common_dominator[other_child->index()][child->index()] = index; - } - } - } - - build_common_dominator(common_dominator, dominated->index(), blocks); - } -} - -void IdealGraphPrinter::schedule_latest(int **common_dominator, GrowableArray* blocks) { - - int queue_size = _nodes.length() + 1; - NodeDescription **queue = NEW_RESOURCE_ARRAY(NodeDescription *, queue_size); - int queue_start = 0; - int queue_end = 0; - Arena *a = new Arena(); - VectorSet on_queue(a); - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - desc->init_succs(); - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - for (uint j=0; jnode()->len(); j++) { - Node *n = desc->node()->in(j); - if (n) { - NodeDescription *other_desc = _nodes.at(n->_idx); - other_desc->add_succ(desc); - } - } - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc && desc->block_index() == -1) { - - // Put Phi into same block as region - if (desc->node()->is_Phi() && desc->node()->in(0) && _nodes.at(desc->node()->in(0)->_idx)->block_index() != -1) { - int index = _nodes.at(desc->node()->in(0)->_idx)->block_index(); - desc->set_block_index(index); - blocks->adr_at(index)->add_node(desc); - - // Put Projections to same block as parent - } else if (desc->node()->is_block_proj() && _nodes.at(desc->node()->is_block_proj()->_idx)->block_index() != -1) { - int index = _nodes.at(desc->node()->is_block_proj()->_idx)->block_index(); - desc->set_block_index(index); - blocks->adr_at(index)->add_node(desc); - } else { - queue[queue_end] = desc; - queue_end++; - on_queue.set(desc->node()->_idx); - } - } - } - - - int z = 0; - while(queue_start != queue_end && z < 10000) { - - NodeDescription *desc = queue[queue_start]; - queue_start = (queue_start + 1) % queue_size; - on_queue >>= desc->node()->_idx; - - Node* node = desc->node(); - - if (desc->succs()->length() == 0) { - int x = 0; - } - - int block_index = -1; - if (desc->succs()->length() != 0) { - for (int i = 0; i < desc->succs()->length(); i++) { - NodeDescription *cur_desc = desc->succs()->at(i); - if (cur_desc != desc) { - if (cur_desc->succs()->length() == 0) { - - // Ignore nodes with 0 successors - - } else if (cur_desc->block_index() == -1) { - - // Let this node schedule first - block_index = -1; - break; - - } else if (cur_desc->node()->is_Phi()){ - - // Special treatment for Phi functions - PhiNode *phi = cur_desc->node()->as_Phi(); - assert(phi->in(0) && phi->in(0)->is_Region(), "Must have region node in first input"); - RegionNode *region = phi->in(0)->as_Region(); - - for (uint j=1; jlen(); j++) { - Node *cur_phi_input = phi->in(j); - if (cur_phi_input == desc->node() && region->in(j)) { - NodeDescription *cur_region_input = _nodes.at(region->in(j)->_idx); - if (cur_region_input->block_index() == -1) { - - // Let this node schedule first - block_index = -1; - break; - } else { - if (block_index == -1) { - block_index = cur_region_input->block_index(); - } else { - block_index = common_dominator[block_index][cur_region_input->block_index()]; - } - } - } - } - - } else { - if (block_index == -1) { - block_index = cur_desc->block_index(); - } else { - block_index = common_dominator[block_index][cur_desc->block_index()]; - } - } - } - } - } - - if (block_index == -1) { - queue[queue_end] = desc; - queue_end = (queue_end + 1) % queue_size; - on_queue.set(desc->node()->_idx); - z++; - } else { - assert(desc->block_index() == -1, ""); - desc->set_block_index(block_index); - blocks->adr_at(block_index)->add_node(desc); - z = 0; - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc && desc->block_index() == -1) { - - //if (desc->node()->is_Proj() || desc->node()->is_Con()) { - Node *parent = desc->node()->in(0); - uint cur = 1; - while(!parent && cur < desc->node()->len()) { - parent = desc->node()->in(cur); - cur++; - } - - if (parent && _nodes.at(parent->_idx)->block_index() != -1) { - int index = _nodes.at(parent->_idx)->block_index(); - desc->set_block_index(index); - blocks->adr_at(index)->add_node(desc); - } else { - desc->set_block_index(0); - blocks->adr_at(0)->add_node(desc); - //ShouldNotReachHere(); - } - //} - /* - if (desc->node()->is_block_proj() && _nodes.at(desc->node()->is_block_proj()->_idx)->block_index() != -1) { - int index = _nodes.at(desc->node()->is_block_proj()->_idx)->block_index(); - desc->set_block_index(index); - blocks->adr_at(index)->add_node(desc); - } */ - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - desc->clear_succs(); - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - int block_index = desc->block_index(); - - assert(block_index >= 0 && block_index < blocks->length(), "Block index must be in range"); - assert(blocks->adr_at(block_index)->nodes()->contains(desc), "Node must be child of block"); - } - } - a->destruct_contents(); -} - -void IdealGraphPrinter::build_blocks(Node *root) { - - Arena *a = new Arena(); - Node_Stack stack(a, 100); - - VectorSet visited(a); - stack.push(root, 0); - GrowableArray blocks(a, 2, 0, Block(0)); - - for (int i = 0; i < _nodes.length(); i++) { - if (_nodes.at(i)) _nodes.at(i)->set_block_index(-1); - } - - - // Order nodes such that node index is equal to idx - for (int i = 0; i < _nodes.length(); i++) { - - if (_nodes.at(i)) { - NodeDescription *node = _nodes.at(i); - int index = node->node()->_idx; - if (index != i) { - _nodes.at_grow(index); - NodeDescription *tmp = _nodes.at(index); - *(_nodes.adr_at(index)) = node; - *(_nodes.adr_at(i)) = tmp; - i--; - } - } - } - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *node = _nodes.at(i); - if (node) { - assert(node->node()->_idx == (uint)i, ""); - } - } - - while(stack.is_nonempty()) { - - //Node *n = stack.node(); - //int index = stack.index(); - Node *proj = stack.node();//n->in(index); - const Node *parent = proj->is_block_proj(); - if (parent == NULL) { - parent = proj; - } - - if (!visited.test_set(parent->_idx)) { - - NodeDescription *end_desc = _nodes.at(parent->_idx); - int block_index = blocks.length(); - Block block(block_index); - blocks.append(block); - Block *b = blocks.adr_at(block_index); - b->set_start(end_desc); - // assert(end_desc->block_index() == -1, ""); - end_desc->set_block_index(block_index); - b->add_node(end_desc); - - // Skip any control-pinned middle'in stuff - Node *p = proj; - NodeDescription *start_desc = NULL; - do { - proj = p; // Update pointer to last Control - if (p->in(0) == NULL) { - start_desc = end_desc; - break; - } - p = p->in(0); // Move control forward - start_desc = _nodes.at(p->_idx); - assert(start_desc, ""); - - if (start_desc != end_desc && start_desc->block_index() == -1) { - assert(start_desc->block_index() == -1, ""); - assert(block_index < blocks.length(), ""); - start_desc->set_block_index(block_index); - b->add_node(start_desc); - } - } while( !p->is_block_proj() && - !p->is_block_start() ); - - for (uint i = 0; i < start_desc->node()->len(); i++) { - - Node *pred_node = start_desc->node()->in(i); - - - if (pred_node && pred_node != start_desc->node()) { - const Node *cur_parent = pred_node->is_block_proj(); - if (cur_parent != NULL) { - pred_node = (Node *)cur_parent; - } - - NodeDescription *pred_node_desc = _nodes.at(pred_node->_idx); - if (pred_node_desc->block_index() != -1) { - blocks.adr_at(pred_node_desc->block_index())->add_succ(block_index); - } - } - } - - for (DUIterator_Fast dmax, i = end_desc->node()->fast_outs(dmax); i < dmax; i++) { - Node* cur_succ = end_desc->node()->fast_out(i); - NodeDescription *cur_succ_desc = _nodes.at(cur_succ->_idx); - - DUIterator_Fast dmax2, i2 = cur_succ->fast_outs(dmax2); - if (cur_succ->is_block_proj() && i2 < dmax2 && !cur_succ->is_Root()) { - - for (; i2fast_out(i2); - if (cur_succ2) { - cur_succ_desc = _nodes.at(cur_succ2->_idx); - if (cur_succ_desc == NULL) { - // dead node so skip it - continue; - } - if (cur_succ2 != end_desc->node() && cur_succ_desc->block_index() != -1) { - b->add_succ(cur_succ_desc->block_index()); - } - } - } - - } else { - - if (cur_succ != end_desc->node() && cur_succ_desc && cur_succ_desc->block_index() != -1) { - b->add_succ(cur_succ_desc->block_index()); - } - } - } - - - int num_preds = p->len(); - int bottom = -1; - if (p->is_Region() || p->is_Phi()) { - bottom = 0; - } - - int pushed = 0; - for (int i=num_preds - 1; i > bottom; i--) { - if (p->in(i) != NULL && p->in(i) != p) { - stack.push(p->in(i), 0); - pushed++; - } - } - - if (pushed == 0 && p->is_Root() && !_matcher) { - // Special case when backedges to root are not yet built - for (int i = 0; i < _nodes.length(); i++) { - if (_nodes.at(i) && _nodes.at(i)->node()->is_SafePoint() && _nodes.at(i)->node()->outcnt() == 0) { - stack.push(_nodes.at(i)->node(), 0); - } - } - } - - } else { - stack.pop(); - } - } - - build_dominators(&blocks); - - int **common_dominator = NEW_RESOURCE_ARRAY(int *, blocks.length()); - for (int i = 0; i < blocks.length(); i++) { - int *cur = NEW_RESOURCE_ARRAY(int, blocks.length()); - common_dominator[i] = cur; - - for (int j=0; jadd_child(blocks.adr_at(i)->index()); - } - build_common_dominator(common_dominator, 0, &blocks); - - schedule_latest(common_dominator, &blocks); - - start_element(CONTROL_FLOW_ELEMENT); - - for (int i = 0; i < blocks.length(); i++) { - Block *block = blocks.adr_at(i); - - Properties props; - props.add(new Property(BLOCK_NAME_PROPERTY, i)); - props.add(new Property(BLOCK_DOMINATOR_PROPERTY, block->dominator())); - start_element(BLOCK_ELEMENT, &props); - - if (block->succs()->length() > 0) { - start_element(SUCCESSORS_ELEMENT); - for (int j=0; jsuccs()->length(); j++) { - int cur_index = block->succs()->at(j); - if (cur_index != 0 /* start_block has must not have inputs */) { - Properties properties; - properties.add(new Property(BLOCK_NAME_PROPERTY, cur_index)); - simple_element(SUCCESSOR_ELEMENT, &properties); - } - } - end_element(SUCCESSORS_ELEMENT); - } - - start_element(NODES_ELEMENT); - - for (int j=0; jnodes()->length(); j++) { - NodeDescription *n = block->nodes()->at(j); - Properties properties; - properties.add(new Property(NODE_ID_PROPERTY, n->id())); - simple_element(NODE_ELEMENT, &properties); - } - - end_element(NODES_ELEMENT); - - end_element(BLOCK_ELEMENT); - } - - - end_element(CONTROL_FLOW_ELEMENT); - - a->destruct_contents(); -} - void IdealGraphPrinter::print_method(Compile* compile, const char *name, int level, bool clear_nodes) { print(compile, name, (Node *)compile->root(), level, clear_nodes); } @@ -1048,872 +652,53 @@ void IdealGraphPrinter::print_method(Compile* compile, const char *name, int lev // Print current ideal graph void IdealGraphPrinter::print(Compile* compile, const char *name, Node *node, int level, bool clear_nodes) { -// if (finish && !in_method) return; if (!_current_method || !_should_send_method || level > PrintIdealGraphLevel) return; - assert(_current_method, "newMethod has to be called first!"); - - if (clear_nodes) { - int x = 0; - } - - _clear_nodes = clear_nodes; + this->C = compile; // Warning, unsafe cast? - _chaitin = (PhaseChaitin *)compile->regalloc(); - _matcher = compile->matcher(); + _chaitin = (PhaseChaitin *)C->regalloc(); + begin_head(GRAPH_ELEMENT); + print_attr(GRAPH_NAME_PROPERTY, (const char *)name); + end_head(); - // Update nodes - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - desc->set_state(Invalid); - } - } - Node *n = node; - walk(n); + head(NODES_ELEMENT); + walk_nodes(node, NULL); + tail(NODES_ELEMENT); - // Update edges - for (int i = 0; i < _edges.length(); i++) { - _edges.at(i)->set_state(Invalid); - } + head(EDGES_ELEMENT); + walk_nodes(node, (void *)1); + tail(EDGES_ELEMENT); + if (C->cfg() != NULL) { + head(CONTROL_FLOW_ELEMENT); + for (uint i = 0; i < C->cfg()->_blocks.size(); i++) { + Block *b = C->cfg()->_blocks[i]; + begin_head(BLOCK_ELEMENT); + print_attr(BLOCK_NAME_PROPERTY, b->_pre_order); + end_head(); - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc && desc->state() != Invalid) { - - int to = desc->id(); - uint len = desc->node()->len(); - for (uint j=0; jnode()->in(j); - - if (n) { - - - intptr_t from = (intptr_t)n; - - // Assert from node is valid - /* - bool ok = false; - for (int k=0; k<_nodes.length(); k++) { - NodeDescription *desc = _nodes.at(k); - if (desc && desc->id() == from) { - assert(desc->state() != Invalid, ""); - ok = true; - } - } - assert(ok, "");*/ - - uint index = j; - if (index >= desc->node()->req()) { - index = desc->node()->req(); - } - - print_edge(from, to, index); - } + head(SUCCESSORS_ELEMENT); + for (uint s = 0; s < C->cfg()->_blocks[i]->_num_succs; s++) { + begin_elem(SUCCESSOR_ELEMENT); + print_attr(BLOCK_NAME_PROPERTY, b->_succs[s]->_pre_order); + end_elem(); } + tail(SUCCESSORS_ELEMENT); + + tail(BLOCK_ELEMENT); } + + tail(CONTROL_FLOW_ELEMENT); } - - bool is_different = false; - - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc && desc->state() != Valid) { - is_different = true; - break; - } - } - - if (!is_different) { - for (int i = 0; i < _edges.length(); i++) { - EdgeDescription *conn = _edges.at(i); - if (conn && conn->state() != Valid) { - is_different = true; - break; - } - } - } - - // No changes -> do not print graph - if (!is_different) return; - - Properties properties; - properties.add(new Property(GRAPH_NAME_PROPERTY, (const char *)name)); - start_element(GRAPH_ELEMENT, &properties); - - start_element(NODES_ELEMENT); - for (int i = 0; i < _nodes.length(); i++) { - NodeDescription *desc = _nodes.at(i); - if (desc) { - desc->print(this); - if (desc->state() == Invalid) { - delete desc; - _nodes.at_put(i, NULL); - } else { - desc->set_state(Valid); - } - } - } - end_element(NODES_ELEMENT); - - build_blocks(node); - - start_element(EDGES_ELEMENT); - for (int i = 0; i < _edges.length(); i++) { - EdgeDescription *conn = _edges.at(i); - - // Assert from and to nodes are valid - /* - if (!conn->state() == Invalid) { - bool ok1 = false; - bool ok2 = false; - for (int j=0; j<_nodes.length(); j++) { - NodeDescription *desc = _nodes.at(j); - if (desc && desc->id() == conn->from()) { - ok1 = true; - } - - if (desc && desc->id() == conn->to()) { - ok2 = true; - } - } - - assert(ok1, "from node not found!"); - assert(ok2, "to node not found!"); - }*/ - - conn->print(this); - if (conn->state() == Invalid) { - _edges.remove_at(i); - delete conn; - i--; - } - } - - end_element(EDGES_ELEMENT); - - end_element(GRAPH_ELEMENT); - - _output->flush(); -} - -// Print edge -void IdealGraphPrinter::print_edge(int from, int to, int index) { - - EdgeDescription *conn = new EdgeDescription(from, to, index); - for (int i = 0; i < _edges.length(); i++) { - if (_edges.at(i)->equals(conn)) { - conn->set_state(Valid); - delete _edges.at(i); - _edges.at_put(i, conn); - return; - } - } - - _edges.append(conn); + tail(GRAPH_ELEMENT); + output()->flush(); } extern const char *NodeClassNames[]; -// Create node description -IdealGraphPrinter::NodeDescription *IdealGraphPrinter::create_node_description(Node* node) { - -#ifndef PRODUCT - node->_in_dump_cnt++; - NodeDescription *desc = new NodeDescription(node); - desc->properties()->add(new Property(NODE_NAME_PROPERTY, (const char *)node->Name())); - - const Type *t = node->bottom_type(); - desc->properties()->add(new Property("type", (const char *)Type::msg[t->base()])); - - desc->properties()->add(new Property("idx", node->_idx)); -#ifdef ASSERT - desc->properties()->add(new Property("debug_idx", node->_debug_idx)); -#endif - - - const jushort flags = node->flags(); - if (flags & Node::Flag_is_Copy) { - desc->properties()->add(new Property("is_copy", "true")); - } - if (flags & Node::Flag_is_Call) { - desc->properties()->add(new Property("is_call", "true")); - } - if (flags & Node::Flag_rematerialize) { - desc->properties()->add(new Property("rematerialize", "true")); - } - if (flags & Node::Flag_needs_anti_dependence_check) { - desc->properties()->add(new Property("needs_anti_dependence_check", "true")); - } - if (flags & Node::Flag_is_macro) { - desc->properties()->add(new Property("is_macro", "true")); - } - if (flags & Node::Flag_is_Con) { - desc->properties()->add(new Property("is_con", "true")); - } - if (flags & Node::Flag_is_cisc_alternate) { - desc->properties()->add(new Property("is_cisc_alternate", "true")); - } - if (flags & Node::Flag_is_Branch) { - desc->properties()->add(new Property("is_branch", "true")); - } - if (flags & Node::Flag_is_block_start) { - desc->properties()->add(new Property("is_block_start", "true")); - } - if (flags & Node::Flag_is_Goto) { - desc->properties()->add(new Property("is_goto", "true")); - } - if (flags & Node::Flag_is_dead_loop_safe) { - desc->properties()->add(new Property("is_dead_loop_safe", "true")); - } - if (flags & Node::Flag_may_be_short_branch) { - desc->properties()->add(new Property("may_be_short_branch", "true")); - } - if (flags & Node::Flag_is_safepoint_node) { - desc->properties()->add(new Property("is_safepoint_node", "true")); - } - if (flags & Node::Flag_is_pc_relative) { - desc->properties()->add(new Property("is_pc_relative", "true")); - } - - if (_matcher) { - if (_matcher->is_shared(desc->node())) { - desc->properties()->add(new Property("is_shared", "true")); - } else { - desc->properties()->add(new Property("is_shared", "false")); - } - - if (_matcher->is_dontcare(desc->node())) { - desc->properties()->add(new Property("is_dontcare", "true")); - } else { - desc->properties()->add(new Property("is_dontcare", "false")); - } - } - - if (node->is_Proj()) { - desc->properties()->add(new Property("con", (int)node->as_Proj()->_con)); - } - - if (node->is_Mach()) { - desc->properties()->add(new Property("idealOpcode", (const char *)NodeClassNames[node->as_Mach()->ideal_Opcode()])); - } - - - - - - outputStream *oldTty = tty; - buffer[0] = 0; - stringStream s2(buffer, sizeof(buffer) - 1); - - node->dump_spec(&s2); - assert(s2.size() < sizeof(buffer), "size in range"); - desc->properties()->add(new Property("dump_spec", buffer)); - - if (node->is_block_proj()) { - desc->properties()->add(new Property("is_block_proj", "true")); - } - - if (node->is_block_start()) { - desc->properties()->add(new Property("is_block_start", "true")); - } - - const char *short_name = "short_name"; - if (strcmp(node->Name(), "Parm") == 0 && node->as_Proj()->_con >= TypeFunc::Parms) { - int index = node->as_Proj()->_con - TypeFunc::Parms; - if (index >= 10) { - desc->properties()->add(new Property(short_name, "PA")); - } else { - sprintf(buffer, "P%d", index); - desc->properties()->add(new Property(short_name, buffer)); - } - } else if (strcmp(node->Name(), "IfTrue") == 0) { - desc->properties()->add(new Property(short_name, "T")); - } else if (strcmp(node->Name(), "IfFalse") == 0) { - desc->properties()->add(new Property(short_name, "F")); - } else if ((node->is_Con() && node->is_Type()) || node->is_Proj()) { - - if (t->base() == Type::Int && t->is_int()->is_con()) { - const TypeInt *typeInt = t->is_int(); - assert(typeInt->is_con(), "must be constant"); - jint value = typeInt->get_con(); - - // max. 2 chars allowed - if (value >= -9 && value <= 99) { - sprintf(buffer, "%d", value); - desc->properties()->add(new Property(short_name, buffer)); - } - else - { - desc->properties()->add(new Property(short_name, "I")); - } - } else if (t == Type::TOP) { - desc->properties()->add(new Property(short_name, "^")); - } else if (t->base() == Type::Long && t->is_long()->is_con()) { - const TypeLong *typeLong = t->is_long(); - assert(typeLong->is_con(), "must be constant"); - jlong value = typeLong->get_con(); - - // max. 2 chars allowed - if (value >= -9 && value <= 99) { - sprintf(buffer, "%d", value); - desc->properties()->add(new Property(short_name, buffer)); - } - else - { - desc->properties()->add(new Property(short_name, "L")); - } - } else if (t->base() == Type::KlassPtr) { - const TypeKlassPtr *typeKlass = t->is_klassptr(); - desc->properties()->add(new Property(short_name, "CP")); - } else if (t->base() == Type::Control) { - desc->properties()->add(new Property(short_name, "C")); - } else if (t->base() == Type::Memory) { - desc->properties()->add(new Property(short_name, "M")); - } else if (t->base() == Type::Abio) { - desc->properties()->add(new Property(short_name, "IO")); - } else if (t->base() == Type::Return_Address) { - desc->properties()->add(new Property(short_name, "RA")); - } else if (t->base() == Type::AnyPtr) { - desc->properties()->add(new Property(short_name, "P")); - } else if (t->base() == Type::RawPtr) { - desc->properties()->add(new Property(short_name, "RP")); - } else if (t->base() == Type::AryPtr) { - desc->properties()->add(new Property(short_name, "AP")); - } - } - - if (node->is_SafePoint()) { - SafePointNode *safePointNode = node->as_SafePoint(); - if (safePointNode->jvms()) { - stringStream bciStream; - bciStream.print("%d ", safePointNode->jvms()->bci()); - JVMState *caller = safePointNode->jvms()->caller(); - while(caller) { - bciStream.print("%d ", caller->bci()); - - caller = caller->caller(); - } - desc->properties()->add(new Property("bci", bciStream.as_string())); - } - } - - if (_chaitin && _chaitin != (PhaseChaitin *)0xdeadbeef) { - buffer[0] = 0; - _chaitin->dump_register(node, buffer); - desc->properties()->add(new Property("reg", buffer)); - desc->properties()->add(new Property("lrg", _chaitin->n2lidx(node))); - } - - - node->_in_dump_cnt--; - return desc; -#else - return NULL; -#endif -} - -void IdealGraphPrinter::pre_node(Node* node, void *env) { - - IdealGraphPrinter *printer = (IdealGraphPrinter *)env; - - NodeDescription *newDesc = printer->create_node_description(node); - - if (printer->_clear_nodes) { - - printer->_nodes.append(newDesc); - } else { - - NodeDescription *desc = printer->_nodes.at_grow(node->_idx, NULL); - - if (desc && desc->equals(newDesc)) { - //desc->set_state(Valid); - //desc->set_node(node); - delete desc; - printer->_nodes.at_put(node->_idx, NULL); - newDesc->set_state(Valid); - //printer->_nodes.at_put(node->_idx, newDesc); - } else { - - if (desc && desc->id() == newDesc->id()) { - delete desc; - printer->_nodes.at_put(node->_idx, NULL); - newDesc->set_state(New); - - } - - //if (desc) { - // delete desc; - //} - - //printer->_nodes.at_put(node->_idx, newDesc); - } - - printer->_nodes.append(newDesc); - } -} - -void IdealGraphPrinter::post_node(Node* node, void *env) { -} - outputStream *IdealGraphPrinter::output() { - return _output; -} - -IdealGraphPrinter::Description::Description() { - _state = New; -} - -void IdealGraphPrinter::Description::print(IdealGraphPrinter *printer) { - if (_state == Invalid) { - print_removed(printer); - } else if (_state == New) { - print_changed(printer); - } -} - -void IdealGraphPrinter::Description::set_state(State s) { - _state = s; -} - -IdealGraphPrinter::State IdealGraphPrinter::Description::state() { - return _state; -} - -void IdealGraphPrinter::Block::set_proj(NodeDescription *n) { - _proj = n; -} - -void IdealGraphPrinter::Block::set_start(NodeDescription *n) { - _start = n; -} - -int IdealGraphPrinter::Block::semi() { - return _semi; -} - -int IdealGraphPrinter::Block::parent() { - return _parent; -} - -GrowableArray* IdealGraphPrinter::Block::bucket() { - return &_bucket; -} - -GrowableArray* IdealGraphPrinter::Block::children() { - return &_children; -} - -void IdealGraphPrinter::Block::add_child(int i) { - _children.append(i); -} - -GrowableArray* IdealGraphPrinter::Block::dominates() { - return &_dominates; -} - -void IdealGraphPrinter::Block::add_dominates(int i) { - _dominates.append(i); -} - -void IdealGraphPrinter::Block::add_to_bucket(int i) { - _bucket.append(i); -} - -void IdealGraphPrinter::Block::clear_bucket() { - _bucket.clear(); -} - -void IdealGraphPrinter::Block::set_dominator(int i) { - _dominator = i; -} - -void IdealGraphPrinter::Block::set_label(int i) { - _label = i; -} - -int IdealGraphPrinter::Block::label() { - return _label; -} - -int IdealGraphPrinter::Block::ancestor() { - return _ancestor; -} - -void IdealGraphPrinter::Block::set_ancestor(int i) { - _ancestor = i; -} - -int IdealGraphPrinter::Block::dominator() { - return _dominator; -} - -int IdealGraphPrinter::Block::index() { - return _index; -} - -void IdealGraphPrinter::Block::set_parent(int i) { - _parent = i; -} - -GrowableArray* IdealGraphPrinter::Block::pred() { - return &_pred; -} - -void IdealGraphPrinter::Block::set_semi(int i) { - _semi = i; -} - -IdealGraphPrinter::Block::Block() { -} - -IdealGraphPrinter::Block::Block(int index) { - _index = index; - _label = index; - _semi = -1; - _ancestor = -1; - _dominator = -1; -} - -void IdealGraphPrinter::Block::add_pred(int i) { - _pred.append(i); -} - -IdealGraphPrinter::NodeDescription *IdealGraphPrinter::Block::proj() { - return _proj; -} - -IdealGraphPrinter::NodeDescription *IdealGraphPrinter::Block::start() { - return _start; -} - -GrowableArray* IdealGraphPrinter::Block::succs() { - return &_succs; -} - -void IdealGraphPrinter::Block::add_succ(int index) { - - if (this->_index == 16 && index == 15) { - int x = 0; - } - - if (!_succs.contains(index)) { - _succs.append(index); - } -} - - -void IdealGraphPrinter::Block::add_node(NodeDescription *n) { - if (!_nodes.contains(n)) { - _nodes.append(n); - } -} - -GrowableArray* IdealGraphPrinter::Block::nodes() { - return &_nodes; -} - -int IdealGraphPrinter::NodeDescription::count = 0; - -IdealGraphPrinter::NodeDescription::NodeDescription(Node* node) : _node(node) { - _id = (intptr_t)(node); - _block_index = -1; -} - -IdealGraphPrinter::NodeDescription::~NodeDescription() { - _properties.clean(); -} - -// void IdealGraphPrinter::NodeDescription::set_node(Node* node) { -// //this->_node = node; -// } - -int IdealGraphPrinter::NodeDescription::block_index() { - return _block_index; -} - - -GrowableArray* IdealGraphPrinter::NodeDescription::succs() { - return &_succs; -} - -void IdealGraphPrinter::NodeDescription::clear_succs() { - _succs.clear(); -} - -void IdealGraphPrinter::NodeDescription::init_succs() { - _succs = GrowableArray(); -} - -void IdealGraphPrinter::NodeDescription::add_succ(NodeDescription *desc) { - _succs.append(desc); -} - -void IdealGraphPrinter::NodeDescription::set_block_index(int i) { - _block_index = i; -} - -bool IdealGraphPrinter::NodeDescription::equals(NodeDescription *desc) { - if (desc == NULL) return false; - if (desc->id() != id()) return false; - return properties()->equals(desc->properties()); -} - -Node* IdealGraphPrinter::NodeDescription::node() { - return _node; -} - -IdealGraphPrinter::Properties* IdealGraphPrinter::NodeDescription::properties() { - return &_properties; -} - -uint IdealGraphPrinter::NodeDescription::id() { - return _id; -} - -void IdealGraphPrinter::NodeDescription::print_changed(IdealGraphPrinter *printer) { - - - Properties properties; - properties.add(new Property(NODE_ID_PROPERTY, id())); - printer->start_element(NODE_ELEMENT, &properties); - - this->properties()->print(printer); - - - printer->end_element(NODE_ELEMENT); -} - -void IdealGraphPrinter::NodeDescription::print_removed(IdealGraphPrinter *printer) { - - Properties properties; - properties.add(new Property(NODE_ID_PROPERTY, id())); - printer->simple_element(REMOVE_NODE_ELEMENT, &properties); -} - -IdealGraphPrinter::EdgeDescription::EdgeDescription(int from, int to, int index) { - this->_from = from; - this->_to = to; - this->_index = index; -} - -IdealGraphPrinter::EdgeDescription::~EdgeDescription() { -} - -int IdealGraphPrinter::EdgeDescription::from() { - return _from; -} - -int IdealGraphPrinter::EdgeDescription::to() { - return _to; -} - -void IdealGraphPrinter::EdgeDescription::print_changed(IdealGraphPrinter *printer) { - - Properties properties; - properties.add(new Property(INDEX_PROPERTY, _index)); - properties.add(new Property(FROM_PROPERTY, _from)); - properties.add(new Property(TO_PROPERTY, _to)); - printer->simple_element(EDGE_ELEMENT, &properties); -} - -void IdealGraphPrinter::EdgeDescription::print_removed(IdealGraphPrinter *printer) { - - Properties properties; - properties.add(new Property(INDEX_PROPERTY, _index)); - properties.add(new Property(FROM_PROPERTY, _from)); - properties.add(new Property(TO_PROPERTY, _to)); - printer->simple_element(REMOVE_EDGE_ELEMENT, &properties); -} - -bool IdealGraphPrinter::EdgeDescription::equals(IdealGraphPrinter::EdgeDescription *desc) { - if (desc == NULL) return false; - return (_from == desc->_from && _to == desc->_to && _index == desc->_index); -} - -IdealGraphPrinter::Properties::Properties() : list(new (ResourceObj::C_HEAP) GrowableArray(2, 0, NULL, true)) { -} - -IdealGraphPrinter::Properties::~Properties() { - clean(); - delete list; -} - -void IdealGraphPrinter::Properties::add(Property *p) { - assert(p != NULL, "Property not NULL"); - list->append(p); -} - -void IdealGraphPrinter::Properties::print(IdealGraphPrinter *printer) { - printer->start_element(PROPERTIES_ELEMENT); - - for (int i = 0; i < list->length(); i++) { - list->at(i)->print(printer); - } - - printer->end_element(PROPERTIES_ELEMENT); -} - -void IdealGraphPrinter::Properties::clean() { - for (int i = 0; i < list->length(); i++) { - delete list->at(i); - list->at_put(i, NULL); - } - list->clear(); - assert(list->length() == 0, "List cleared"); -} - -void IdealGraphPrinter::Properties::remove(const char *name) { - for (int i = 0; i < list->length(); i++) { - if (strcmp(list->at(i)->name(), name) == 0) { - delete list->at(i); - list->remove_at(i); - i--; - } - } -} - -void IdealGraphPrinter::Properties::print_as_attributes(IdealGraphPrinter *printer) { - - for (int i = 0; i < list->length(); i++) { - assert(list->at(i) != NULL, "Property not null!"); - printer->output()->print(" "); - list->at(i)->print_as_attribute(printer); - } -} - -bool IdealGraphPrinter::Properties::equals(Properties* p) { - if (p->list->length() != this->list->length()) return false; - - for (int i = 0; i < list->length(); i++) { - assert(list->at(i) != NULL, "Property not null!"); - if (!list->at(i)->equals(p->list->at(i))) return false; - } - - return true; -} - -IdealGraphPrinter::Property::Property() { - _name = NULL; - _value = NULL; -} - -const char *IdealGraphPrinter::Property::name() { - return _name; -} - -IdealGraphPrinter::Property::Property(const Property* p) { - - this->_name = NULL; - this->_value = NULL; - - if (p->_name != NULL) { - _name = dup(p->_name); - } - - if (p->_value) { - _value = dup(p->_value); - } -} - -IdealGraphPrinter::Property::~Property() { - - clean(); -} - -IdealGraphPrinter::Property::Property(const char *name, const char *value) { - - assert(name, "Name must not be null!"); - assert(value, "Value must not be null!"); - - _name = dup(name); - _value = dup(value); -} - -IdealGraphPrinter::Property::Property(const char *name, int intValue) { - _name = dup(name); - - stringStream stream; - stream.print("%d", intValue); - _value = dup(stream.as_string()); -} - -void IdealGraphPrinter::Property::clean() { - if (_name) { - delete _name; - _name = NULL; - } - - if (_value) { - delete _value; - _value = NULL; - } -} - - -bool IdealGraphPrinter::Property::is_null() { - return _name == NULL; -} - -void IdealGraphPrinter::Property::print(IdealGraphPrinter *printer) { - - assert(!is_null(), "null properties cannot be printed!"); - Properties properties; - properties.add(new Property(PROPERTY_NAME_PROPERTY, _name)); - printer->start_element(PROPERTY_ELEMENT, &properties, false, false); - printer->print_xml(_value); - printer->end_element(PROPERTY_ELEMENT, false, true); -} - -void IdealGraphPrinter::Property::print_as_attribute(IdealGraphPrinter *printer) { - - printer->output()->print(_name); - printer->output()->print("=\""); - printer->print_xml(_value); - printer->output()->print("\""); -} - - -bool IdealGraphPrinter::Property::equals(Property* p) { - - if (is_null() && p->is_null()) return true; - if (is_null()) return false; - if (p->is_null()) return false; - - int cmp1 = strcmp(p->_name, _name); - if (cmp1 != 0) return false; - - int cmp2 = strcmp(p->_value, _value); - if (cmp2 != 0) return false; - - return true; -} - -void IdealGraphPrinter::print_xml(const char *value) { - size_t len = strlen(value); - - char buf[2]; - buf[1] = 0; - for (size_t i = 0; i < len; i++) { - char c = value[i]; - - switch(c) { - case '<': - output()->print("<"); - break; - - case '>': - output()->print(">"); - break; - - default: - buf[0] = c; - output()->print(buf); - break; - } - } + return _xml; } #endif diff --git a/hotspot/src/share/vm/opto/idealGraphPrinter.hpp b/hotspot/src/share/vm/opto/idealGraphPrinter.hpp index b73493e195e..c4914f53a8b 100644 --- a/hotspot/src/share/vm/opto/idealGraphPrinter.hpp +++ b/hotspot/src/share/vm/opto/idealGraphPrinter.hpp @@ -82,222 +82,42 @@ private: static const char *METHOD_SHORT_NAME_PROPERTY; static const char *ASSEMBLY_ELEMENT; - class Property { - - private: - - const char *_name; - const char *_value; - - public: - - Property(); - Property(const Property* p); - ~Property(); - Property(const char *name, const char *value); - Property(const char *name, int value); - bool equals(Property* p); - void print(IdealGraphPrinter *printer); - void print_as_attribute(IdealGraphPrinter *printer); - bool is_null(); - void clean(); - const char *name(); - - static const char* dup(const char *str) { - char * copy = new char[strlen(str)+1]; - strcpy(copy, str); - return copy; - } - - }; - - class Properties { - - private: - - GrowableArray *list; - - public: - - Properties(); - ~Properties(); - void add(Property *p); - void remove(const char *name); - bool equals(Properties* p); - void print(IdealGraphPrinter *printer); - void print_as_attributes(IdealGraphPrinter *printer); - void clean(); - - }; - - - class Description { - - private: - - State _state; - - public: - - Description(); - - State state(); - void set_state(State s); - void print(IdealGraphPrinter *printer); - virtual void print_changed(IdealGraphPrinter *printer) = 0; - virtual void print_removed(IdealGraphPrinter *printer) = 0; - - }; - - class NodeDescription : public Description{ - - public: - - static int count; - - private: - - GrowableArray _succs; - int _block_index; - uintptr_t _id; - Properties _properties; - Node* _node; - - public: - - NodeDescription(Node* node); - ~NodeDescription(); - Node* node(); - - // void set_node(Node* node); - GrowableArray* succs(); - void init_succs(); - void clear_succs(); - void add_succ(NodeDescription *desc); - int block_index(); - void set_block_index(int i); - Properties* properties(); - virtual void print_changed(IdealGraphPrinter *printer); - virtual void print_removed(IdealGraphPrinter *printer); - bool equals(NodeDescription *desc); - uint id(); - - }; - - class Block { - - private: - - NodeDescription *_start; - NodeDescription *_proj; - GrowableArray _succs; - GrowableArray _nodes; - GrowableArray _dominates; - GrowableArray _children; - int _semi; - int _parent; - GrowableArray _pred; - GrowableArray _bucket; - int _index; - int _dominator; - int _ancestor; - int _label; - - public: - - Block(); - Block(int index); - - void add_node(NodeDescription *n); - GrowableArray* nodes(); - GrowableArray* children(); - void add_child(int i); - void add_succ(int index); - GrowableArray* succs(); - GrowableArray* dominates(); - void add_dominates(int i); - NodeDescription *start(); - NodeDescription *proj(); - void set_start(NodeDescription *n); - void set_proj(NodeDescription *n); - - int label(); - void set_label(int i); - int ancestor(); - void set_ancestor(int i); - int index(); - int dominator(); - void set_dominator(int i); - int parent(); - void set_parent(int i); - int semi(); - GrowableArray* bucket(); - void add_to_bucket(int i); - void clear_bucket(); - GrowableArray* pred(); - void set_semi(int i); - void add_pred(int i); - - }; - - class EdgeDescription : public Description { - - private: - - int _from; - int _to; - int _index; - public: - - EdgeDescription(int from, int to, int index); - ~EdgeDescription(); - - virtual void print_changed(IdealGraphPrinter *printer); - virtual void print_removed(IdealGraphPrinter *printer); - bool equals(EdgeDescription *desc); - int from(); - int to(); - }; - + elapsedTimer _walk_time; + elapsedTimer _output_time; + elapsedTimer _build_blocks_time; static int _file_count; networkStream *_stream; + xmlStream *_xml; outputStream *_output; ciMethod *_current_method; - GrowableArray _nodes; - GrowableArray _edges; int _depth; - Arena *_arena; char buffer[128]; bool _should_send_method; PhaseChaitin* _chaitin; - bool _clear_nodes; - Matcher* _matcher; bool _traverse_outs; - - void start_element_helper(const char *name, Properties *properties, bool endElement, bool print_indent = false, bool print_return = true); - NodeDescription *create_node_description(Node* node); + Compile *C; static void pre_node(Node* node, void *env); static void post_node(Node* node, void *env); - void schedule_latest(int **common_dominator, GrowableArray* blocks); - void build_common_dominator(int **common_dominator, int index, GrowableArray* blocks); - void compress(int index, GrowableArray* blocks); - int eval(int index, GrowableArray* blocks); - void link(int index1, int index2, GrowableArray* blocks); - void build_dominators(GrowableArray* blocks); - void build_blocks(Node *node); - void walk(Node *n); - void start_element(const char *name, Properties *properties = NULL, bool print_indent = false, bool print_return = true); - void simple_element(const char *name, Properties *properties = NULL, bool print_indent = false); - void end_element(const char *name, bool print_indent = false, bool print_return = true); - void print_edge(int from, int to, int index); void print_indent(); void print_method(ciMethod *method, int bci, InlineTree *tree); void print_inline_tree(InlineTree *tree); - void clear_nodes(); - + void visit_node(Node *n, void *param); + void walk_nodes(Node *start, void *param); + void begin_elem(const char *s); + void end_elem(); + void begin_head(const char *s); + void end_head(); + void print_attr(const char *name, const char *val); + void print_attr(const char *name, intptr_t val); + void print_prop(const char *name, const char *val); + void print_prop(const char *name, int val); + void tail(const char *name); + void head(const char *name); + void text(const char *s); + intptr_t get_node_id(Node *n); IdealGraphPrinter(); ~IdealGraphPrinter(); @@ -308,7 +128,6 @@ public: bool traverse_outs(); void set_traverse_outs(bool b); - void print_ifg(PhaseIFG* ifg); outputStream *output(); void print_inlining(Compile* compile); void begin_method(Compile* compile); diff --git a/hotspot/src/share/vm/opto/idealKit.cpp b/hotspot/src/share/vm/opto/idealKit.cpp index 437fc105a37..026a22f0c7a 100644 --- a/hotspot/src/share/vm/opto/idealKit.cpp +++ b/hotspot/src/share/vm/opto/idealKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 13c3d774cff..9be6e270faa 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -113,6 +113,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe case Op_LoadN: case Op_LoadS: case Op_LoadKlass: + case Op_LoadNKlass: case Op_LoadRange: case Op_LoadD_unaligned: case Op_LoadL_unaligned: @@ -133,6 +134,7 @@ void Block::implicit_null_check(PhaseCFG *cfg, Node *proj, Node *val, int allowe if( mach->in(2) != val ) continue; break; // Found a memory op? case Op_StrComp: + case Op_AryEq: // Not a legit memory op for implicit null check regardless of // embedded loads continue; diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 2e7688ed939..52707d038b0 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -163,6 +163,7 @@ class LibraryCallKit : public GraphKit { bool inline_native_newArray(); bool inline_native_getLength(); bool inline_array_copyOf(bool is_copyOfRange); + bool inline_array_equals(); bool inline_native_clone(bool is_virtual); bool inline_native_Reflection_getCallerClass(); bool inline_native_AtomicLong_get(); @@ -259,6 +260,7 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { switch (id) { case vmIntrinsics::_indexOf: case vmIntrinsics::_compareTo: + case vmIntrinsics::_equalsC: break; // InlineNatives does not control String.compareTo default: return NULL; @@ -272,6 +274,9 @@ CallGenerator* Compile::make_vm_intrinsic(ciMethod* m, bool is_virtual) { case vmIntrinsics::_indexOf: if (!SpecialStringIndexOf) return NULL; break; + case vmIntrinsics::_equalsC: + if (!SpecialArraysEquals) return NULL; + break; case vmIntrinsics::_arraycopy: if (!InlineArrayCopy) return NULL; break; @@ -586,6 +591,8 @@ bool LibraryCallKit::try_to_inline() { return inline_array_copyOf(false); case vmIntrinsics::_copyOfRange: return inline_array_copyOf(true); + case vmIntrinsics::_equalsC: + return inline_array_equals(); case vmIntrinsics::_clone: return inline_native_clone(intrinsic()->is_virtual()); @@ -813,6 +820,24 @@ bool LibraryCallKit::inline_string_compareTo() { return true; } +//------------------------------inline_array_equals---------------------------- +bool LibraryCallKit::inline_array_equals() { + + if (!Matcher::has_match_rule(Op_AryEq)) return false; + + _sp += 2; + Node *argument2 = pop(); + Node *argument1 = pop(); + + Node* equals = + _gvn.transform(new (C, 3) AryEqNode(control(), + argument1, + argument2) + ); + push(equals); + return true; +} + // Java version of String.indexOf(constant string) // class StringDecl { // StringDecl(char[] ca) { @@ -896,7 +921,7 @@ Node* LibraryCallKit::string_indexOf(Node* string_object, ciTypeArray* target_ar Node* sourcea = basic_plus_adr(string_object, string_object, value_offset); Node* source = make_load(no_ctrl, sourcea, source_type, T_OBJECT, string_type->add_offset(value_offset)); - Node* target = _gvn.transform(ConPNode::make(C, target_array)); + Node* target = _gvn.transform( makecon(TypeOopPtr::make_from_constant(target_array)) ); jint target_length = target_array->length(); const TypeAry* target_array_type = TypeAry::make(TypeInt::CHAR, TypeInt::make(0, target_length, Type::WidenMin)); const TypeAryPtr* target_type = TypeAryPtr::make(TypePtr::BotPTR, target_array_type, target_array->klass(), true, Type::OffsetBot); @@ -2168,15 +2193,16 @@ bool LibraryCallKit::inline_unsafe_CAS(BasicType type) { // (They don't if CAS fails, but it isn't worth checking.) pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT); #ifdef _LP64 - if (adr->bottom_type()->is_narrow()) { + if (adr->bottom_type()->is_ptr_to_narrowoop()) { + Node *newval_enc = _gvn.transform(new (C, 2) EncodePNode(newval, newval->bottom_type()->make_narrowoop())); + Node *oldval_enc = _gvn.transform(new (C, 2) EncodePNode(oldval, oldval->bottom_type()->make_narrowoop())); cas = _gvn.transform(new (C, 5) CompareAndSwapNNode(control(), mem, adr, - EncodePNode::encode(&_gvn, newval), - EncodePNode::encode(&_gvn, oldval))); + newval_enc, oldval_enc)); } else #endif - { - cas = _gvn.transform(new (C, 5) CompareAndSwapPNode(control(), mem, adr, newval, oldval)); - } + { + cas = _gvn.transform(new (C, 5) CompareAndSwapPNode(control(), mem, adr, newval, oldval)); + } post_barrier(control(), cas, base, adr, alias_idx, newval, T_OBJECT, true); break; default: @@ -2454,7 +2480,7 @@ Node* LibraryCallKit::load_klass_from_mirror_common(Node* mirror, if (region == NULL) never_see_null = true; Node* p = basic_plus_adr(mirror, offset); const TypeKlassPtr* kls_type = TypeKlassPtr::OBJECT_OR_NULL; - Node* kls = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type)); + Node* kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, kls_type) ); _sp += nargs; // any deopt will start just before call to enclosing method Node* null_ctl = top(); kls = null_check_oop(kls, &null_ctl, never_see_null); @@ -2634,7 +2660,7 @@ bool LibraryCallKit::inline_native_Class_query(vmIntrinsics::ID id) { phi->add_req(makecon(TypeInstPtr::make(env()->Object_klass()->java_mirror()))); // If we fall through, it's a plain class. Get its _super. p = basic_plus_adr(kls, Klass::super_offset_in_bytes() + sizeof(oopDesc)); - kls = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL)); + kls = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeRawPtr::BOTTOM, TypeKlassPtr::OBJECT_OR_NULL) ); null_ctl = top(); kls = null_check_oop(kls, &null_ctl); if (null_ctl != top()) { @@ -2720,7 +2746,7 @@ bool LibraryCallKit::inline_native_subtype_check() { args[which_arg] = _gvn.transform(arg); Node* p = basic_plus_adr(arg, class_klass_offset); - Node* kls = new (C, 3) LoadKlassNode(0, immutable_memory(), p, adr_type, kls_type); + Node* kls = LoadKlassNode::make(_gvn, immutable_memory(), p, adr_type, kls_type); klasses[which_arg] = _gvn.transform(kls); } @@ -2838,6 +2864,8 @@ bool LibraryCallKit::inline_native_newArray() { _sp += nargs; // set original stack for use by uncommon_trap mirror = do_null_check(mirror, T_OBJECT); _sp -= nargs; + // If mirror or obj is dead, only null-path is taken. + if (stopped()) return true; enum { _normal_path = 1, _slow_path = 2, PATH_LIMIT }; RegionNode* result_reg = new(C, PATH_LIMIT) RegionNode(PATH_LIMIT); @@ -3827,24 +3855,22 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { if (!stopped()) { // Copy the fastest available way. // (No need for PreserveJVMState, since we're using it all up now.) + // TODO: generate fields/elements copies for small objects instead. Node* src = obj; Node* dest = raw_obj; - Node* end = dest; Node* size = _gvn.transform(alloc_siz); // Exclude the header. int base_off = instanceOopDesc::base_offset_in_bytes(); if (UseCompressedOops) { - // copy the header gap though. - Node* sptr = basic_plus_adr(src, base_off); - Node* dptr = basic_plus_adr(dest, base_off); - Node* sval = make_load(control(), sptr, TypeInt::INT, T_INT, raw_adr_type); - store_to_memory(control(), dptr, sval, T_INT, raw_adr_type); - base_off += sizeof(int); + assert(base_off % BytesPerLong != 0, "base with compressed oops"); + // With compressed oops base_offset_in_bytes is 12 which creates + // the gap since countx is rounded by 8 bytes below. + // Copy klass and the gap. + base_off = instanceOopDesc::klass_offset_in_bytes(); } src = basic_plus_adr(src, base_off); dest = basic_plus_adr(dest, base_off); - end = basic_plus_adr(end, size); // Compute the length also, if needed: Node* countx = size; @@ -4388,7 +4414,7 @@ LibraryCallKit::generate_arraycopy(const TypePtr* adr_type, // (At this point we can assume disjoint_bases, since types differ.) int ek_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); Node* p1 = basic_plus_adr(dest_klass, ek_offset); - Node* n1 = new (C, 3) LoadKlassNode(0, immutable_memory(), p1, TypeRawPtr::BOTTOM); + Node* n1 = LoadKlassNode::make(_gvn, immutable_memory(), p1, TypeRawPtr::BOTTOM); Node* dest_elem_klass = _gvn.transform(n1); Node* cv = generate_checkcast_arraycopy(adr_type, dest_elem_klass, diff --git a/hotspot/src/share/vm/opto/locknode.cpp b/hotspot/src/share/vm/opto/locknode.cpp index 48bf9ebfefc..5a74fd09001 100644 --- a/hotspot/src/share/vm/opto/locknode.cpp +++ b/hotspot/src/share/vm/opto/locknode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index e765a6c5d69..113de601538 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 780766fb854..dbce2580158 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -690,7 +690,7 @@ void PhaseIdealLoop::insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_ // (the main-loop trip-counter exit value) because we will be changing // the exit value (via unrolling) so we cannot constant-fold away the zero // trip guard until all unrolling is done. - Node *zer_opaq = new (C, 2) Opaque1Node(incr); + Node *zer_opaq = new (C, 2) Opaque1Node(C, incr); Node *zer_cmp = new (C, 3) CmpINode( zer_opaq, limit ); Node *zer_bol = new (C, 2) BoolNode( zer_cmp, b_test ); register_new_node( zer_opaq, new_main_exit ); @@ -760,7 +760,7 @@ void PhaseIdealLoop::insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_ // pre-loop, the main-loop may not execute at all. Later in life this // zero-trip guard will become the minimum-trip guard when we unroll // the main-loop. - Node *min_opaq = new (C, 2) Opaque1Node(limit); + Node *min_opaq = new (C, 2) Opaque1Node(C, limit); Node *min_cmp = new (C, 3) CmpINode( pre_incr, min_opaq ); Node *min_bol = new (C, 2) BoolNode( min_cmp, b_test ); register_new_node( min_opaq, new_pre_exit ); @@ -810,7 +810,7 @@ void PhaseIdealLoop::insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_ // Save the original loop limit in this Opaque1 node for // use by range check elimination. - Node *pre_opaq = new (C, 3) Opaque1Node(pre_limit, limit); + Node *pre_opaq = new (C, 3) Opaque1Node(C, pre_limit, limit); register_new_node( pre_limit, pre_head->in(0) ); register_new_node( pre_opaq , pre_head->in(0) ); diff --git a/hotspot/src/share/vm/opto/loopUnswitch.cpp b/hotspot/src/share/vm/opto/loopUnswitch.cpp index 5f384b60b43..2a385e76846 100644 --- a/hotspot/src/share/vm/opto/loopUnswitch.cpp +++ b/hotspot/src/share/vm/opto/loopUnswitch.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 @@ -205,7 +205,7 @@ ProjNode* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree *loop, Node *cont = _igvn.intcon(1); set_ctrl(cont, C->root()); - Node* opq = new (C, 2) Opaque1Node(cont); + Node* opq = new (C, 2) Opaque1Node(C, cont); register_node(opq, outer_loop, entry, dom_depth(entry)); Node *bol = new (C, 2) Conv2BNode(opq); register_node(bol, outer_loop, entry, dom_depth(entry)); diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 3ae7a41143e..c411cdc3451 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -1072,8 +1072,6 @@ bool IdealLoopTree::beautify_loops( PhaseIdealLoop *phase ) { phase->_igvn.add_users_to_worklist(l->fast_out(i)); } - phase->C->print_method("After beautify loops", 3); - // Now recursively beautify nested loops if( _child ) result |= _child->beautify_loops( phase ); if( _next ) result |= _next ->beautify_loops( phase ); @@ -1470,6 +1468,8 @@ PhaseIdealLoop::PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify } // Reset loop nesting depth _ltree_root->set_nest( 0 ); + + C->print_method("After beautify loops", 3); } } @@ -2632,6 +2632,7 @@ void PhaseIdealLoop::build_loop_late_post( Node *n, const PhaseIdealLoop *verify case Op_LoadD_unaligned: case Op_LoadL_unaligned: case Op_StrComp: // Does a bunch of load-like effects + case Op_AryEq: pinned = false; } if( pinned ) { diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index 4bee9655d9f..629b4b2e5d1 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 52dc89266ff..f7fa3f21b2c 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -41,7 +41,7 @@ Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) { const Type* type = n->bottom_type(); const TypeOopPtr *t_oop = _igvn.type(n)->isa_oopptr(); Node *phi; - if( t_oop != NULL && t_oop->is_instance_field() ) { + if( t_oop != NULL && t_oop->is_known_instance_field() ) { int iid = t_oop->instance_id(); int index = C->get_alias_index(t_oop); int offset = t_oop->offset(); @@ -464,6 +464,7 @@ Node *PhaseIdealLoop::conditional_move( Node *region ) { case T_FLOAT: case T_DOUBLE: case T_ADDRESS: // (RawPtr) + case T_NARROWOOP: cost++; break; case T_OBJECT: { // Base oops are OK, but not derived oops @@ -2684,7 +2685,7 @@ void PhaseIdealLoop::reorg_offsets( IdealLoopTree *loop ) { if( !cle->stride_is_con() ) continue; // Hit! Refactor use to use the post-incremented tripcounter. // Compute a post-increment tripcounter. - Node *opaq = new (C, 2) Opaque2Node( cle->incr() ); + Node *opaq = new (C, 2) Opaque2Node( C, cle->incr() ); register_new_node( opaq, u_ctrl ); Node *neg_stride = _igvn.intcon(-cle->stride_con()); set_ctrl(neg_stride, C->root()); diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index 70815a2804a..eadd0da5fff 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -262,17 +262,19 @@ const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_ty // Now we have collected every part of the ADLC MEMORY_INTER. // See if it adds up to a base + offset. if (index != NULL) { - if (!index->is_Con()) { - const TypeNarrowOop* narrowoop = index->bottom_type()->isa_narrowoop(); - if (narrowoop != NULL) { - // Memory references through narrow oops have a - // funny base so grab the type from the index. - adr_type = narrowoop->make_oopptr(); - return NULL; - } + const Type* t_index = index->bottom_type(); + if (t_index->isa_narrowoop()) { // EncodeN, LoadN, LoadConN, LoadNKlass. + // Memory references through narrow oops have a + // funny base so grab the type from the index: + // [R12 + narrow_oop_reg<<3 + offset] + assert(base == NULL, "Memory references through narrow oops have no base"); + offset = disp; + adr_type = t_index->make_ptr()->add_offset(offset); + return NULL; + } else if (!index->is_Con()) { disp = Type::OffsetBot; } else if (disp != Type::OffsetBot) { - const TypeX* ti = index->bottom_type()->isa_intptr_t(); + const TypeX* ti = t_index->isa_intptr_t(); if (ti == NULL) { disp = Type::OffsetBot; // a random constant?? } else { diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index d537c1d6c6e..cd38a4be324 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -320,9 +320,9 @@ Node *PhaseMacroExpand::value_from_mem_phi(Node *mem, BasicType ft, const Type * // Search the last value stored into the object's field. Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc) { - assert(adr_t->is_instance_field(), "instance required"); - uint instance_id = adr_t->instance_id(); - assert(instance_id == alloc->_idx, "wrong allocation"); + assert(adr_t->is_known_instance_field(), "instance required"); + int instance_id = adr_t->instance_id(); + assert((uint)instance_id == alloc->_idx, "wrong allocation"); int alias_idx = C->get_alias_index(adr_t); int offset = adr_t->offset(); @@ -354,7 +354,7 @@ Node *PhaseMacroExpand::value_from_mem(Node *sfpt_mem, BasicType ft, const Type const TypeOopPtr* atype = mem->as_Store()->adr_type()->isa_oopptr(); assert(atype != NULL, "address type must be oopptr"); assert(C->get_alias_index(atype) == alias_idx && - atype->is_instance_field() && atype->offset() == offset && + atype->is_known_instance_field() && atype->offset() == offset && atype->instance_id() == instance_id, "store is correct memory slice"); done = true; } else if (mem->is_Phi()) { @@ -458,7 +458,7 @@ bool PhaseMacroExpand::can_eliminate_allocation(AllocateNode *alloc, GrowableArr } } else if (use->is_SafePoint()) { SafePointNode* sfpt = use->as_SafePoint(); - if (sfpt->has_non_debug_use(res)) { + if (sfpt->is_Call() && sfpt->as_Call()->has_non_debug_use(res)) { // Object is passed as argument. DEBUG_ONLY(disq_node = use;) NOT_PRODUCT(fail_eliminate = "Object is passed as argument";) @@ -598,7 +598,7 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray as_klass()); } if (UseCompressedOops) { - field_type = field_type->is_oopptr()->make_narrowoop(); + field_type = field_type->make_narrowoop(); basic_elem_type = T_NARROWOOP; } } else { @@ -666,9 +666,11 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray isa_narrowoop()) { // Enable "DecodeN(EncodeP(Allocate)) --> Allocate" transformation // to be able scalar replace the allocation. - _igvn.set_delay_transform(false); - field_val = DecodeNNode::decode(&_igvn, field_val); - _igvn.set_delay_transform(true); + if (field_val->is_EncodeP()) { + field_val = field_val->in(1); + } else { + field_val = transform_later(new (C, 2) DecodeNNode(field_val, field_val->bottom_type()->make_ptr())); + } } sfpt->add_req(field_val); } @@ -1282,12 +1284,6 @@ PhaseMacroExpand::initialize_object(AllocateNode* alloc, } rawmem = make_store(control, rawmem, object, oopDesc::mark_offset_in_bytes(), mark_node, T_ADDRESS); - if (UseCompressedOops) { - Node *zeronode = makecon(TypeInt::ZERO); - // store uncompressed 0 into klass ptr to zero out gap. The gap is - // used for primitive fields and has to be zeroed. - rawmem = make_store(control, rawmem, object, oopDesc::klass_gap_offset_in_bytes(), zeronode, T_INT); - } rawmem = make_store(control, rawmem, object, oopDesc::klass_offset_in_bytes(), klass_node, T_OBJECT); int header_size = alloc->minimum_header_size(); // conservatively small @@ -1680,7 +1676,14 @@ bool PhaseMacroExpand::expand_macro_nodes() { success = eliminate_locking_node(n->as_AbstractLock()); break; default: - assert(false, "unknown node type in macro list"); + if (n->Opcode() == Op_Opaque1 || n->Opcode() == Op_Opaque2) { + _igvn.add_users_to_worklist(n); + _igvn.hash_delete(n); + _igvn.subsume_node(n, n->in(1)); + success = true; + } else { + assert(false, "unknown node type in macro list"); + } } assert(success == (C->macro_count() < old_macro_count), "elimination reduces macro count"); progress = progress || success; diff --git a/hotspot/src/share/vm/opto/macro.hpp b/hotspot/src/share/vm/opto/macro.hpp index 06e28119d5b..0f784aafc02 100644 --- a/hotspot/src/share/vm/opto/macro.hpp +++ b/hotspot/src/share/vm/opto/macro.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index 0374d7c7a0d..1640b28e3cc 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -51,8 +51,9 @@ Matcher::Matcher( Node_List &proj_list ) : PhaseTransform( Phase::Ins_Select ), #ifdef ASSERT _old2new_map(C->comp_arena()), + _new2old_map(C->comp_arena()), #endif - _shared_constants(C->comp_arena()), + _shared_nodes(C->comp_arena()), _reduceOp(reduceOp), _leftOp(leftOp), _rightOp(rightOp), _swallowed(swallowed), _begin_inst_chain_rule(_BEGIN_INST_CHAIN_RULE), @@ -82,6 +83,7 @@ Matcher::Matcher( Node_List &proj_list ) : idealreg2debugmask[Op_RegF] = NULL; idealreg2debugmask[Op_RegD] = NULL; idealreg2debugmask[Op_RegP] = NULL; + debug_only(_mem_node = NULL;) // Ideal memory node consumed by mach node } //------------------------------warp_incoming_stk_arg------------------------ @@ -744,6 +746,7 @@ static void match_alias_type(Compile* C, Node* n, Node* m) { if (nidx == Compile::AliasIdxBot && midx == Compile::AliasIdxTop) { switch (n->Opcode()) { case Op_StrComp: + case Op_AryEq: case Op_MemBarVolatile: case Op_MemBarCPUOrder: // %%% these ideals should have narrower adr_type? nidx = Compile::AliasIdxTop; @@ -833,10 +836,16 @@ Node *Matcher::xform( Node *n, int max_stack ) { if( n->is_Proj() && n->in(0)->is_Multi()) { // Projections? // Convert to machine-dependent projection m = n->in(0)->as_Multi()->match( n->as_Proj(), this ); +#ifdef ASSERT + _new2old_map.map(m->_idx, n); +#endif if (m->in(0) != NULL) // m might be top collect_null_checks(m); } else { // Else just a regular 'ol guy m = n->clone(); // So just clone into new-space +#ifdef ASSERT + _new2old_map.map(m->_idx, n); +#endif // Def-Use edges will be added incrementally as Uses // of this node are matched. assert(m->outcnt() == 0, "no Uses of this clone yet"); @@ -880,11 +889,14 @@ Node *Matcher::xform( Node *n, int max_stack ) { Node *m = n->in(i); // Get input int op = m->Opcode(); assert((op == Op_BoxLock) == jvms->is_monitor_use(i), "boxes only at monitor sites"); - if( op == Op_ConI || op == Op_ConP || + if( op == Op_ConI || op == Op_ConP || op == Op_ConN || op == Op_ConF || op == Op_ConD || op == Op_ConL // || op == Op_BoxLock // %%%% enable this and remove (+++) in chaitin.cpp ) { m = m->clone(); +#ifdef ASSERT + _new2old_map.map(m->_idx, n); +#endif mstack.push(m, Post_Visit, n, i); // Don't neet to visit mstack.push(m->in(0), Visit, m, 0); } else { @@ -1152,7 +1164,10 @@ MachNode *Matcher::match_tree( const Node *n ) { // StoreNodes require their Memory input to match any LoadNodes Node *mem = n->is_Store() ? n->in(MemNode::Memory) : (Node*)1 ; - +#ifdef ASSERT + Node* save_mem_node = _mem_node; + _mem_node = n->is_Store() ? (Node*)n : NULL; +#endif // State object for root node of match tree // Allocate it on _states_arena - stack allocation can cause stack overflow. State *s = new (&_states_arena) State; @@ -1185,13 +1200,14 @@ MachNode *Matcher::match_tree( const Node *n ) { MachNode *m = ReduceInst( s, s->_rule[mincost], mem ); #ifdef ASSERT _old2new_map.map(n->_idx, m); + _new2old_map.map(m->_idx, (Node*)n); #endif // Add any Matcher-ignored edges uint cnt = n->req(); uint start = 1; if( mem != (Node*)1 ) start = MemNode::Memory+1; - if( n->Opcode() == Op_AddP ) { + if( n->is_AddP() ) { assert( mem == (Node*)1, "" ); start = AddPNode::Base+1; } @@ -1204,6 +1220,7 @@ MachNode *Matcher::match_tree( const Node *n ) { } } + debug_only( _mem_node = save_mem_node; ) return m; } @@ -1219,7 +1236,7 @@ static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool s if( t->singleton() ) { // Never force constants into registers. Allow them to match as // constants or registers. Copies of the same value will share - // the same register. See find_shared_constant. + // the same register. See find_shared_node. return false; } else { // Not a constant // Stop recursion if they have different Controls. @@ -1243,12 +1260,10 @@ static bool match_into_reg( const Node *n, Node *m, Node *control, int i, bool s if( j == max_scan ) // No post-domination before scan end? return true; // Then break the match tree up } - - if (m->Opcode() == Op_DecodeN && m->outcnt() == 2) { + if (m->is_DecodeN() && Matcher::clone_shift_expressions) { // These are commonly used in address expressions and can - // efficiently fold into them in some cases but because they are - // consumed by AddP they commonly have two users. - if (m->raw_out(0) == m->raw_out(1) && m->raw_out(0)->Opcode() == Op_AddP) return false; + // efficiently fold into them on X64 in some cases. + return false; } } @@ -1368,13 +1383,16 @@ Node *Matcher::Label_Root( const Node *n, State *svec, Node *control, const Node // which reduces the number of copies of a constant in the final // program. The register allocator is free to split uses later to // split live ranges. -MachNode* Matcher::find_shared_constant(Node* leaf, uint rule) { - if (!leaf->is_Con()) return NULL; +MachNode* Matcher::find_shared_node(Node* leaf, uint rule) { + if (!leaf->is_Con() && !leaf->is_DecodeN()) return NULL; // See if this Con has already been reduced using this rule. - if (_shared_constants.Size() <= leaf->_idx) return NULL; - MachNode* last = (MachNode*)_shared_constants.at(leaf->_idx); + if (_shared_nodes.Size() <= leaf->_idx) return NULL; + MachNode* last = (MachNode*)_shared_nodes.at(leaf->_idx); if (last != NULL && rule == last->rule()) { + // Don't expect control change for DecodeN + if (leaf->is_DecodeN()) + return last; // Get the new space root. Node* xroot = new_node(C->root()); if (xroot == NULL) { @@ -1420,9 +1438,9 @@ MachNode* Matcher::find_shared_constant(Node* leaf, uint rule) { MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { assert( rule >= NUM_OPERANDS, "called with operand rule" ); - MachNode* shared_con = find_shared_constant(s->_leaf, rule); - if (shared_con != NULL) { - return shared_con; + MachNode* shared_node = find_shared_node(s->_leaf, rule); + if (shared_node != NULL) { + return shared_node; } // Build the object to represent this state & prepare for recursive calls @@ -1443,11 +1461,33 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { } // If a Memory was used, insert a Memory edge - if( mem != (Node*)1 ) + if( mem != (Node*)1 ) { mach->ins_req(MemNode::Memory,mem); +#ifdef ASSERT + // Verify adr type after matching memory operation + const MachOper* oper = mach->memory_operand(); + if (oper != NULL && oper != (MachOper*)-1 && + mach->adr_type() != TypeRawPtr::BOTTOM) { // non-direct addressing mode + // It has a unique memory operand. Find corresponding ideal mem node. + Node* m = NULL; + if (leaf->is_Mem()) { + m = leaf; + } else { + m = _mem_node; + assert(m != NULL && m->is_Mem(), "expecting memory node"); + } + if (m->adr_type() != mach->adr_type()) { + m->dump(); + tty->print_cr("mach:"); + mach->dump(1); + } + assert(m->adr_type() == mach->adr_type(), "matcher should not change adr type"); + } +#endif + } // If the _leaf is an AddP, insert the base edge - if( leaf->Opcode() == Op_AddP ) + if( leaf->is_AddP() ) mach->ins_req(AddPNode::Base,leaf->in(AddPNode::Base)); uint num_proj = _proj_list.size(); @@ -1462,6 +1502,9 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { for( uint i=0; ireq(); i++ ) { mach->set_req(i,NULL); } +#ifdef ASSERT + _new2old_map.map(ex->_idx, s->_leaf); +#endif } // PhaseChaitin::fixup_spills will sometimes generate spill code @@ -1475,9 +1518,9 @@ MachNode *Matcher::ReduceInst( State *s, int rule, Node *&mem ) { guarantee(_proj_list.size() == num_proj, "no allocation during spill generation"); } - if (leaf->is_Con()) { + if (leaf->is_Con() || leaf->is_DecodeN()) { // Record the con for sharing - _shared_constants.map(leaf->_idx, ex); + _shared_nodes.map(leaf->_idx, ex); } return ex; @@ -1508,7 +1551,9 @@ void Matcher::ReduceInst_Chain_Rule( State *s, int rule, Node *&mem, MachNode *m assert( newrule >= _LAST_MACH_OPER, "Do NOT chain from internal operand"); mach->_opnds[1] = s->MachOperGenerator( _reduceOp[catch_op], C ); Node *mem1 = (Node*)1; + debug_only(Node *save_mem_node = _mem_node;) mach->add_req( ReduceInst(s, newrule, mem1) ); + debug_only(_mem_node = save_mem_node;) } return; } @@ -1518,6 +1563,7 @@ uint Matcher::ReduceInst_Interior( State *s, int rule, Node *&mem, MachNode *mac if( s->_leaf->is_Load() ) { Node *mem2 = s->_leaf->in(MemNode::Memory); assert( mem == (Node*)1 || mem == mem2, "multiple Memories being matched at once?" ); + debug_only( if( mem == (Node*)1 ) _mem_node = s->_leaf;) mem = mem2; } if( s->_leaf->in(0) != NULL && s->_leaf->req() > 1) { @@ -1561,7 +1607,9 @@ uint Matcher::ReduceInst_Interior( State *s, int rule, Node *&mem, MachNode *mac // --> ReduceInst( newrule ) mach->_opnds[num_opnds++] = s->MachOperGenerator( _reduceOp[catch_op], C ); Node *mem1 = (Node*)1; + debug_only(Node *save_mem_node = _mem_node;) mach->add_req( ReduceInst( newstate, newrule, mem1 ) ); + debug_only(_mem_node = save_mem_node;) } } assert( mach->_opnds[num_opnds-1], "" ); @@ -1592,6 +1640,7 @@ void Matcher::ReduceOper( State *s, int rule, Node *&mem, MachNode *mach ) { if( s->_leaf->is_Load() ) { assert( mem == (Node*)1, "multiple Memories being matched at once?" ); mem = s->_leaf->in(MemNode::Memory); + debug_only(_mem_node = s->_leaf;) } if( s->_leaf->in(0) && s->_leaf->req() > 1) { if( !mach->in(0) ) @@ -1616,7 +1665,9 @@ void Matcher::ReduceOper( State *s, int rule, Node *&mem, MachNode *mach ) { // Reduce the instruction, and add a direct pointer from this // machine instruction to the newly reduced one. Node *mem1 = (Node*)1; + debug_only(Node *save_mem_node = _mem_node;) mach->add_req( ReduceInst( kid, newrule, mem1 ) ); + debug_only(_mem_node = save_mem_node;) } } } @@ -1716,6 +1767,7 @@ void Matcher::find_shared( Node *n ) { mstack.push(n->in(0), Pre_Visit); // Visit Control input continue; // while (mstack.is_nonempty()) case Op_StrComp: + case Op_AryEq: set_shared(n); // Force result into register (it will be anyways) break; case Op_ConP: { // Convert pointers above the centerline to NUL @@ -1726,6 +1778,14 @@ void Matcher::find_shared( Node *n ) { } break; } + case Op_ConN: { // Convert narrow pointers above the centerline to NUL + TypeNode *tn = n->as_Type(); // Constants derive from type nodes + const TypePtr* tp = tn->type()->make_ptr(); + if (tp && tp->_ptr == TypePtr::AnyNull) { + tn->set_type(TypeNarrowOop::NULL_PTR); + } + break; + } case Op_Binary: // These are introduced in the Post_Visit state. ShouldNotReachHere(); break; @@ -1760,6 +1820,7 @@ void Matcher::find_shared( Node *n ) { case Op_LoadF: case Op_LoadI: case Op_LoadKlass: + case Op_LoadNKlass: case Op_LoadL: case Op_LoadS: case Op_LoadP: @@ -1817,7 +1878,7 @@ void Matcher::find_shared( Node *n ) { Node *adr = m->in(AddPNode::Address); // Intel, ARM and friends can handle 2 adds in addressing mode - if( clone_shift_expressions && adr->Opcode() == Op_AddP && + if( clone_shift_expressions && adr->is_AddP() && // AtomicAdd is not an addressing expression. // Cheap to find it by looking for screwy base. !adr->in(AddPNode::Base)->is_top() ) { @@ -1891,6 +1952,7 @@ void Matcher::find_shared( Node *n ) { case Op_CMoveF: case Op_CMoveI: case Op_CMoveL: + case Op_CMoveN: case Op_CMoveP: { // Restructure into a binary tree for Matching. It's possible that // we could move this code up next to the graph reshaping for IfNodes diff --git a/hotspot/src/share/vm/opto/matcher.hpp b/hotspot/src/share/vm/opto/matcher.hpp index a33c4e92da2..20de817c8b8 100644 --- a/hotspot/src/share/vm/opto/matcher.hpp +++ b/hotspot/src/share/vm/opto/matcher.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -48,7 +48,7 @@ class Matcher : public PhaseTransform { void ReduceOper( State *s, int newrule, Node *&mem, MachNode *mach ); // If this node already matched using "rule", return the MachNode for it. - MachNode* find_shared_constant(Node* con, uint rule); + MachNode* find_shared_node(Node* n, uint rule); // Convert a dense opcode number to an expanded rule number const int *_reduceOp; @@ -81,9 +81,10 @@ class Matcher : public PhaseTransform { Node_List &_proj_list; // For Machine nodes killing many values - Node_Array _shared_constants; + Node_Array _shared_nodes; debug_only(Node_Array _old2new_map;) // Map roots of ideal-trees to machine-roots + debug_only(Node_Array _new2old_map;) // Maps machine nodes back to ideal // Accessors for the inherited field PhaseTransform::_nodes: void grow_new_node_array(uint idx_limit) { @@ -104,6 +105,8 @@ class Matcher : public PhaseTransform { #ifdef ASSERT // Make sure only new nodes are reachable from this node void verify_new_nodes_only(Node* root); + + Node* _mem_node; // Ideal memory node consumed by mach node #endif public: @@ -388,5 +391,9 @@ public: #ifdef ASSERT void dump_old2new_map(); // machine-independent to machine-dependent + + Node* find_old_node(Node* new_node) { + return _new2old_map[new_node->_idx]; + } #endif }; diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index b28c37b7821..5015d99c483 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -91,7 +91,7 @@ extern void print_alias_types(); Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) { const TypeOopPtr *tinst = t_adr->isa_oopptr(); - if (tinst == NULL || !tinst->is_instance_field()) + if (tinst == NULL || !tinst->is_known_instance_field()) return mchain; // don't try to optimize non-instance types uint instance_id = tinst->instance_id(); Node *prev = NULL; @@ -125,7 +125,7 @@ Node *MemNode::optimize_simple_memory_chain(Node *mchain, const TypePtr *t_adr, Node *MemNode::optimize_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGVN *phase) { const TypeOopPtr *t_oop = t_adr->isa_oopptr(); - bool is_instance = (t_oop != NULL) && t_oop->is_instance_field(); + bool is_instance = (t_oop != NULL) && t_oop->is_known_instance_field(); PhaseIterGVN *igvn = phase->is_IterGVN(); Node *result = mchain; result = optimize_simple_memory_chain(result, t_adr, phase); @@ -133,7 +133,9 @@ Node *MemNode::optimize_memory_chain(Node *mchain, const TypePtr *t_adr, PhaseGV PhiNode *mphi = result->as_Phi(); assert(mphi->bottom_type() == Type::MEMORY, "memory phi required"); const TypePtr *t = mphi->adr_type(); - if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM) { + if (t == TypePtr::BOTTOM || t == TypeRawPtr::BOTTOM || + t->isa_oopptr() && !t->is_oopptr()->is_known_instance() && + t->is_oopptr()->cast_to_instance_id(t_oop->instance_id()) == t_oop) { // clone the Phi with our address type result = mphi->split_out_instance(t_adr, igvn); } else { @@ -154,7 +156,7 @@ static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem, const T phase->C->must_alias(adr_check, alias_idx ); // Sometimes dead array references collapse to a[-1], a[-2], or a[-3] if( !consistent && adr_check != NULL && !adr_check->empty() && - tp->isa_aryptr() && tp->offset() == Type::OffsetBot && + tp->isa_aryptr() && tp->offset() == Type::OffsetBot && adr_check->isa_aryptr() && adr_check->offset() != Type::OffsetBot && ( adr_check->offset() == arrayOopDesc::length_offset_in_bytes() || adr_check->offset() == oopDesc::klass_offset_in_bytes() || @@ -251,21 +253,31 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) { if (dom == NULL || dom->is_top() || sub == NULL || sub->is_top()) return false; // Conservative answer for dead code - // Check 'dom'. + // Check 'dom'. Skip Proj and CatchProj nodes. dom = dom->find_exact_control(dom); if (dom == NULL || dom->is_top()) return false; // Conservative answer for dead code - if (dom->is_Start() || dom->is_Root() || dom == sub) + if (dom == sub) { + // For the case when, for example, 'sub' is Initialize and the original + // 'dom' is Proj node of the 'sub'. + return false; + } + + if (dom->is_Con() || dom->is_Start() || dom->is_Root() || dom == sub) return true; // 'dom' dominates 'sub' if its control edge and control edges // of all its inputs dominate or equal to sub's control edge. // Currently 'sub' is either Allocate, Initialize or Start nodes. - assert(sub->is_Allocate() || sub->is_Initialize() || sub->is_Start(), "expecting only these nodes"); + // Or Region for the check in LoadNode::Ideal(); + // 'sub' should have sub->in(0) != NULL. + assert(sub->is_Allocate() || sub->is_Initialize() || sub->is_Start() || + sub->is_Region(), "expecting only these nodes"); // Get control edge of 'sub'. + Node* orig_sub = sub; sub = sub->find_exact_control(sub->in(0)); if (sub == NULL || sub->is_top()) return false; // Conservative answer for dead code @@ -291,14 +303,16 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) { for (uint next = 0; next < dom_list.size(); next++) { Node* n = dom_list.at(next); + if (n == orig_sub) + return false; // One of dom's inputs dominated by sub. if (!n->is_CFG() && n->pinned()) { // Check only own control edge for pinned non-control nodes. n = n->find_exact_control(n->in(0)); if (n == NULL || n->is_top()) return false; // Conservative answer for dead code assert(n->is_CFG(), "expecting control"); - } - if (n->is_Start() || n->is_Root()) { + dom_list.push(n); + } else if (n->is_Con() || n->is_Start() || n->is_Root()) { only_dominating_controls = true; } else if (n->is_CFG()) { if (n->dominates(sub, nlist)) @@ -308,12 +322,11 @@ bool MemNode::all_controls_dominate(Node* dom, Node* sub) { } else { // First, own control edge. Node* m = n->find_exact_control(n->in(0)); - if (m == NULL) - continue; - if (m->is_top()) - return false; // Conservative answer for dead code - dom_list.push(m); - + if (m != NULL) { + if (m->is_top()) + return false; // Conservative answer for dead code + dom_list.push(m); + } // Now, the rest of edges. uint cnt = n->req(); for (uint i = 1; i < cnt; i++) { @@ -457,7 +470,7 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) { return mem; // let caller handle steps (c), (d) } - } else if (addr_t != NULL && addr_t->is_instance_field()) { + } else if (addr_t != NULL && addr_t->is_known_instance_field()) { // Can't use optimize_simple_memory_chain() since it needs PhaseGVN. if (mem->is_Proj() && mem->in(0)->is_Call()) { CallNode *call = mem->in(0)->as_Call(); @@ -577,6 +590,9 @@ bool MemNode::adr_phi_is_loop_invariant(Node* adr_phi, Node* cast) { // Find any cast-away of null-ness and keep its control. Null cast-aways are // going away in this pass and we need to make this memory op depend on the // gating null check. +Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { + return Ideal_common_DU_postCCP(ccp, this, in(MemNode::Address)); +} // I tried to leave the CastPP's in. This makes the graph more accurate in // some sense; we get to keep around the knowledge that an oop is not-null @@ -586,15 +602,14 @@ bool MemNode::adr_phi_is_loop_invariant(Node* adr_phi, Node* cast) { // some of the more trivial cases in the optimizer. Removing more useless // Phi's started allowing Loads to illegally float above null checks. I gave // up on this approach. CNC 10/20/2000 -Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { - Node *ctr = in(MemNode::Control); - Node *mem = in(MemNode::Memory); - Node *adr = in(MemNode::Address); +// This static method may be called not from MemNode (EncodePNode calls it). +// Only the control edge of the node 'n' might be updated. +Node *MemNode::Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr ) { Node *skipped_cast = NULL; // Need a null check? Regular static accesses do not because they are // from constant addresses. Array ops are gated by the range check (which // always includes a NULL check). Just check field ops. - if( !ctr ) { + if( n->in(MemNode::Control) == NULL ) { // Scan upwards for the highest location we can place this memory op. while( true ) { switch( adr->Opcode() ) { @@ -619,10 +634,10 @@ Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { } // CastPP is going away in this pass! We need this memory op to be // control-dependent on the test that is guarding the CastPP. - ccp->hash_delete(this); - set_req(MemNode::Control, adr->in(0)); - ccp->hash_insert(this); - return this; + ccp->hash_delete(n); + n->set_req(MemNode::Control, adr->in(0)); + ccp->hash_insert(n); + return n; case Op_Phi: // Attempt to float above a Phi to some dominating point. @@ -653,10 +668,10 @@ Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { adr = adr->in(1); continue; } - ccp->hash_delete(this); - set_req(MemNode::Control, adr->in(0)); - ccp->hash_insert(this); - return this; + ccp->hash_delete(n); + n->set_req(MemNode::Control, adr->in(0)); + ccp->hash_insert(n); + return n; // List of "safe" opcodes; those that implicitly block the memory // op below any null check. @@ -665,10 +680,13 @@ Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { case Op_LoadP: // Loading from within a klass case Op_LoadN: // Loading from within a klass case Op_LoadKlass: // Loading from within a klass + case Op_LoadNKlass: // Loading from within a klass case Op_ConP: // Loading from a klass + case Op_ConN: // Loading from a klass case Op_CreateEx: // Sucking up the guts of an exception oop case Op_Con: // Reading from TLS case Op_CMoveP: // CMoveP is pinned + case Op_CMoveN: // CMoveN is pinned break; // No progress case Op_Proj: // Direct call to an allocation routine @@ -677,8 +695,8 @@ Node *MemNode::Ideal_DU_postCCP( PhaseCCP *ccp ) { { assert(adr->as_Proj()->_con == TypeFunc::Parms, "must be return value"); const Node* call = adr->in(0); - if (call->is_CallStaticJava()) { - const CallStaticJavaNode* call_java = call->as_CallStaticJava(); + if (call->is_CallJava()) { + const CallJavaNode* call_java = call->as_CallJava(); const TypeTuple *r = call_java->tf()->range(); assert(r->cnt() > TypeFunc::Parms, "must return value"); const Type* ret_type = r->field_at(TypeFunc::Parms); @@ -750,22 +768,15 @@ Node *LoadNode::make( PhaseGVN& gvn, Node *ctl, Node *mem, Node *adr, const Type case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr() ); case T_OBJECT: #ifdef _LP64 - if (adr->bottom_type()->is_narrow()) { - const TypeNarrowOop* narrowtype; - if (rt->isa_narrowoop()) { - narrowtype = rt->is_narrowoop(); - } else { - narrowtype = rt->is_oopptr()->make_narrowoop(); - } - Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, narrowtype)); - - return DecodeNNode::decode(&gvn, load); + if (adr->bottom_type()->is_ptr_to_narrowoop()) { + Node* load = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop())); + return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr()); } else #endif - { - assert(!adr->bottom_type()->is_narrow(), "should have got back a narrow oop"); - return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); - } + { + assert(!adr->bottom_type()->is_ptr_to_narrowoop(), "should have got back a narrow oop"); + return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_oopptr()); + } } ShouldNotReachHere(); return (LoadNode*)NULL; @@ -905,7 +916,7 @@ bool LoadNode::is_instance_field_load_with_local_phi(Node* ctrl) { in(MemNode::Address)->is_AddP() ) { const TypeOopPtr* t_oop = in(MemNode::Address)->bottom_type()->isa_oopptr(); // Only instances. - if( t_oop != NULL && t_oop->is_instance_field() && + if( t_oop != NULL && t_oop->is_known_instance_field() && t_oop->offset() != Type::OffsetBot && t_oop->offset() != Type::OffsetTop) { return true; @@ -1119,6 +1130,127 @@ Node* LoadNode::eliminate_autobox(PhaseGVN* phase) { return NULL; } +//------------------------------split_through_phi------------------------------ +// Split instance field load through Phi. +Node *LoadNode::split_through_phi(PhaseGVN *phase) { + Node* mem = in(MemNode::Memory); + Node* address = in(MemNode::Address); + const TypePtr *addr_t = phase->type(address)->isa_ptr(); + const TypeOopPtr *t_oop = addr_t->isa_oopptr(); + + assert(mem->is_Phi() && (t_oop != NULL) && + t_oop->is_known_instance_field(), "invalide conditions"); + + Node *region = mem->in(0); + if (region == NULL) { + return NULL; // Wait stable graph + } + uint cnt = mem->req(); + for( uint i = 1; i < cnt; i++ ) { + Node *in = mem->in(i); + if( in == NULL ) { + return NULL; // Wait stable graph + } + } + // Check for loop invariant. + if (cnt == 3) { + for( uint i = 1; i < cnt; i++ ) { + Node *in = mem->in(i); + Node* m = MemNode::optimize_memory_chain(in, addr_t, phase); + if (m == mem) { + set_req(MemNode::Memory, mem->in(cnt - i)); // Skip this phi. + return this; + } + } + } + // Split through Phi (see original code in loopopts.cpp). + assert(phase->C->have_alias_type(addr_t), "instance should have alias type"); + + // Do nothing here if Identity will find a value + // (to avoid infinite chain of value phis generation). + if ( !phase->eqv(this, this->Identity(phase)) ) + return NULL; + + // Skip the split if the region dominates some control edge of the address. + if (cnt == 3 && !MemNode::all_controls_dominate(address, region)) + return NULL; + + const Type* this_type = this->bottom_type(); + int this_index = phase->C->get_alias_index(addr_t); + int this_offset = addr_t->offset(); + int this_iid = addr_t->is_oopptr()->instance_id(); + int wins = 0; + PhaseIterGVN *igvn = phase->is_IterGVN(); + Node *phi = new (igvn->C, region->req()) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset); + for( uint i = 1; i < region->req(); i++ ) { + Node *x; + Node* the_clone = NULL; + if( region->in(i) == phase->C->top() ) { + x = phase->C->top(); // Dead path? Use a dead data op + } else { + x = this->clone(); // Else clone up the data op + the_clone = x; // Remember for possible deletion. + // Alter data node to use pre-phi inputs + if( this->in(0) == region ) { + x->set_req( 0, region->in(i) ); + } else { + x->set_req( 0, NULL ); + } + for( uint j = 1; j < this->req(); j++ ) { + Node *in = this->in(j); + if( in->is_Phi() && in->in(0) == region ) + x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone + } + } + // Check for a 'win' on some paths + const Type *t = x->Value(igvn); + + bool singleton = t->singleton(); + + // See comments in PhaseIdealLoop::split_thru_phi(). + if( singleton && t == Type::TOP ) { + singleton &= region->is_Loop() && (i != LoopNode::EntryControl); + } + + if( singleton ) { + wins++; + x = igvn->makecon(t); + } else { + // We now call Identity to try to simplify the cloned node. + // Note that some Identity methods call phase->type(this). + // Make sure that the type array is big enough for + // our new node, even though we may throw the node away. + // (This tweaking with igvn only works because x is a new node.) + igvn->set_type(x, t); + Node *y = x->Identity(igvn); + if( y != x ) { + wins++; + x = y; + } else { + y = igvn->hash_find(x); + if( y ) { + wins++; + x = y; + } else { + // Else x is a new node we are keeping + // We do not need register_new_node_with_optimizer + // because set_type has already been called. + igvn->_worklist.push(x); + } + } + } + if (x != the_clone && the_clone != NULL) + igvn->remove_dead_node(the_clone); + phi->set_req(i, x); + } + if( wins > 0 ) { + // Record Phi + igvn->register_new_node_with_optimizer(phi); + return phi; + } + igvn->remove_dead_node(phi); + return NULL; +} //------------------------------Ideal------------------------------------------ // If the load is from Field memory and the pointer is non-null, we can @@ -1175,113 +1307,10 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) { } const TypeOopPtr *t_oop = addr_t->isa_oopptr(); if (can_reshape && opt_mem->is_Phi() && - (t_oop != NULL) && t_oop->is_instance_field()) { - assert(t_oop->offset() != Type::OffsetBot && t_oop->offset() != Type::OffsetTop, ""); - Node *region = opt_mem->in(0); - uint cnt = opt_mem->req(); - for( uint i = 1; i < cnt; i++ ) { - Node *in = opt_mem->in(i); - if( in == NULL ) { - region = NULL; // Wait stable graph - break; - } - } - if (region != NULL) { - // Check for loop invariant. - if (cnt == 3) { - for( uint i = 1; i < cnt; i++ ) { - Node *in = opt_mem->in(i); - Node* m = MemNode::optimize_memory_chain(in, addr_t, phase); - if (m == opt_mem) { - set_req(MemNode::Memory, opt_mem->in(cnt - i)); // Skip this phi. - return this; - } - } - } - // Split through Phi (see original code in loopopts.cpp). - assert(phase->C->have_alias_type(addr_t), "instance should have alias type"); - - // Do nothing here if Identity will find a value - // (to avoid infinite chain of value phis generation). - if ( !phase->eqv(this, this->Identity(phase)) ) - return NULL; - - const Type* this_type = this->bottom_type(); - int this_index = phase->C->get_alias_index(addr_t); - int this_offset = addr_t->offset(); - int this_iid = addr_t->is_oopptr()->instance_id(); - int wins = 0; - PhaseIterGVN *igvn = phase->is_IterGVN(); - Node *phi = new (igvn->C, region->req()) PhiNode(region, this_type, NULL, this_iid, this_index, this_offset); - for( uint i = 1; i < region->req(); i++ ) { - Node *x; - Node* the_clone = NULL; - if( region->in(i) == phase->C->top() ) { - x = phase->C->top(); // Dead path? Use a dead data op - } else { - x = this->clone(); // Else clone up the data op - the_clone = x; // Remember for possible deletion. - // Alter data node to use pre-phi inputs - if( this->in(0) == region ) { - x->set_req( 0, region->in(i) ); - } else { - x->set_req( 0, NULL ); - } - for( uint j = 1; j < this->req(); j++ ) { - Node *in = this->in(j); - if( in->is_Phi() && in->in(0) == region ) - x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone - } - } - // Check for a 'win' on some paths - const Type *t = x->Value(igvn); - - bool singleton = t->singleton(); - - // See comments in PhaseIdealLoop::split_thru_phi(). - if( singleton && t == Type::TOP ) { - singleton &= region->is_Loop() && (i != LoopNode::EntryControl); - } - - if( singleton ) { - wins++; - x = igvn->makecon(t); - } else { - // We now call Identity to try to simplify the cloned node. - // Note that some Identity methods call phase->type(this). - // Make sure that the type array is big enough for - // our new node, even though we may throw the node away. - // (This tweaking with igvn only works because x is a new node.) - igvn->set_type(x, t); - Node *y = x->Identity(igvn); - if( y != x ) { - wins++; - x = y; - } else { - y = igvn->hash_find(x); - if( y ) { - wins++; - x = y; - } else { - // Else x is a new node we are keeping - // We do not need register_new_node_with_optimizer - // because set_type has already been called. - igvn->_worklist.push(x); - } - } - } - if (x != the_clone && the_clone != NULL) - igvn->remove_dead_node(the_clone); - phi->set_req(i, x); - } - if( wins > 0 ) { - // Record Phi - igvn->register_new_node_with_optimizer(phi); - return phi; - } else { - igvn->remove_dead_node(phi); - } - } + (t_oop != NULL) && t_oop->is_known_instance_field()) { + // Split instance field load through Phi. + Node* result = split_through_phi(phase); + if (result != NULL) return result; } } @@ -1513,7 +1542,7 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const { } const TypeOopPtr *tinst = tp->isa_oopptr(); - if (tinst != NULL && tinst->is_instance_field()) { + if (tinst != NULL && tinst->is_known_instance_field()) { // If we have an instance type and our memory input is the // programs's initial memory state, there is no matching store, // so just return a zero of the appropriate type @@ -1585,8 +1614,30 @@ Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //============================================================================= +//----------------------------LoadKlassNode::make------------------------------ +// Polymorphic factory method: +Node *LoadKlassNode::make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at, const TypeKlassPtr *tk ) { + Compile* C = gvn.C; + Node *ctl = NULL; + // sanity check the alias category against the created node type + const TypeOopPtr *adr_type = adr->bottom_type()->isa_oopptr(); + assert(adr_type != NULL, "expecting TypeOopPtr"); +#ifdef _LP64 + if (adr_type->is_ptr_to_narrowoop()) { + Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop())); + return new (C, 2) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr()); + } +#endif + assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop"); + return new (C, 3) LoadKlassNode(ctl, mem, adr, at, tk); +} + //------------------------------Value------------------------------------------ const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { + return klass_value_common(phase); +} + +const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if (t1 == Type::TOP) return Type::TOP; @@ -1718,6 +1769,10 @@ const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { // To clean up reflective code, simplify k.java_mirror.as_klass to plain k. // Also feed through the klass in Allocate(...klass...)._klass. Node* LoadKlassNode::Identity( PhaseTransform *phase ) { + return klass_identity_common(phase); +} + +Node* LoadNode::klass_identity_common(PhaseTransform *phase ) { Node* x = LoadNode::Identity(phase); if (x != this) return x; @@ -1776,6 +1831,29 @@ Node* LoadKlassNode::Identity( PhaseTransform *phase ) { return this; } + +//------------------------------Value------------------------------------------ +const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { + const Type *t = klass_value_common(phase); + if (t == Type::TOP) + return t; + + return t->make_narrowoop(); +} + +//------------------------------Identity--------------------------------------- +// To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. +// Also feed through the klass in Allocate(...klass...)._klass. +Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { + Node *x = klass_identity_common(phase); + + const Type *t = phase->type( x ); + if( t == Type::TOP ) return x; + if( t->isa_narrowoop()) return x; + + return phase->transform(new (phase->C, 2) EncodePNode(x, t->make_narrowoop())); +} + //------------------------------Value----------------------------------------- const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { // Either input is TOP ==> the result is TOP @@ -1836,17 +1914,16 @@ StoreNode* StoreNode::make( PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, cons case T_ADDRESS: case T_OBJECT: #ifdef _LP64 - if (adr->bottom_type()->is_narrow() || + if (adr->bottom_type()->is_ptr_to_narrowoop() || (UseCompressedOops && val->bottom_type()->isa_klassptr() && adr->bottom_type()->isa_rawptr())) { - const TypePtr* type = val->bottom_type()->is_ptr(); - Node* cp = EncodePNode::encode(&gvn, val); - return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, cp); + val = gvn.transform(new (C, 2) EncodePNode(val, val->bottom_type()->make_narrowoop())); + return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, val); } else #endif - { - return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val); - } + { + return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val); + } } ShouldNotReachHere(); return (StoreNode*)NULL; @@ -2060,7 +2137,7 @@ bool StoreNode::value_never_loaded( PhaseTransform *phase) const { const TypeOopPtr *adr_oop = phase->type(adr)->isa_oopptr(); if (adr_oop == NULL) return false; - if (!adr_oop->is_instance_field()) + if (!adr_oop->is_known_instance_field()) return false; // if not a distinct instance, there may be aliases of the address for (DUIterator_Fast imax, i = adr->fast_outs(imax); i < imax; i++) { Node *use = adr->fast_out(i); @@ -2312,6 +2389,13 @@ Node *StrCompNode::Ideal(PhaseGVN *phase, bool can_reshape){ return remove_dead_region(phase, can_reshape) ? this : NULL; } +//------------------------------Ideal------------------------------------------ +// Return a node which is more "ideal" than the current node. Strip out +// control copies +Node *AryEqNode::Ideal(PhaseGVN *phase, bool can_reshape){ + return remove_dead_region(phase, can_reshape) ? this : NULL; +} + //============================================================================= MemBarNode::MemBarNode(Compile* C, int alias_idx, Node* precedent) diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index 0cc63b8efe6..891b9f64a87 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -72,7 +72,8 @@ public: // This one should probably be a phase-specific function: static bool all_controls_dominate(Node* dom, Node* sub); - // Is this Node a MemNode or some descendent? Default is YES. + // Find any cast-away of null-ness and keep its control. + static Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr ); virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp ); virtual const class TypePtr *adr_type() const; // returns bottom_type of address @@ -150,6 +151,9 @@ public: // zero out the control input. virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + // Split instance field load through Phi. + Node* split_through_phi(PhaseGVN *phase); + // Recover original value from boxed values Node *eliminate_autobox(PhaseGVN *phase); @@ -157,6 +161,10 @@ public: // then call the virtual add() to set the type. virtual const Type *Value( PhaseTransform *phase ) const; + // Common methods for LoadKlass and LoadNKlass nodes. + const Type *klass_value_common( PhaseTransform *phase ) const; + Node *klass_identity_common( PhaseTransform *phase ); + virtual uint ideal_reg() const; virtual const Type *bottom_type() const; // Following method is copied from TypeNode: @@ -358,14 +366,35 @@ public: // Load a Klass from an object class LoadKlassNode : public LoadPNode { public: - LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk = TypeKlassPtr::OBJECT ) + LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk ) : LoadPNode(c,mem,adr,at,tk) {} virtual int Opcode() const; virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual bool depends_only_on_test() const { return true; } + + // Polymorphic factory method: + static Node* make( PhaseGVN& gvn, Node *mem, Node *adr, const TypePtr* at, + const TypeKlassPtr *tk = TypeKlassPtr::OBJECT ); }; +//------------------------------LoadNKlassNode--------------------------------- +// Load a narrow Klass from an object. +class LoadNKlassNode : public LoadNNode { +public: + LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowOop *tk ) + : LoadNNode(c,mem,adr,at,tk) {} + virtual int Opcode() const; + virtual uint ideal_reg() const { return Op_RegN; } + virtual int store_Opcode() const { return Op_StoreN; } + virtual BasicType memory_type() const { return T_NARROWOOP; } + + virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node *Identity( PhaseTransform *phase ); + virtual bool depends_only_on_test() const { return true; } +}; + + //------------------------------LoadSNode-------------------------------------- // Load a short (16bits signed) from memory class LoadSNode : public LoadNode { @@ -696,6 +725,18 @@ public: virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; +//------------------------------AryEq--------------------------------------- +class AryEqNode: public Node { +public: + AryEqNode(Node *control, Node* s1, Node* s2): Node(control, s1, s2) {}; + virtual int Opcode() const; + virtual bool depends_only_on_test() const { return false; } + virtual const Type* bottom_type() const { return TypeInt::BOOL; } + virtual const TypePtr* adr_type() const { return TypeAryPtr::CHARS; } + virtual uint ideal_reg() const { return Op_RegI; } + virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); +}; + //------------------------------MemBar----------------------------------------- // There are different flavors of Memory Barriers to match the Java Memory // Model. Monitor-enter and volatile-load act as Aquires: no following ref diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index feab38ce64c..22ea890c95a 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/mulnode.hpp b/hotspot/src/share/vm/opto/mulnode.hpp index decaf5aa89c..f668946742f 100644 --- a/hotspot/src/share/vm/opto/mulnode.hpp +++ b/hotspot/src/share/vm/opto/mulnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index 8c17f9d45f6..490ea03c7f0 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index d3c2c65f8f3..df3e56c2dc7 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1039,76 +1039,125 @@ Node* Node::find_exact_control(Node* ctrl) { //--------------------------dominates------------------------------------------ // Helper function for MemNode::all_controls_dominate(). // Check if 'this' control node dominates or equal to 'sub' control node. +// We already know that if any path back to Root or Start reaches 'this', +// then all paths so, so this is a simple search for one example, +// not an exhaustive search for a counterexample. bool Node::dominates(Node* sub, Node_List &nlist) { assert(this->is_CFG(), "expecting control"); assert(sub != NULL && sub->is_CFG(), "expecting control"); + // detect dead cycle without regions + int iterations_without_region_limit = DominatorSearchLimit; + Node* orig_sub = sub; + Node* dom = this; + bool met_dom = false; nlist.clear(); - bool this_dominates = false; - uint region_input = 0; - while (sub != NULL) { // walk 'sub' up the chain to 'this' - if (sub == this) { + + // Walk 'sub' backward up the chain to 'dom', watching for regions. + // After seeing 'dom', continue up to Root or Start. + // If we hit a region (backward split point), it may be a loop head. + // Keep going through one of the region's inputs. If we reach the + // same region again, go through a different input. Eventually we + // will either exit through the loop head, or give up. + // (If we get confused, break out and return a conservative 'false'.) + while (sub != NULL) { + if (sub->is_top()) break; // Conservative answer for dead code. + if (sub == dom) { if (nlist.size() == 0) { // No Region nodes except loops were visited before and the EntryControl // path was taken for loops: it did not walk in a cycle. return true; - } else if (!this_dominates) { + } else if (met_dom) { + break; // already met before: walk in a cycle + } else { // Region nodes were visited. Continue walk up to Start or Root // to make sure that it did not walk in a cycle. - this_dominates = true; // first time meet - } else { - return false; // already met before: walk in a cycle - } + met_dom = true; // first time meet + iterations_without_region_limit = DominatorSearchLimit; // Reset + } } - if (sub->is_Start() || sub->is_Root()) - return this_dominates; - - Node* up = sub->find_exact_control(sub->in(0)); - if (up == NULL || up->is_top()) - return false; // Conservative answer for dead code - + if (sub->is_Start() || sub->is_Root()) { + // Success if we met 'dom' along a path to Start or Root. + // We assume there are no alternative paths that avoid 'dom'. + // (This assumption is up to the caller to ensure!) + return met_dom; + } + Node* up = sub->in(0); + // Normalize simple pass-through regions and projections: + up = sub->find_exact_control(up); + // If sub == up, we found a self-loop. Try to push past it. if (sub == up && sub->is_Loop()) { - up = sub->in(0); // in(LoopNode::EntryControl); + // Take loop entry path on the way up to 'dom'. + up = sub->in(1); // in(LoopNode::EntryControl); + } else if (sub == up && sub->is_Region() && sub->req() != 3) { + // Always take in(1) path on the way up to 'dom' for clone regions + // (with only one input) or regions which merge > 2 paths + // (usually used to merge fast/slow paths). + up = sub->in(1); } else if (sub == up && sub->is_Region()) { - uint i = 1; - if (nlist.size() == 0) { - // No Region nodes (except Loops) were visited before. - // Take first valid path on the way up to 'this'. - } else if (nlist.at(nlist.size() - 1) == sub) { - // This Region node was just visited. Take other path. - i = region_input + 1; - nlist.pop(); - } else { - // Was this Region node visited before? - uint size = nlist.size(); - for (uint j = 0; j < size; j++) { - if (nlist.at(j) == sub) { - return false; // The Region node was visited before. Give up. + // Try both paths for Regions with 2 input paths (it may be a loop head). + // It could give conservative 'false' answer without information + // which region's input is the entry path. + iterations_without_region_limit = DominatorSearchLimit; // Reset + + bool region_was_visited_before = false; + // Was this Region node visited before? + // If so, we have reached it because we accidentally took a + // loop-back edge from 'sub' back into the body of the loop, + // and worked our way up again to the loop header 'sub'. + // So, take the first unexplored path on the way up to 'dom'. + for (int j = nlist.size() - 1; j >= 0; j--) { + intptr_t ni = (intptr_t)nlist.at(j); + Node* visited = (Node*)(ni & ~1); + bool visited_twice_already = ((ni & 1) != 0); + if (visited == sub) { + if (visited_twice_already) { + // Visited 2 paths, but still stuck in loop body. Give up. + return false; } - } - // The Region node was not visited before. - // Take first valid path on the way up to 'this'. - } - for (; i < sub->req(); i++) { - Node* in = sub->in(i); - if (in != NULL && !in->is_top() && in != sub) { + // The Region node was visited before only once. + // (We will repush with the low bit set, below.) + nlist.remove(j); + // We will find a new edge and re-insert. + region_was_visited_before = true; break; } } - if (i < sub->req()) { - nlist.push(sub); - up = sub->in(i); - region_input = i; - } - } - if (sub == up) - return false; // some kind of tight cycle - if (orig_sub == up) - return false; // walk in a cycle + // Find an incoming edge which has not been seen yet; walk through it. + assert(up == sub, ""); + uint skip = region_was_visited_before ? 1 : 0; + for (uint i = 1; i < sub->req(); i++) { + Node* in = sub->in(i); + if (in != NULL && !in->is_top() && in != sub) { + if (skip == 0) { + up = in; + break; + } + --skip; // skip this nontrivial input + } + } + + // Set 0 bit to indicate that both paths were taken. + nlist.push((Node*)((intptr_t)sub + (region_was_visited_before ? 1 : 0))); + } + + if (up == sub) { + break; // some kind of tight cycle + } + if (up == orig_sub && met_dom) { + // returned back after visiting 'dom' + break; // some kind of cycle + } + if (--iterations_without_region_limit < 0) { + break; // dead cycle + } sub = up; } + + // Did not meet Root or Start node in pred. chain. + // Conservative answer for dead code. return false; } @@ -1338,7 +1387,7 @@ static void find_recur( Node* &result, Node *n, int idx, bool only_ctrl, } #ifdef ASSERT // Search along debug_orig edges last: - for (Node* orig = n->debug_orig(); orig != NULL; orig = orig->debug_orig()) { + for (Node* orig = n->debug_orig(); orig != NULL && n != orig; orig = orig->debug_orig()) { if (NotANode(orig)) break; find_recur( result, orig, idx, only_ctrl, old_space, new_space ); } diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index dc44aab22c8..7f78b426b1c 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -53,6 +53,8 @@ class ConstraintCastNode; class ConNode; class CountedLoopNode; class CountedLoopEndNode; +class DecodeNNode; +class EncodePNode; class FastLockNode; class FastUnlockNode; class IfNode; @@ -438,6 +440,12 @@ private: public: // Globally replace this node by a given new node, updating all uses. void replace_by(Node* new_node); + // Globally replace this node by a given new node, updating all uses + // and cutting input edges of old node. + void subsume_by(Node* new_node) { + replace_by(new_node); + disconnect_inputs(NULL); + } void set_req_X( uint i, Node *n, PhaseIterGVN *igvn ); // Find the one non-null required input. RegionNode only Node *nonnull_req() const; @@ -577,6 +585,8 @@ public: DEFINE_CLASS_ID(CheckCastPP, Type, 2) DEFINE_CLASS_ID(CMove, Type, 3) DEFINE_CLASS_ID(SafePointScalarObject, Type, 4) + DEFINE_CLASS_ID(DecodeN, Type, 5) + DEFINE_CLASS_ID(EncodeP, Type, 6) DEFINE_CLASS_ID(Mem, Node, 6) DEFINE_CLASS_ID(Load, Mem, 0) @@ -685,6 +695,8 @@ public: DEFINE_CLASS_QUERY(Cmp) DEFINE_CLASS_QUERY(CountedLoop) DEFINE_CLASS_QUERY(CountedLoopEnd) + DEFINE_CLASS_QUERY(DecodeN) + DEFINE_CLASS_QUERY(EncodeP) DEFINE_CLASS_QUERY(FastLock) DEFINE_CLASS_QUERY(FastUnlock) DEFINE_CLASS_QUERY(If) diff --git a/hotspot/src/share/vm/opto/opcodes.cpp b/hotspot/src/share/vm/opto/opcodes.cpp index ddf5d40665e..129cc6e4cf6 100644 --- a/hotspot/src/share/vm/opto/opcodes.cpp +++ b/hotspot/src/share/vm/opto/opcodes.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/opto/opcodes.hpp b/hotspot/src/share/vm/opto/opcodes.hpp index 530f9e2cbd8..ee56085cf84 100644 --- a/hotspot/src/share/vm/opto/opcodes.hpp +++ b/hotspot/src/share/vm/opto/opcodes.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp index b1f2ca12155..64bf38f5d1a 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -48,6 +48,7 @@ void Compile::Output() { // Initialize the space for the BufferBlob used to find and verify // instruction size in MachNode::emit_size() init_scratch_buffer_blob(); + if (failing()) return; // Out of memory // Make sure I can find the Start Node Block_Array& bbs = _cfg->_bbs; @@ -446,6 +447,7 @@ void Compile::Shorten_branches(Label *labels, int& code_size, int& reloc_size, i // We've got a winner. Replace this branch. MachNode *replacement = mach->short_branch_version(this); b->_nodes.map(j, replacement); + mach->subsume_by(replacement); // Update the jmp_end size to save time in our // next pass. diff --git a/hotspot/src/share/vm/opto/parse.hpp b/hotspot/src/share/vm/opto/parse.hpp index df2bc6cd54a..10b3fe2ca14 100644 --- a/hotspot/src/share/vm/opto/parse.hpp +++ b/hotspot/src/share/vm/opto/parse.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index e3edece1a15..d26d075f627 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1901,7 +1901,7 @@ void Parse::call_register_finalizer() { // finalization. In general this will fold up since the concrete // class is often visible so the access flags are constant. Node* klass_addr = basic_plus_adr( receiver, receiver, oopDesc::klass_offset_in_bytes() ); - Node* klass = _gvn.transform(new (C, 3) LoadKlassNode(NULL, immutable_memory(), klass_addr, TypeInstPtr::KLASS)); + Node* klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), klass_addr, TypeInstPtr::KLASS) ); Node* access_flags_addr = basic_plus_adr(klass, klass, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc)); Node* access_flags = make_load(NULL, access_flags_addr, TypeInt::INT, T_INT); diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index c515f2e32b9..b3e0a9aff10 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -67,12 +67,9 @@ Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) { const Type* elemtype = arytype->elem(); if (UseUniqueSubclasses && result2 != NULL) { - const Type* el = elemtype; - if (elemtype->isa_narrowoop()) { - el = elemtype->is_narrowoop()->make_oopptr(); - } - const TypeInstPtr* toop = el->isa_instptr(); - if (toop) { + const Type* el = elemtype->make_ptr(); + if (el && el->isa_instptr()) { + const TypeInstPtr* toop = el->is_instptr(); if (toop->klass()->as_instance_klass()->unique_concrete_subklass()) { // If we load from "AbstractClass[]" we must see "ConcreteSubClass". const Type* subklass = Type::get_const_type(toop->klass()); @@ -2223,7 +2220,7 @@ void Parse::do_one_bytecode() { sprintf(buffer, "Bytecode %d: %s", bci(), Bytecodes::name(bc())); bool old = printer->traverse_outs(); printer->set_traverse_outs(true); - printer->print_method(C, buffer, 3); + printer->print_method(C, buffer, 4); printer->set_traverse_outs(old); } #endif diff --git a/hotspot/src/share/vm/opto/parse3.cpp b/hotspot/src/share/vm/opto/parse3.cpp index 3c0e0ff3186..2a603de28c9 100644 --- a/hotspot/src/share/vm/opto/parse3.cpp +++ b/hotspot/src/share/vm/opto/parse3.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/opto/parseHelper.cpp b/hotspot/src/share/vm/opto/parseHelper.cpp index d34ca998c70..b5553cbe806 100644 --- a/hotspot/src/share/vm/opto/parseHelper.cpp +++ b/hotspot/src/share/vm/opto/parseHelper.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -38,7 +38,7 @@ void GraphKit::make_dtrace_method_entry_exit(ciMethod* method, bool is_entry) { // Get method const TypeInstPtr* method_type = TypeInstPtr::make(TypePtr::Constant, method->klass(), true, method, 0); - Node *method_node = _gvn.transform( new (C, 1) ConPNode(method_type) ); + Node *method_node = _gvn.transform( ConNode::make(C, method_type) ); kill_dead_locals(); @@ -143,7 +143,7 @@ void Parse::array_store_check() { int klass_offset = oopDesc::klass_offset_in_bytes(); Node* p = basic_plus_adr( ary, ary, klass_offset ); // p's type is array-of-OOPS plus klass_offset - Node* array_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p, TypeInstPtr::KLASS)); + Node* array_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS) ); // Get the array klass const TypeKlassPtr *tak = _gvn.type(array_klass)->is_klassptr(); @@ -189,7 +189,7 @@ void Parse::array_store_check() { // Extract the array element class int element_klass_offset = objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc); Node *p2 = basic_plus_adr(array_klass, array_klass, element_klass_offset); - Node *a_e_klass = _gvn.transform(new (C, 3) LoadKlassNode(0, immutable_memory(), p2, tak)); + Node *a_e_klass = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p2, tak) ); // Check (the hard way) and throw if not a subklass. // Result is ignored, we just need the CFG effects. diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index e58577451b6..45690469d92 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index e040ccc8b02..79482ec289d 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/postaloc.cpp b/hotspot/src/share/vm/opto/postaloc.cpp index cabbefe12c7..59e6b14125d 100644 --- a/hotspot/src/share/vm/opto/postaloc.cpp +++ b/hotspot/src/share/vm/opto/postaloc.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 53413dfbfeb..90ad08700c3 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -45,10 +45,13 @@ Node *SubNode::Identity( PhaseTransform *phase ) { return in(2)->in(2); } - // Convert "(X+Y) - Y" into X + // Convert "(X+Y) - Y" into X and "(X+Y) - X" into Y if( in(1)->Opcode() == Op_AddI ) { if( phase->eqv(in(1)->in(2),in(2)) ) return in(1)->in(1); + if (phase->eqv(in(1)->in(1),in(2))) + return in(1)->in(2); + // Also catch: "(X + Opaque2(Y)) - Y". In this case, 'Y' is a loop-varying // trip counter and X is likely to be loop-invariant (that's how O2 Nodes // are originally used, although the optimizer sometimes jiggers things). @@ -740,8 +743,8 @@ Node *CmpPNode::Ideal( PhaseGVN *phase, bool can_reshape ) { // Simplify an CmpN (compare 2 pointers) node, based on local information. // If both inputs are constants, compare them. const Type *CmpNNode::sub( const Type *t1, const Type *t2 ) const { - const TypePtr *r0 = t1->is_narrowoop()->make_oopptr(); // Handy access - const TypePtr *r1 = t2->is_narrowoop()->make_oopptr(); + const TypePtr *r0 = t1->make_ptr(); // Handy access + const TypePtr *r1 = t2->make_ptr(); // Undefined inputs makes for an undefined result if( TypePtr::above_centerline(r0->_ptr) || diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 8d01e2328d2..ecdd10e1eea 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index 5e3a7bb70e1..593d5dd2dd0 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1424,9 +1424,9 @@ int SuperWord::memory_alignment(MemNode* s, int iv_adjust_in_bytes) { //---------------------------container_type--------------------------- // Smallest type containing range of values const Type* SuperWord::container_type(const Type* t) { - if (t->isa_narrowoop()) t = t->is_narrowoop()->make_oopptr(); - if (t->isa_aryptr()) { - t = t->is_aryptr()->elem(); + const Type* tp = t->make_ptr(); + if (tp && tp->isa_aryptr()) { + t = tp->is_aryptr()->elem(); } if (t->basic_type() == T_INT) { if (t->higher_equal(TypeInt::BOOL)) return TypeInt::BOOL; diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index 0715ef22a46..bb6c959388f 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -311,8 +311,18 @@ void Type::Initialize_shared(Compile* current) { mreg2type[Op_RegFlags] = TypeInt::CC; TypeAryPtr::RANGE = TypeAryPtr::make( TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), current->env()->Object_klass(), false, arrayOopDesc::length_offset_in_bytes()); - // There is no shared klass for Object[]. See note in TypeAryPtr::klass(). - TypeAryPtr::OOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInstPtr::BOTTOM,TypeInt::POS), NULL /*ciArrayKlass::make(o)*/, false, Type::OffsetBot); + + TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/, false, Type::OffsetBot); + +#ifdef _LP64 + if (UseCompressedOops) { + TypeAryPtr::OOPS = TypeAryPtr::NARROWOOPS; + } else +#endif + { + // There is no shared klass for Object[]. See note in TypeAryPtr::klass(). + TypeAryPtr::OOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInstPtr::BOTTOM,TypeInt::POS), NULL /*ciArrayKlass::make(o)*/, false, Type::OffsetBot); + } TypeAryPtr::BYTES = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::BYTE ,TypeInt::POS), ciTypeArrayKlass::make(T_BYTE), true, Type::OffsetBot); TypeAryPtr::SHORTS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::SHORT ,TypeInt::POS), ciTypeArrayKlass::make(T_SHORT), true, Type::OffsetBot); TypeAryPtr::CHARS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeInt::CHAR ,TypeInt::POS), ciTypeArrayKlass::make(T_CHAR), true, Type::OffsetBot); @@ -321,9 +331,10 @@ void Type::Initialize_shared(Compile* current) { TypeAryPtr::FLOATS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::FLOAT ,TypeInt::POS), ciTypeArrayKlass::make(T_FLOAT), true, Type::OffsetBot); TypeAryPtr::DOUBLES = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::DOUBLE ,TypeInt::POS), ciTypeArrayKlass::make(T_DOUBLE), true, Type::OffsetBot); - TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL; // what should this be? + // Nobody should ask _array_body_type[T_NARROWOOP]. Use NULL as assert. + TypeAryPtr::_array_body_type[T_NARROWOOP] = NULL; TypeAryPtr::_array_body_type[T_OBJECT] = TypeAryPtr::OOPS; - TypeAryPtr::_array_body_type[T_ARRAY] = TypeAryPtr::OOPS; // arrays are stored in oop arrays + TypeAryPtr::_array_body_type[T_ARRAY] = TypeAryPtr::OOPS; // arrays are stored in oop arrays TypeAryPtr::_array_body_type[T_BYTE] = TypeAryPtr::BYTES; TypeAryPtr::_array_body_type[T_BOOLEAN] = TypeAryPtr::BYTES; // boolean[] is a byte array TypeAryPtr::_array_body_type[T_SHORT] = TypeAryPtr::SHORTS; @@ -480,14 +491,8 @@ bool Type::is_nan() const { // commutative and the lattice is symmetric. const Type *Type::meet( const Type *t ) const { if (isa_narrowoop() && t->isa_narrowoop()) { - const Type* result = is_narrowoop()->make_oopptr()->meet(t->is_narrowoop()->make_oopptr()); - if (result->isa_oopptr()) { - return result->isa_oopptr()->make_narrowoop(); - } else if (result == TypePtr::NULL_PTR) { - return TypeNarrowOop::NULL_PTR; - } else { - return result; - } + const Type* result = make_ptr()->meet(t->make_ptr()); + return result->make_narrowoop(); } const Type *mt = xmeet(t); @@ -509,23 +514,8 @@ const Type *Type::meet( const Type *t ) const { bool t_interface = t_inst->klass()->is_interface(); interface_vs_oop = this_interface ^ t_interface; } - const Type *tdual = t->_dual; - const Type *thisdual = _dual; - // strip out instances - if (t2t->isa_oopptr() != NULL) { - t2t = t2t->isa_oopptr()->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); - } - if (t2this->isa_oopptr() != NULL) { - t2this = t2this->isa_oopptr()->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); - } - if (tdual->isa_oopptr() != NULL) { - tdual = tdual->isa_oopptr()->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); - } - if (thisdual->isa_oopptr() != NULL) { - thisdual = thisdual->isa_oopptr()->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE); - } - if( !interface_vs_oop && (t2t != tdual || t2this != thisdual) ) { + if( !interface_vs_oop && (t2t != t->_dual || t2this != _dual) ) { tty->print_cr("=== Meet Not Symmetric ==="); tty->print("t = "); t->dump(); tty->cr(); tty->print("this= "); dump(); tty->cr(); @@ -696,7 +686,7 @@ void Type::dump_on(outputStream *st) const { ResourceMark rm; Dict d(cmpkey,hashkey); // Stop recursive type dumping dump2(d,1, st); - if (isa_ptr() && is_ptr()->is_narrow()) { + if (is_ptr_to_narrowoop()) { st->print(" [narrow]"); } } @@ -929,6 +919,7 @@ const Type *TypeD::xmeet( const Type *t ) const { case InstPtr: case KlassPtr: case AryPtr: + case NarrowOop: case Int: case Long: case FloatTop: @@ -1075,6 +1066,7 @@ const Type *TypeInt::xmeet( const Type *t ) const { case InstPtr: case KlassPtr: case AryPtr: + case NarrowOop: case Long: case FloatTop: case FloatCon: @@ -1082,7 +1074,6 @@ const Type *TypeInt::xmeet( const Type *t ) const { case DoubleTop: case DoubleCon: case DoubleBot: - case NarrowOop: case Bottom: // Ye Olde Default return Type::BOTTOM; default: // All else is a mistake @@ -1317,6 +1308,7 @@ const Type *TypeLong::xmeet( const Type *t ) const { case InstPtr: case KlassPtr: case AryPtr: + case NarrowOop: case Int: case FloatTop: case FloatCon: @@ -1751,7 +1743,7 @@ inline const TypeInt* normalize_array_size(const TypeInt* size) { //------------------------------make------------------------------------------- const TypeAry *TypeAry::make( const Type *elem, const TypeInt *size) { if (UseCompressedOops && elem->isa_oopptr()) { - elem = elem->is_oopptr()->make_narrowoop(); + elem = elem->make_narrowoop(); } size = normalize_array_size(size); return (TypeAry*)(new TypeAry(elem,size))->hashcons(); @@ -1836,9 +1828,8 @@ bool TypeAry::ary_must_be_exact() const { if (_elem == BOTTOM) return false; // general array not exact if (_elem == TOP ) return false; // inverted general array not exact const TypeOopPtr* toop = NULL; - if (UseCompressedOops) { - const TypeNarrowOop* noop = _elem->isa_narrowoop(); - if (noop) toop = noop->make_oopptr()->isa_oopptr(); + if (UseCompressedOops && _elem->isa_narrowoop()) { + toop = _elem->make_ptr()->isa_oopptr(); } else { toop = _elem->isa_oopptr(); } @@ -1848,16 +1839,18 @@ bool TypeAry::ary_must_be_exact() const { if (!tklass->is_loaded()) return false; // unloaded class const TypeInstPtr* tinst; if (_elem->isa_narrowoop()) - tinst = _elem->is_narrowoop()->make_oopptr()->isa_instptr(); + tinst = _elem->make_ptr()->isa_instptr(); else tinst = _elem->isa_instptr(); - if (tinst) return tklass->as_instance_klass()->is_final(); + if (tinst) + return tklass->as_instance_klass()->is_final(); const TypeAryPtr* tap; if (_elem->isa_narrowoop()) - tap = _elem->is_narrowoop()->make_oopptr()->isa_aryptr(); + tap = _elem->make_ptr()->isa_aryptr(); else tap = _elem->isa_aryptr(); - if (tap) return tap->ary()->ary_must_be_exact(); + if (tap) + return tap->ary()->ary_must_be_exact(); return false; } @@ -2146,6 +2139,67 @@ void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const { // Convenience common pre-built type. const TypeOopPtr *TypeOopPtr::BOTTOM; +//------------------------------TypeOopPtr------------------------------------- +TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) + : TypePtr(t, ptr, offset), + _const_oop(o), _klass(k), + _klass_is_exact(xk), + _is_ptr_to_narrowoop(false), + _instance_id(instance_id) { +#ifdef _LP64 + if (UseCompressedOops && _offset != 0) { + if (klass() == NULL) { + assert(this->isa_aryptr(), "only arrays without klass"); + _is_ptr_to_narrowoop = true; + } else if (_offset == oopDesc::klass_offset_in_bytes()) { + _is_ptr_to_narrowoop = true; + } else if (this->isa_aryptr()) { + _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() && + _offset != arrayOopDesc::length_offset_in_bytes()); + } else if (klass() == ciEnv::current()->Class_klass() && + (_offset == java_lang_Class::klass_offset_in_bytes() || + _offset == java_lang_Class::array_klass_offset_in_bytes())) { + // Special hidden fields from the Class. + assert(this->isa_instptr(), "must be an instance ptr."); + _is_ptr_to_narrowoop = true; + } else if (klass()->is_instance_klass()) { + ciInstanceKlass* ik = klass()->as_instance_klass(); + ciField* field = NULL; + if (this->isa_klassptr()) { + // Perm objects don't use compressed references, except for + // static fields which are currently compressed. + field = ik->get_field_by_offset(_offset, true); + if (field != NULL) { + BasicType basic_elem_type = field->layout_type(); + _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT || + basic_elem_type == T_ARRAY); + } + } else if (_offset == OffsetBot || _offset == OffsetTop) { + // unsafe access + _is_ptr_to_narrowoop = true; + } else { // exclude unsafe ops + assert(this->isa_instptr(), "must be an instance ptr."); + // Field which contains a compressed oop references. + field = ik->get_field_by_offset(_offset, false); + if (field != NULL) { + BasicType basic_elem_type = field->layout_type(); + _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT || + basic_elem_type == T_ARRAY); + } else if (klass()->equals(ciEnv::current()->Object_klass())) { + // Compile::find_alias_type() cast exactness on all types to verify + // that it does not affect alias type. + _is_ptr_to_narrowoop = true; + } else { + // Type for the copy start in LibraryCallKit::inline_native_clone(). + assert(!klass_is_exact(), "only non-exact klass"); + _is_ptr_to_narrowoop = true; + } + } + } + } +#endif +} + //------------------------------make------------------------------------------- const TypeOopPtr *TypeOopPtr::make(PTR ptr, int offset) { @@ -2153,7 +2207,7 @@ const TypeOopPtr *TypeOopPtr::make(PTR ptr, ciKlass* k = ciKlassKlass::make(); bool xk = false; ciObject* o = NULL; - return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, UNKNOWN_INSTANCE))->hashcons(); + return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, InstanceBot))->hashcons(); } @@ -2165,7 +2219,7 @@ const Type *TypeOopPtr::cast_to_ptr_type(PTR ptr) const { } //-----------------------------cast_to_instance------------------------------- -const TypeOopPtr *TypeOopPtr::cast_to_instance(int instance_id) const { +const TypeOopPtr *TypeOopPtr::cast_to_instance_id(int instance_id) const { // There are no instances of a general oop. // Return self unchanged. return this; @@ -2259,7 +2313,7 @@ const Type *TypeOopPtr::xmeet( const Type *t ) const { const Type *TypeOopPtr::xdual() const { assert(klass() == ciKlassKlass::make(), "no klasses here"); assert(const_oop() == NULL, "no constants here"); - return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance() ); + return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() ); } //--------------------------make_from_klass_common----------------------------- @@ -2473,7 +2527,9 @@ void TypeOopPtr::dump2( Dict &d, uint depth, outputStream *st ) const { case 0: break; default: st->print("+%d",_offset); break; } - if (_instance_id != UNKNOWN_INSTANCE) + if (_instance_id == InstanceTop) + st->print(",iid=top"); + else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); } #endif @@ -2505,20 +2561,24 @@ const TypePtr *TypeOopPtr::add_offset( int offset ) const { return make( _ptr, xadd_offset(offset) ); } -const TypeNarrowOop* TypeOopPtr::make_narrowoop() const { - return TypeNarrowOop::make(this); +//------------------------------meet_instance_id-------------------------------- +int TypeOopPtr::meet_instance_id( int instance_id ) const { + // Either is 'TOP' instance? Return the other instance! + if( _instance_id == InstanceTop ) return instance_id; + if( instance_id == InstanceTop ) return _instance_id; + // If either is different, return 'BOTTOM' instance + if( _instance_id != instance_id ) return InstanceBot; + return _instance_id; } -int TypeOopPtr::meet_instance(int iid) const { - if (iid == 0) { - return (_instance_id < 0) ? _instance_id : UNKNOWN_INSTANCE; - } else if (_instance_id == UNKNOWN_INSTANCE) { - return (iid < 0) ? iid : UNKNOWN_INSTANCE; - } else { - return (_instance_id == iid) ? iid : UNKNOWN_INSTANCE; - } +//------------------------------dual_instance_id-------------------------------- +int TypeOopPtr::dual_instance_id( ) const { + if( _instance_id == InstanceTop ) return InstanceBot; // Map TOP into BOTTOM + if( _instance_id == InstanceBot ) return InstanceTop; // Map BOTTOM into TOP + return _instance_id; // Map everything else into self } + //============================================================================= // Convenience common pre-built types. const TypeInstPtr *TypeInstPtr::NOTNULL; @@ -2550,7 +2610,7 @@ const TypeInstPtr *TypeInstPtr::make(PTR ptr, // Ptr is never Null assert( ptr != Null, "NULL pointers are not typed" ); - if (instance_id != UNKNOWN_INSTANCE) + if ( instance_id > 0 ) xk = true; // instances are always exactly typed if (!UseExactTypes) xk = false; if (ptr == Constant) { @@ -2575,7 +2635,7 @@ const Type *TypeInstPtr::cast_to_ptr_type(PTR ptr) const { if( ptr == _ptr ) return this; // Reconstruct _sig info here since not a problem with later lazy // construction, _sig will show up on demand. - return make(ptr, klass(), klass_is_exact(), const_oop(), _offset); + return make(ptr, klass(), klass_is_exact(), const_oop(), _offset, _instance_id); } @@ -2591,11 +2651,15 @@ const Type *TypeInstPtr::cast_to_exactness(bool klass_is_exact) const { } //-----------------------------cast_to_instance------------------------------- -const TypeOopPtr *TypeInstPtr::cast_to_instance(int instance_id) const { - if( instance_id == _instance_id) return this; - bool exact = (instance_id == UNKNOWN_INSTANCE) ? _klass_is_exact : true; - - return make(ptr(), klass(), exact, const_oop(), _offset, instance_id); +const TypeOopPtr *TypeInstPtr::cast_to_instance_id(int instance_id) const { + if( instance_id == _instance_id ) return this; + bool exact = _klass_is_exact; + PTR ptr_t = _ptr; + if ( instance_id > 0 ) { // instances are always exactly typed + if (UseExactTypes) exact = true; + ptr_t = NotNull; + } + return make(ptr_t, klass(), exact, const_oop(), _offset, instance_id); } //------------------------------xmeet_unloaded--------------------------------- @@ -2676,16 +2740,17 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { const TypeAryPtr *tp = t->is_aryptr(); int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); - int iid = meet_instance(tp->instance_id()); + int instance_id = meet_instance_id(tp->instance_id()); switch (ptr) { case TopPTR: case AnyNull: // Fall 'down' to dual of object klass if (klass()->equals(ciEnv::current()->Object_klass())) { - return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, iid); + return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, iid); + instance_id = InstanceBot; + return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id); } case Constant: case NotNull: @@ -2696,14 +2761,15 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // then we can subclass in the Java class heirarchy. if (klass()->equals(ciEnv::current()->Object_klass())) { // that is, tp's array type is a subtype of my klass - return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, iid); + return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id); } } // The other case cannot happen, since I cannot be a subtype of an array. // The meet falls down to Object class below centerline. if( ptr == Constant ) ptr = NotNull; - return make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, iid ); + instance_id = InstanceBot; + return make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id ); default: typerr(t); } } @@ -2715,9 +2781,11 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { PTR ptr = meet_ptr(tp->ptr()); switch (tp->ptr()) { case TopPTR: - case AnyNull: + case AnyNull: { + int instance_id = meet_instance_id(InstanceTop); return make(ptr, klass(), klass_is_exact(), - (ptr == Constant ? const_oop() : NULL), offset); + (ptr == Constant ? const_oop() : NULL), offset, instance_id); + } case NotNull: case BotPTR: return TypeOopPtr::make(ptr, offset); @@ -2733,10 +2801,13 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { switch (tp->ptr()) { case Null: if( ptr == Null ) return TypePtr::make( AnyPtr, ptr, offset ); + // else fall through to AnyNull case TopPTR: - case AnyNull: + case AnyNull: { + int instance_id = meet_instance_id(InstanceTop); return make( ptr, klass(), klass_is_exact(), - (ptr == Constant ? const_oop() : NULL), offset ); + (ptr == Constant ? const_oop() : NULL), offset, instance_id); + } case NotNull: case BotPTR: return TypePtr::make( AnyPtr, ptr, offset ); @@ -2765,7 +2836,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { const TypeInstPtr *tinst = t->is_instptr(); int off = meet_offset( tinst->offset() ); PTR ptr = meet_ptr( tinst->ptr() ); - int instance_id = meet_instance(tinst->instance_id()); + int instance_id = meet_instance_id(tinst->instance_id()); // Check for easy case; klasses are equal (and perhaps not loaded!) // If we have constants, then we created oops so classes are loaded @@ -2834,7 +2905,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // Find out which constant. o = (this_klass == klass()) ? const_oop() : tinst->const_oop(); } - return make( ptr, k, xk, o, off ); + return make( ptr, k, xk, o, off, instance_id ); } // Either oop vs oop or interface vs interface or interface vs Object @@ -2921,7 +2992,7 @@ const Type *TypeInstPtr::xmeet( const Type *t ) const { // Now we find the LCA of Java classes ciKlass* k = this_klass->least_common_ancestor(tinst_klass); - return make( ptr, k, false, NULL, off ); + return make( ptr, k, false, NULL, off, instance_id ); } // End of case InstPtr case KlassPtr: @@ -2948,7 +3019,7 @@ ciType* TypeInstPtr::java_mirror_type() const { // Dual: do NOT dual on klasses. This means I do NOT understand the Java // inheritence mechanism. const Type *TypeInstPtr::xdual() const { - return new TypeInstPtr( dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance() ); + return new TypeInstPtr( dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id() ); } //------------------------------eq--------------------------------------------- @@ -3000,7 +3071,9 @@ void TypeInstPtr::dump2( Dict &d, uint depth, outputStream *st ) const { } st->print(" *"); - if (_instance_id != UNKNOWN_INSTANCE) + if (_instance_id == InstanceTop) + st->print(",iid=top"); + else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); } #endif @@ -3014,6 +3087,7 @@ const TypePtr *TypeInstPtr::add_offset( int offset ) const { // Convenience common pre-built types. const TypeAryPtr *TypeAryPtr::RANGE; const TypeAryPtr *TypeAryPtr::OOPS; +const TypeAryPtr *TypeAryPtr::NARROWOOPS; const TypeAryPtr *TypeAryPtr::BYTES; const TypeAryPtr *TypeAryPtr::SHORTS; const TypeAryPtr *TypeAryPtr::CHARS; @@ -3027,7 +3101,7 @@ const TypeAryPtr *TypeAryPtr::make( PTR ptr, const TypeAry *ary, ciKlass* k, boo assert(!(k == NULL && ary->_elem->isa_int()), "integral arrays must be pre-equipped with a class"); if (!xk) xk = ary->ary_must_be_exact(); - if (instance_id != UNKNOWN_INSTANCE) + if ( instance_id > 0 ) xk = true; // instances are always exactly typed if (!UseExactTypes) xk = (ptr == Constant); return (TypeAryPtr*)(new TypeAryPtr(ptr, NULL, ary, k, xk, offset, instance_id))->hashcons(); @@ -3039,7 +3113,7 @@ const TypeAryPtr *TypeAryPtr::make( PTR ptr, ciObject* o, const TypeAry *ary, ci "integral arrays must be pre-equipped with a class"); assert( (ptr==Constant && o) || (ptr!=Constant && !o), "" ); if (!xk) xk = (o != NULL) || ary->ary_must_be_exact(); - if (instance_id != UNKNOWN_INSTANCE) + if ( instance_id > 0 ) xk = true; // instances are always exactly typed if (!UseExactTypes) xk = (ptr == Constant); return (TypeAryPtr*)(new TypeAryPtr(ptr, o, ary, k, xk, offset, instance_id))->hashcons(); @@ -3048,7 +3122,7 @@ const TypeAryPtr *TypeAryPtr::make( PTR ptr, ciObject* o, const TypeAry *ary, ci //------------------------------cast_to_ptr_type------------------------------- const Type *TypeAryPtr::cast_to_ptr_type(PTR ptr) const { if( ptr == _ptr ) return this; - return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset); + return make(ptr, const_oop(), _ary, klass(), klass_is_exact(), _offset, _instance_id); } @@ -3061,10 +3135,15 @@ const Type *TypeAryPtr::cast_to_exactness(bool klass_is_exact) const { } //-----------------------------cast_to_instance------------------------------- -const TypeOopPtr *TypeAryPtr::cast_to_instance(int instance_id) const { - if( instance_id == _instance_id) return this; - bool exact = (instance_id == UNKNOWN_INSTANCE) ? _klass_is_exact : true; - return make(ptr(), const_oop(), _ary, klass(), exact, _offset, instance_id); +const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const { + if( instance_id == _instance_id ) return this; + bool exact = _klass_is_exact; + PTR ptr_t = _ptr; + if ( instance_id > 0 ) { // instances are always exactly typed + if (UseExactTypes) exact = true; + ptr_t = NotNull; + } + return make(ptr_t, const_oop(), _ary, klass(), exact, _offset, instance_id); } //-----------------------------narrow_size_type------------------------------- @@ -3115,7 +3194,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_size(const TypeInt* new_size) const { new_size = TypeInt::ZERO; // intermediate dead fast-path goo if (new_size == size()) return this; const TypeAry* new_ary = TypeAry::make(elem(), new_size); - return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset); + return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _instance_id); } @@ -3167,8 +3246,11 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { PTR ptr = meet_ptr(tp->ptr()); switch (tp->ptr()) { case TopPTR: - case AnyNull: - return make(ptr, (ptr == Constant ? const_oop() : NULL), _ary, _klass, _klass_is_exact, offset); + case AnyNull: { + int instance_id = meet_instance_id(InstanceTop); + return make(ptr, (ptr == Constant ? const_oop() : NULL), + _ary, _klass, _klass_is_exact, offset, instance_id); + } case BotPTR: case NotNull: return TypeOopPtr::make(ptr, offset); @@ -3189,8 +3271,12 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { return TypePtr::make(AnyPtr, ptr, offset); case Null: if( ptr == Null ) return TypePtr::make(AnyPtr, ptr, offset); - case AnyNull: - return make( ptr, (ptr == Constant ? const_oop() : NULL), _ary, _klass, _klass_is_exact, offset ); + // else fall through to AnyNull + case AnyNull: { + int instance_id = meet_instance_id(InstanceTop); + return make( ptr, (ptr == Constant ? const_oop() : NULL), + _ary, _klass, _klass_is_exact, offset, instance_id); + } default: ShouldNotReachHere(); } } @@ -3202,7 +3288,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { int off = meet_offset(tap->offset()); const TypeAry *tary = _ary->meet(tap->_ary)->is_ary(); PTR ptr = meet_ptr(tap->ptr()); - int iid = meet_instance(tap->instance_id()); + int instance_id = meet_instance_id(tap->instance_id()); ciKlass* lazy_klass = NULL; if (tary->_elem->isa_int()) { // Integral array element types have irrelevant lattice relations. @@ -3223,7 +3309,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { case TopPTR: // Compute new klass on demand, do not use tap->_klass xk = (tap->_klass_is_exact | this->_klass_is_exact); - return make( ptr, const_oop(), tary, lazy_klass, xk, off, iid ); + return make( ptr, const_oop(), tary, lazy_klass, xk, off, instance_id ); case Constant: { ciObject* o = const_oop(); if( _ptr == Constant ) { @@ -3235,7 +3321,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { o = tap->const_oop(); } xk = true; - return TypeAryPtr::make( ptr, o, tary, tap->_klass, xk, off, iid ); + return TypeAryPtr::make( ptr, o, tary, tap->_klass, xk, off, instance_id ); } case NotNull: case BotPTR: @@ -3246,7 +3332,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { xk = this->_klass_is_exact; else xk = (tap->_klass_is_exact & this->_klass_is_exact) && (klass() == tap->klass()); // Only precise for identical arrays - return TypeAryPtr::make( ptr, NULL, tary, lazy_klass, xk, off, iid ); + return TypeAryPtr::make( ptr, NULL, tary, lazy_klass, xk, off, instance_id ); default: ShouldNotReachHere(); } } @@ -3256,16 +3342,17 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { const TypeInstPtr *tp = t->is_instptr(); int offset = meet_offset(tp->offset()); PTR ptr = meet_ptr(tp->ptr()); - int iid = meet_instance(tp->instance_id()); + int instance_id = meet_instance_id(tp->instance_id()); switch (ptr) { case TopPTR: case AnyNull: // Fall 'down' to dual of object klass if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { - return TypeAryPtr::make( ptr, _ary, _klass, _klass_is_exact, offset, iid ); + return TypeAryPtr::make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id ); } else { // cannot subclass, so the meet has to fall badly below the centerline ptr = NotNull; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, iid); + instance_id = InstanceBot; + return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id); } case Constant: case NotNull: @@ -3276,14 +3363,15 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { // then we can subclass in the Java class heirarchy. if( tp->klass()->equals(ciEnv::current()->Object_klass()) ) { // that is, my array type is a subtype of 'tp' klass - return make( ptr, _ary, _klass, _klass_is_exact, offset, iid ); + return make( ptr, _ary, _klass, _klass_is_exact, offset, instance_id ); } } // The other case cannot happen, since t cannot be a subtype of an array. // The meet falls down to Object class below centerline. if( ptr == Constant ) ptr = NotNull; - return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, iid); + instance_id = InstanceBot; + return TypeInstPtr::make( ptr, ciEnv::current()->Object_klass(), false, NULL,offset, instance_id); default: typerr(t); } } @@ -3298,7 +3386,7 @@ const Type *TypeAryPtr::xmeet( const Type *t ) const { //------------------------------xdual------------------------------------------ // Dual: compute field-by-field dual const Type *TypeAryPtr::xdual() const { - return new TypeAryPtr( dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance() ); + return new TypeAryPtr( dual_ptr(), _const_oop, _ary->dual()->is_ary(),_klass, _klass_is_exact, dual_offset(), dual_instance_id() ); } //------------------------------dump2------------------------------------------ @@ -3335,7 +3423,9 @@ void TypeAryPtr::dump2( Dict &d, uint depth, outputStream *st ) const { } } st->print(" *"); - if (_instance_id != UNKNOWN_INSTANCE) + if (_instance_id == InstanceTop) + st->print(",iid=top"); + else if (_instance_id != InstanceBot) st->print(",iid=%d",_instance_id); } #endif @@ -3410,7 +3500,7 @@ const Type *TypeNarrowOop::xmeet( const Type *t ) const { return this; case NarrowOop: { - const Type* result = _ooptype->xmeet(t->is_narrowoop()->make_oopptr()); + const Type* result = _ooptype->xmeet(t->make_ptr()); if (result->isa_ptr()) { return TypeNarrowOop::make(result->is_ptr()); } @@ -3520,7 +3610,7 @@ ciKlass* TypeAryPtr::klass() const { const TypeAryPtr *tary; const Type* el = elem(); if (el->isa_narrowoop()) { - el = el->is_narrowoop()->make_oopptr(); + el = el->make_ptr(); } // Get element klass @@ -3547,7 +3637,7 @@ ciKlass* TypeAryPtr::klass() const { k_ary = ciTypeArrayKlass::make(el->basic_type()); } - if( this != TypeAryPtr::OOPS ) + if( this != TypeAryPtr::OOPS ) { // The _klass field acts as a cache of the underlying // ciKlass for this array type. In order to set the field, // we need to cast away const-ness. @@ -3562,6 +3652,11 @@ ciKlass* TypeAryPtr::klass() const { // a bit less efficient than caching, but calls to // TypeAryPtr::OOPS->klass() are not common enough to matter. ((TypeAryPtr*)this)->_klass = k_ary; + if (UseCompressedOops && k_ary != NULL && k_ary->is_obj_array_klass() && + _offset != 0 && _offset != arrayOopDesc::length_offset_in_bytes()) { + ((TypeAryPtr*)this)->_is_ptr_to_narrowoop = true; + } + } return k_ary; } diff --git a/hotspot/src/share/vm/opto/type.hpp b/hotspot/src/share/vm/opto/type.hpp index 194d3438fa3..7dbcf096277 100644 --- a/hotspot/src/share/vm/opto/type.hpp +++ b/hotspot/src/share/vm/opto/type.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -191,9 +191,8 @@ public: virtual const Type *filter( const Type *kills ) const; // Returns true if this pointer points at memory which contains a - // compressed oop references. In 32-bit builds it's non-virtual - // since we don't support compressed oops at all in the mode. - LP64_ONLY(virtual) bool is_narrow() const { return false; } + // compressed oop references. + bool is_ptr_to_narrowoop() const; // Convenience access float getf() const; @@ -213,8 +212,8 @@ public: const TypePtr *isa_ptr() const; // Returns NULL if not ptr type const TypeRawPtr *isa_rawptr() const; // NOT Java oop const TypeRawPtr *is_rawptr() const; // Asserts is rawptr - const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer - const TypeNarrowOop *isa_narrowoop() const; // Returns NULL if not oop ptr type + const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer + const TypeNarrowOop *isa_narrowoop() const; // Returns NULL if not oop ptr type const TypeOopPtr *isa_oopptr() const; // Returns NULL if not oop ptr type const TypeOopPtr *is_oopptr() const; // Java-style GC'd pointer const TypeKlassPtr *isa_klassptr() const; // Returns NULL if not KlassPtr @@ -226,6 +225,12 @@ public: virtual bool is_finite() const; // Has a finite value virtual bool is_nan() const; // Is not a number (NaN) + // Returns this ptr type or the equivalent ptr type for this compressed pointer. + const TypePtr* make_ptr() const; + // Returns this compressed pointer or the equivalent compressed version + // of this pointer type. + const TypeNarrowOop* make_narrowoop() const; + // Special test for register pressure heuristic bool is_floatingpoint() const; // True if Float or Double base type @@ -643,13 +648,14 @@ public: // Some kind of oop (Java pointer), either klass or instance or array. class TypeOopPtr : public TypePtr { protected: - TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ) : TypePtr(t, ptr, offset), _const_oop(o), _klass(k), _klass_is_exact(xk), _instance_id(instance_id) { } + TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); public: virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing virtual bool singleton(void) const; // TRUE if type is a singleton enum { - UNKNOWN_INSTANCE = 0 + InstanceTop = -1, // undefined instance + InstanceBot = 0 // any possible instance }; protected: @@ -660,15 +666,17 @@ protected: ciKlass* _klass; // Klass object // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) bool _klass_is_exact; + bool _is_ptr_to_narrowoop; - int _instance_id; // if not UNKNOWN_INSTANCE, indicates that this is a particular instance - // of this type which is distinct. This is the the node index of the - // node creating this instance + // If not InstanceTop or InstanceBot, indicates that this is + // a particular instance of this type which is distinct. + // This is the the node index of the allocation node creating this instance. + int _instance_id; static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); - int dual_instance() const { return -_instance_id; } - int meet_instance(int uid) const; + int dual_instance_id() const; + int meet_instance_id(int uid) const; public: // Creates a type given a klass. Correctly handles multi-dimensional arrays @@ -696,9 +704,14 @@ public: ciObject* const_oop() const { return _const_oop; } virtual ciKlass* klass() const { return _klass; } bool klass_is_exact() const { return _klass_is_exact; } - bool is_instance() const { return _instance_id != UNKNOWN_INSTANCE; } - uint instance_id() const { return _instance_id; } - bool is_instance_field() const { return _instance_id != UNKNOWN_INSTANCE && _offset >= 0; } + + // Returns true if this pointer points at memory which contains a + // compressed oop references. + bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; } + + bool is_known_instance() const { return _instance_id > 0; } + int instance_id() const { return _instance_id; } + bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } virtual intptr_t get_con() const; @@ -706,22 +719,13 @@ public: virtual const Type *cast_to_exactness(bool klass_is_exact) const; - virtual const TypeOopPtr *cast_to_instance(int instance_id) const; + virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; // corresponding pointer to klass, for a given instance const TypeKlassPtr* as_klass_type() const; virtual const TypePtr *add_offset( int offset ) const; - // returns the equivalent compressed version of this pointer type - virtual const TypeNarrowOop* make_narrowoop() const; - -#ifdef _LP64 - virtual bool is_narrow() const { - return (UseCompressedOops && _offset != 0); - } -#endif - virtual const Type *xmeet( const Type *t ) const; virtual const Type *xdual() const; // Compute dual right now. @@ -776,7 +780,7 @@ class TypeInstPtr : public TypeOopPtr { } // Make a pointer to an oop. - static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = 0 ); + static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); // If this is a java.lang.Class constant, return the type for it or NULL. // Pass to Type::get_const_type to turn it to a type, which will usually @@ -787,7 +791,7 @@ class TypeInstPtr : public TypeOopPtr { virtual const Type *cast_to_exactness(bool klass_is_exact) const; - virtual const TypeOopPtr *cast_to_instance(int instance_id) const; + virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; virtual const TypePtr *add_offset( int offset ) const; @@ -821,9 +825,9 @@ public: const Type* elem() const { return _ary->_elem; } const TypeInt* size() const { return _ary->_size; } - static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = 0); + static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); // Constant pointer to array - static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = 0); + 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); @@ -833,7 +837,7 @@ public: virtual const Type *cast_to_exactness(bool klass_is_exact) const; - virtual const TypeOopPtr *cast_to_instance(int instance_id) const; + virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const; @@ -843,15 +847,10 @@ public: virtual const Type *xmeet( const Type *t ) const; virtual const Type *xdual() const; // Compute dual right now. -#ifdef _LP64 - virtual bool is_narrow() const { - return (UseCompressedOops && klass() != NULL && _offset != 0); - } -#endif - // Convenience common pre-built types. static const TypeAryPtr *RANGE; static const TypeAryPtr *OOPS; + static const TypeAryPtr *NARROWOOPS; static const TypeAryPtr *BYTES; static const TypeAryPtr *SHORTS; static const TypeAryPtr *CHARS; @@ -901,18 +900,6 @@ public: virtual const Type *xmeet( const Type *t ) const; virtual const Type *xdual() const; // Compute dual right now. -#ifdef _LP64 - // Perm objects don't use compressed references, except for static fields - // which are currently compressed - virtual bool is_narrow() const { - if (UseCompressedOops && _offset != 0 && _klass->is_instance_klass()) { - ciInstanceKlass* ik = _klass->as_instance_klass(); - return ik != NULL && ik->get_field_by_offset(_offset, true) != NULL; - } - return false; - } -#endif - // Convenience common pre-built types. static const TypeKlassPtr* OBJECT; // Not-null object klass or below static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same @@ -921,7 +908,7 @@ public: #endif }; -//------------------------------TypeNarrowOop---------------------------------------- +//------------------------------TypeNarrowOop---------------------------------- // A compressed reference to some kind of Oop. This type wraps around // a preexisting TypeOopPtr and forwards most of it's operations to // the underlying type. It's only real purpose is to track the @@ -929,7 +916,7 @@ public: // between the normal and the compressed form. class TypeNarrowOop : public Type { protected: - const TypePtr* _ooptype; + const TypePtr* _ooptype; // Could be TypePtr::NULL_PTR TypeNarrowOop( const TypePtr* ooptype): Type(NarrowOop), _ooptype(ooptype) { @@ -958,8 +945,8 @@ public: return make(TypeOopPtr::make_from_constant(con)); } - // returns the equivalent oopptr type for this compressed pointer - virtual const TypePtr *make_oopptr() const { + // returns the equivalent ptr type for this compressed pointer + const TypePtr *make_oopptr() const { return _ooptype; } @@ -1013,6 +1000,14 @@ public: }; //------------------------------accessors-------------------------------------- +inline bool Type::is_ptr_to_narrowoop() const { +#ifdef _LP64 + return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv()); +#else + return false; +#endif +} + inline float Type::getf() const { assert( _base == FloatCon, "Not a FloatCon" ); return ((TypeF*)this)->_f; @@ -1138,6 +1133,16 @@ inline const TypeKlassPtr *Type::is_klassptr() const { return (TypeKlassPtr*)this; } +inline const TypePtr* Type::make_ptr() const { + return (_base == NarrowOop) ? is_narrowoop()->make_oopptr() : + (isa_ptr() ? is_ptr() : NULL); +} + +inline const TypeNarrowOop* Type::make_narrowoop() const { + return (_base == NarrowOop) ? is_narrowoop() : + (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL); +} + inline bool Type::is_floatingpoint() const { if( (_base == FloatCon) || (_base == FloatBot) || (_base == DoubleCon) || (_base == DoubleBot) ) diff --git a/hotspot/src/share/vm/opto/vectornode.cpp b/hotspot/src/share/vm/opto/vectornode.cpp index 7a581282d9c..bf2cdc81ac8 100644 --- a/hotspot/src/share/vm/opto/vectornode.cpp +++ b/hotspot/src/share/vm/opto/vectornode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/opto/vectornode.hpp b/hotspot/src/share/vm/opto/vectornode.hpp index ed442b973ba..41f71421c6b 100644 --- a/hotspot/src/share/vm/opto/vectornode.hpp +++ b/hotspot/src/share/vm/opto/vectornode.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index 70f785d80b4..146bb854993 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 91fb8cb3c17..49ace5c9823 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -631,7 +631,7 @@ JNI_ENTRY(void, jni_FatalError(JNIEnv *env, const char *msg)) DTRACE_PROBE2(hotspot_jni, FatalError__entry, env, msg); tty->print_cr("FATAL ERROR in native method: %s", msg); thread->print_stack(); - os::abort(false); // Prevent core dump, causes a jck failure. + os::abort(); // Dump core and abort JNI_END @@ -2173,8 +2173,7 @@ static char* get_bad_address() { size_t size = os::vm_allocation_granularity(); bad_address = os::reserve_memory(size); if (bad_address != NULL) { - os::commit_memory(bad_address, size); - os::protect_memory(bad_address, size); + os::protect_memory(bad_address, size, os::MEM_PROT_READ); } } return bad_address; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index deaba3a9ed7..75becdfb25e 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -624,6 +624,30 @@ JVM_ENTRY(void, JVM_ResolveClass(JNIEnv* env, jclass cls)) if (PrintJVMWarnings) warning("JVM_ResolveClass not implemented"); JVM_END +// Rationale behind JVM_FindClassFromBootLoader +// a> JVM_FindClassFromClassLoader was never exported in the export tables. +// b> because of (a) java.dll has a direct dependecy on the unexported +// private symbol "_JVM_FindClassFromClassLoader@20". +// c> the launcher cannot use the private symbol as it dynamically opens +// the entry point, so if something changes, the launcher will fail +// unexpectedly at runtime, it is safest for the launcher to dlopen a +// stable exported interface. +// d> re-exporting JVM_FindClassFromClassLoader as public, will cause its +// signature to change from _JVM_FindClassFromClassLoader@20 to +// JVM_FindClassFromClassLoader and will not be backward compatible +// with older JDKs. +// Thus a public/stable exported entry point is the right solution, +// public here means public in linker semantics, and is exported only +// to the JDK, and is not intended to be a public API. + +JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env, + const char* name, + jboolean throwError)) + JVMWrapper3("JVM_FindClassFromBootLoader %s throw %s", name, + throwError ? "error" : "exception"); + return JVM_FindClassFromClassLoader(env, name, JNI_FALSE, + (jobject)NULL, throwError); +JVM_END JVM_ENTRY(jclass, JVM_FindClassFromClassLoader(JNIEnv* env, const char* name, jboolean init, jobject loader, diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index feaf0d4a13f..131e0ddc92b 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -389,6 +389,17 @@ JNIEXPORT jclass JNICALL JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init, jobject loader, jboolean throwError); +/* + * Find a class from a boot class loader. Throw ClassNotFoundException + * or NoClassDefFoundError depending on the value of the last + * argument. This is the same as FindClassFromClassLoader but provided + * as a convenience method exported correctly on all platforms for + * JSR 277 launcher class loading. + */ +JNIEXPORT jclass JNICALL +JVM_FindClassFromBootLoader(JNIEnv *env, const char *name, + jboolean throwError); + /* * Find a class from a given class. */ diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp b/hotspot/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp index ed0f472b3d4..83192cf16d7 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClassesTrace.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index 30d9fee4611..96db99c4112 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index 899a99296be..dbdbcead8fc 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index aa8331bfd40..882e92b337d 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1174,9 +1174,10 @@ void Arguments::set_ergonomics_flags() { // field offset to determine free list chunk markers. // Check that UseCompressedOops can be set with the max heap size allocated // by ergonomics. - if (!UseConcMarkSweepGC && MaxHeapSize <= max_heap_for_compressed_oops()) { + if (MaxHeapSize <= max_heap_for_compressed_oops()) { if (FLAG_IS_DEFAULT(UseCompressedOops)) { - FLAG_SET_ERGO(bool, UseCompressedOops, true); + // Turn off until bug is fixed. + // FLAG_SET_ERGO(bool, UseCompressedOops, true); } } else { if (UseCompressedOops && !FLAG_IS_DEFAULT(UseCompressedOops)) { @@ -1312,6 +1313,9 @@ void Arguments::set_aggressive_opts_flags() { if (AggressiveOpts && FLAG_IS_DEFAULT(DoEscapeAnalysis)) { FLAG_SET_DEFAULT(DoEscapeAnalysis, true); } + if (AggressiveOpts && FLAG_IS_DEFAULT(SpecialArraysEquals)) { + FLAG_SET_DEFAULT(SpecialArraysEquals, true); + } #endif if (AggressiveOpts) { diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index b806f4800f8..bbc91c89c95 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/atomic.cpp b/hotspot/src/share/vm/runtime/atomic.cpp index 847cf086196..0475f6242b7 100644 --- a/hotspot/src/share/vm/runtime/atomic.cpp +++ b/hotspot/src/share/vm/runtime/atomic.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/runtime/atomic.hpp b/hotspot/src/share/vm/runtime/atomic.hpp index a8b7dfa7ab9..c54103cbd49 100644 --- a/hotspot/src/share/vm/runtime/atomic.hpp +++ b/hotspot/src/share/vm/runtime/atomic.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/hotspot/src/share/vm/runtime/biasedLocking.cpp b/hotspot/src/share/vm/runtime/biasedLocking.cpp index 64807d8b75d..a16a96dfdb6 100644 --- a/hotspot/src/share/vm/runtime/biasedLocking.cpp +++ b/hotspot/src/share/vm/runtime/biasedLocking.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index ccca77a5e13..e18f38ef6c5 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/deoptimization.hpp b/hotspot/src/share/vm/runtime/deoptimization.hpp index 6edb6a08936..7f00eba27df 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.hpp +++ b/hotspot/src/share/vm/runtime/deoptimization.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp index 57095dec4ed..406c4e6c0be 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.cpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp index 37b18b04f00..cfbe43d0dff 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/fprofiler.cpp b/hotspot/src/share/vm/runtime/fprofiler.cpp index 31f11617824..adecc642de4 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.cpp +++ b/hotspot/src/share/vm/runtime/fprofiler.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/fprofiler.hpp b/hotspot/src/share/vm/runtime/fprofiler.hpp index 371358dca13..ff9ce96e8ce 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.hpp +++ b/hotspot/src/share/vm/runtime/fprofiler.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index 4db33fc54a3..6baf659d0ff 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index ec13e57a296..35372751894 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/globals.cpp b/hotspot/src/share/vm/runtime/globals.cpp index ffd62d14a66..5adadcb98b5 100644 --- a/hotspot/src/share/vm/runtime/globals.cpp +++ b/hotspot/src/share/vm/runtime/globals.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 5b2c1fda1d6..8d797953cd5 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -291,6 +291,9 @@ class CommandLineFlags { "Use 32-bit object references in 64-bit VM. " \ "lp64_product means flag is always constant in 32 bit VM") \ \ + lp64_product(bool, CheckCompressedOops, trueInDebug, \ + "generate checks in encoding/decoding code") \ + \ /* UseMembar is theoretically a temp flag used for memory barrier \ * removal testing. It was supposed to be removed before FCS but has \ * been re-added (see 6401008) */ \ @@ -457,6 +460,9 @@ class CommandLineFlags { develop(bool, SpecialStringIndexOf, true, \ "special version of string indexOf") \ \ + product(bool, SpecialArraysEquals, false, \ + "special version of Arrays.equals(char[],char[])") \ + \ develop(bool, TraceCallFixup, false, \ "traces all call fixups") \ \ @@ -940,6 +946,9 @@ class CommandLineFlags { diagnostic(bool, UseIncDec, true, \ "Use INC, DEC instructions on x86") \ \ + product(bool, UseNewLongLShift, false, \ + "Use optimized bitwise shift left") \ + \ product(bool, UseStoreImmI16, true, \ "Use store immediate 16-bits value instruction on x86") \ \ @@ -2240,6 +2249,9 @@ class CommandLineFlags { product(bool, AggressiveOpts, false, \ "Enable aggressive optimizations - see arguments.cpp") \ \ + product(bool, UseStringCache, false, \ + "Enable String cache capabilities on String.java") \ + \ /* statistics */ \ develop(bool, UseVTune, false, \ "enable support for Intel's VTune profiler") \ diff --git a/hotspot/src/share/vm/runtime/globals_extension.hpp b/hotspot/src/share/vm/runtime/globals_extension.hpp index ffb8071b250..1d9dc0387ca 100644 --- a/hotspot/src/share/vm/runtime/globals_extension.hpp +++ b/hotspot/src/share/vm/runtime/globals_extension.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/runtime/hpi.cpp b/hotspot/src/share/vm/runtime/hpi.cpp index 1b8e361df86..77483de0967 100644 --- a/hotspot/src/share/vm/runtime/hpi.cpp +++ b/hotspot/src/share/vm/runtime/hpi.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/runtime/hpi.hpp b/hotspot/src/share/vm/runtime/hpi.hpp index 00fc21c90a5..1e05ca7525a 100644 --- a/hotspot/src/share/vm/runtime/hpi.hpp +++ b/hotspot/src/share/vm/runtime/hpi.hpp @@ -66,6 +66,8 @@ public: static inline int socket_shutdown(int fd, int howto); static inline int recv(int fd, char *buf, int nBytes, int flags); static inline int send(int fd, char *buf, int nBytes, int flags); + // Variant of send that doesn't support interruptible I/O + static inline int raw_send(int fd, char *buf, int nBytes, int flags); static inline int timeout(int fd, long timeout); static inline int listen(int fd, int count); static inline int connect(int fd, struct sockaddr *him, int len); diff --git a/hotspot/src/share/vm/runtime/init.cpp b/hotspot/src/share/vm/runtime/init.cpp index dfadab63012..4851d19a15a 100644 --- a/hotspot/src/share/vm/runtime/init.cpp +++ b/hotspot/src/share/vm/runtime/init.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index a9f6fc7db02..4e0ba39e629 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -502,9 +502,9 @@ void vm_shutdown() os::shutdown(); } -void vm_abort() { +void vm_abort(bool dump_core) { vm_perform_shutdown_actions(); - os::abort(PRODUCT_ONLY(false)); + os::abort(dump_core); ShouldNotReachHere(); } @@ -538,18 +538,24 @@ void vm_exit_during_initialization(Handle exception) { java_lang_Throwable::print_stack_trace(exception(), tty); tty->cr(); vm_notify_during_shutdown(NULL, NULL); - vm_abort(); + + // Failure during initialization, we don't want to dump core + vm_abort(false); } void vm_exit_during_initialization(symbolHandle ex, const char* message) { ResourceMark rm; vm_notify_during_shutdown(ex->as_C_string(), message); - vm_abort(); + + // Failure during initialization, we don't want to dump core + vm_abort(false); } void vm_exit_during_initialization(const char* error, const char* message) { vm_notify_during_shutdown(error, message); - vm_abort(); + + // Failure during initialization, we don't want to dump core + vm_abort(false); } void vm_shutdown_during_initialization(const char* error, const char* message) { diff --git a/hotspot/src/share/vm/runtime/java.hpp b/hotspot/src/share/vm/runtime/java.hpp index e3ce6d41997..160c62bb26a 100644 --- a/hotspot/src/share/vm/runtime/java.hpp +++ b/hotspot/src/share/vm/runtime/java.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -37,7 +37,7 @@ extern void vm_direct_exit(int code); // Shutdown the VM but do not exit the process extern void vm_shutdown(); // Shutdown the VM and abort the process -extern void vm_abort(); +extern void vm_abort(bool dump_core=true); // Trigger any necessary notification of the VM being shutdown extern void notify_vm_shutdown(); @@ -68,8 +68,24 @@ class JDK_Version : AllStatic { static bool is_jdk13x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 3; } static bool is_jdk14x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 4; } static bool is_jdk15x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 5; } - static bool is_jdk16x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 6; } - static bool is_jdk17x_version() { assert(is_jdk_version_initialized(), "must have been initialized"); return _jdk_version == 7; } + + static bool is_jdk16x_version() { + if (is_jdk_version_initialized()) { + return _jdk_version == 6; + } else { + assert(is_pre_jdk16_version(), "must have been initialized"); + return false; + } + } + + static bool is_jdk17x_version() { + if (is_jdk_version_initialized()) { + return _jdk_version == 7; + } else { + assert(is_pre_jdk16_version(), "must have been initialized"); + return false; + } + } static bool supports_thread_park_blocker() { return _version_info.thread_park_blocker; } @@ -85,14 +101,22 @@ class JDK_Version : AllStatic { } static bool is_gte_jdk16x_version() { // Keep the semantics of this that the version number is >= 1.6 - assert(is_jdk_version_initialized(), "Not initialized"); - return _jdk_version >= 6; + if (is_jdk_version_initialized()) { + return _jdk_version >= 6; + } else { + assert(is_pre_jdk16_version(), "Not initialized"); + return false; + } } static bool is_gte_jdk17x_version() { // Keep the semantics of this that the version number is >= 1.7 - assert(is_jdk_version_initialized(), "Not initialized"); - return _jdk_version >= 7; + if (is_jdk_version_initialized()) { + return _jdk_version >= 7; + } else { + assert(is_pre_jdk16_version(), "Not initialized"); + return false; + } } static bool is_jdk_version_initialized() { diff --git a/hotspot/src/share/vm/runtime/jniHandles.cpp b/hotspot/src/share/vm/runtime/jniHandles.cpp index 6f91a4daef4..ef0d809471c 100644 --- a/hotspot/src/share/vm/runtime/jniHandles.cpp +++ b/hotspot/src/share/vm/runtime/jniHandles.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp index c8751c2121c..9804bee0403 100644 --- a/hotspot/src/share/vm/runtime/mutex.cpp +++ b/hotspot/src/share/vm/runtime/mutex.cpp @@ -1,6 +1,6 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/runtime/mutex.hpp b/hotspot/src/share/vm/runtime/mutex.hpp index 56988e20e79..edebb8800ae 100644 --- a/hotspot/src/share/vm/runtime/mutex.hpp +++ b/hotspot/src/share/vm/runtime/mutex.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index a639519d26d..bc61fd22dc4 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index e21367cb960..244fb33e503 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 164ba95a105..f276e7e7250 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -922,8 +922,9 @@ void os::serialize_thread_states() { // time and expensive page trap spinning, 'SerializePageLock' is used to block // the mutator thread if such case is encountered. See bug 6546278 for details. Thread::muxAcquire(&SerializePageLock, "serialize_thread_states"); - os::protect_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); - os::unguard_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() ); + os::protect_memory((char *)os::get_memory_serialize_page(), + os::vm_page_size(), MEM_PROT_READ, /*is_committed*/true ); + os::unguard_memory((char *)os::get_memory_serialize_page(), os::vm_page_size()); Thread::muxRelease(&SerializePageLock); } diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 547b25d434c..0b8cea57884 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -193,7 +193,11 @@ class os: AllStatic { static bool commit_memory(char* addr, size_t size, size_t alignment_hint); static bool uncommit_memory(char* addr, size_t bytes); static bool release_memory(char* addr, size_t bytes); - static bool protect_memory(char* addr, size_t bytes); + + enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX }; + static bool protect_memory(char* addr, size_t bytes, ProtType prot, + bool is_committed = false); + static bool guard_memory(char* addr, size_t bytes); static bool unguard_memory(char* addr, size_t bytes); static char* map_memory(int fd, const char* file_name, size_t file_offset, diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index ebe0899a148..d57b6670df1 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 59219cda39d..39ac102ec00 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index 22bb552ddc9..a785955d44c 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp index 9b54e95eaa1..885edecc0d4 100644 --- a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/task.cpp b/hotspot/src/share/vm/runtime/task.cpp index 68959a120d2..056f6f33558 100644 --- a/hotspot/src/share/vm/runtime/task.cpp +++ b/hotspot/src/share/vm/runtime/task.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/task.hpp b/hotspot/src/share/vm/runtime/task.hpp index 83e595cf30d..5b69a04373f 100644 --- a/hotspot/src/share/vm/runtime/task.hpp +++ b/hotspot/src/share/vm/runtime/task.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 21f8a4b76ee..c488b3f2c52 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -2926,21 +2926,42 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { } if (AggressiveOpts) { - // Forcibly initialize java/util/HashMap and mutate the private - // static final "frontCacheEnabled" field before we start creating instances + { + // Forcibly initialize java/util/HashMap and mutate the private + // static final "frontCacheEnabled" field before we start creating instances #ifdef ASSERT - klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); - assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); + klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); + assert(tmp_k == NULL, "java/util/HashMap should not be loaded yet"); #endif - klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); - KlassHandle k = KlassHandle(THREAD, k_o); - guarantee(k.not_null(), "Must find java/util/HashMap"); - instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); - ik->initialize(CHECK_0); - fieldDescriptor fd; - // Possible we might not find this field; if so, don't break - if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { - k()->bool_field_put(fd.offset(), true); + klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_util_HashMap(), Handle(), Handle(), CHECK_0); + KlassHandle k = KlassHandle(THREAD, k_o); + guarantee(k.not_null(), "Must find java/util/HashMap"); + instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); + ik->initialize(CHECK_0); + fieldDescriptor fd; + // Possible we might not find this field; if so, don't break + if (ik->find_local_field(vmSymbols::frontCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { + k()->bool_field_put(fd.offset(), true); + } + } + + if (UseStringCache) { + // Forcibly initialize java/lang/String and mutate the private + // static final "stringCacheEnabled" field before we start creating instances +#ifdef ASSERT + klassOop tmp_k = SystemDictionary::find(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0); + assert(tmp_k == NULL, "java/lang/String should not be loaded yet"); +#endif + klassOop k_o = SystemDictionary::resolve_or_null(vmSymbolHandles::java_lang_String(), Handle(), Handle(), CHECK_0); + KlassHandle k = KlassHandle(THREAD, k_o); + guarantee(k.not_null(), "Must find java/lang/String"); + instanceKlassHandle ik = instanceKlassHandle(THREAD, k()); + ik->initialize(CHECK_0); + fieldDescriptor fd; + // Possible we might not find this field; if so, don't break + if (ik->find_local_field(vmSymbols::stringCacheEnabled_name(), vmSymbols::bool_signature(), &fd)) { + k()->bool_field_put(fd.offset(), true); + } } } diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp index 3e9b65bfc03..ce5a71517f3 100644 --- a/hotspot/src/share/vm/runtime/vframe.cpp +++ b/hotspot/src/share/vm/runtime/vframe.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 670e6c5d192..febfb02cb46 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/vframe_hp.cpp b/hotspot/src/share/vm/runtime/vframe_hp.cpp index 35f0713a23f..5f781f39c47 100644 --- a/hotspot/src/share/vm/runtime/vframe_hp.cpp +++ b/hotspot/src/share/vm/runtime/vframe_hp.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp index 23b75dc9dd4..44471632df6 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -28,12 +28,15 @@ // ReservedSpace ReservedSpace::ReservedSpace(size_t size) { - initialize(size, 0, false, NULL); + initialize(size, 0, false, NULL, 0); } ReservedSpace::ReservedSpace(size_t size, size_t alignment, - bool large, char* requested_address) { - initialize(size, alignment, large, requested_address); + bool large, + char* requested_address, + const size_t noaccess_prefix) { + initialize(size+noaccess_prefix, alignment, large, requested_address, + noaccess_prefix); } char * @@ -105,7 +108,8 @@ char* ReservedSpace::reserve_and_align(const size_t reserve_size, ReservedSpace::ReservedSpace(const size_t prefix_size, const size_t prefix_align, const size_t suffix_size, - const size_t suffix_align) + const size_t suffix_align, + const size_t noaccess_prefix) { assert(prefix_size != 0, "sanity"); assert(prefix_align != 0, "sanity"); @@ -118,12 +122,16 @@ ReservedSpace::ReservedSpace(const size_t prefix_size, assert((suffix_align & prefix_align - 1) == 0, "suffix_align not divisible by prefix_align"); + // Add in noaccess_prefix to prefix_size; + const size_t adjusted_prefix_size = prefix_size + noaccess_prefix; + const size_t size = adjusted_prefix_size + suffix_size; + // On systems where the entire region has to be reserved and committed up // front, the compound alignment normally done by this method is unnecessary. const bool try_reserve_special = UseLargePages && prefix_align == os::large_page_size(); if (!os::can_commit_large_page_memory() && try_reserve_special) { - initialize(prefix_size + suffix_size, prefix_align, true); + initialize(size, prefix_align, true, NULL, noaccess_prefix); return; } @@ -131,15 +139,19 @@ ReservedSpace::ReservedSpace(const size_t prefix_size, _size = 0; _alignment = 0; _special = false; + _noaccess_prefix = 0; + + // Assert that if noaccess_prefix is used, it is the same as prefix_align. + assert(noaccess_prefix == 0 || + noaccess_prefix == prefix_align, "noaccess prefix wrong"); // Optimistically try to reserve the exact size needed. - const size_t size = prefix_size + suffix_size; char* addr = os::reserve_memory(size, NULL, prefix_align); if (addr == NULL) return; // Check whether the result has the needed alignment (unlikely unless // prefix_align == suffix_align). - const size_t ofs = size_t(addr) + prefix_size & suffix_align - 1; + const size_t ofs = size_t(addr) + adjusted_prefix_size & suffix_align - 1; if (ofs != 0) { // Wrong alignment. Release, allocate more space and do manual alignment. // @@ -153,11 +165,11 @@ ReservedSpace::ReservedSpace(const size_t prefix_size, } const size_t extra = MAX2(ofs, suffix_align - ofs); - addr = reserve_and_align(size + extra, prefix_size, prefix_align, + addr = reserve_and_align(size + extra, adjusted_prefix_size, prefix_align, suffix_size, suffix_align); if (addr == NULL) { // Try an even larger region. If this fails, address space is exhausted. - addr = reserve_and_align(size + suffix_align, prefix_size, + addr = reserve_and_align(size + suffix_align, adjusted_prefix_size, prefix_align, suffix_size, suffix_align); } } @@ -165,10 +177,12 @@ ReservedSpace::ReservedSpace(const size_t prefix_size, _base = addr; _size = size; _alignment = prefix_align; + _noaccess_prefix = noaccess_prefix; } void ReservedSpace::initialize(size_t size, size_t alignment, bool large, - char* requested_address) { + char* requested_address, + const size_t noaccess_prefix) { const size_t granularity = os::vm_allocation_granularity(); assert((size & granularity - 1) == 0, "size not aligned to os::vm_allocation_granularity()"); @@ -181,6 +195,7 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, _size = 0; _special = false; _alignment = 0; + _noaccess_prefix = 0; if (size == 0) { return; } @@ -220,7 +235,8 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, // important. If available space is not detected, return NULL. if (requested_address != 0) { - base = os::attempt_reserve_memory_at(size, requested_address); + base = os::attempt_reserve_memory_at(size, + requested_address-noaccess_prefix); } else { base = os::reserve_memory(size, NULL, alignment); } @@ -259,6 +275,11 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, _base = base; _size = size; _alignment = MAX2(alignment, (size_t) os::vm_page_size()); + _noaccess_prefix = noaccess_prefix; + + // Assert that if noaccess_prefix is used, it is the same as alignment. + assert(noaccess_prefix == 0 || + noaccess_prefix == _alignment, "noaccess prefix wrong"); assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base, "area must be distinguisable from marks for mark-sweep"); @@ -274,6 +295,7 @@ ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, _base = base; _size = size; _alignment = alignment; + _noaccess_prefix = 0; _special = special; } @@ -320,17 +342,58 @@ size_t ReservedSpace::allocation_align_size_down(size_t size) { void ReservedSpace::release() { if (is_reserved()) { + char *real_base = _base - _noaccess_prefix; + const size_t real_size = _size + _noaccess_prefix; if (special()) { - os::release_memory_special(_base, _size); + os::release_memory_special(real_base, real_size); } else{ - os::release_memory(_base, _size); + os::release_memory(real_base, real_size); } _base = NULL; _size = 0; + _noaccess_prefix = 0; _special = false; } } +void ReservedSpace::protect_noaccess_prefix(const size_t size) { + // If there is noaccess prefix, return. + if (_noaccess_prefix == 0) return; + + assert(_noaccess_prefix >= (size_t)os::vm_page_size(), + "must be at least page size big"); + + // Protect memory at the base of the allocated region. + // If special, the page was committed (only matters on windows) + if (!os::protect_memory(_base, _noaccess_prefix, os::MEM_PROT_NONE, + _special)) { + fatal("cannot protect protection page"); + } + + _base += _noaccess_prefix; + _size -= _noaccess_prefix; + assert((size == _size) && ((uintptr_t)_base % _alignment == 0), + "must be exactly of required size and alignment"); +} + +ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment, + bool large, char* requested_address) : + ReservedSpace(size, alignment, large, + requested_address, + UseCompressedOops ? lcm(os::vm_page_size(), alignment) : 0) { + // Only reserved space for the java heap should have a noaccess_prefix + // if using compressed oops. + protect_noaccess_prefix(size); +} + +ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size, + const size_t prefix_align, + const size_t suffix_size, + const size_t suffix_align) : + ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align, + UseCompressedOops ? lcm(os::vm_page_size(), prefix_align) : 0) { + protect_noaccess_prefix(prefix_size+suffix_size); +} // VirtualSpace @@ -348,6 +411,7 @@ VirtualSpace::VirtualSpace() { _lower_alignment = 0; _middle_alignment = 0; _upper_alignment = 0; + _special = false; } @@ -402,7 +466,8 @@ VirtualSpace::~VirtualSpace() { void VirtualSpace::release() { - (void)os::release_memory(low_boundary(), reserved_size()); + // This does not release memory it never reserved. + // Caller must release via rs.release(); _low_boundary = NULL; _high_boundary = NULL; _low = NULL; diff --git a/hotspot/src/share/vm/runtime/virtualspace.hpp b/hotspot/src/share/vm/runtime/virtualspace.hpp index ad952e49a3d..556b4c92bb6 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.hpp +++ b/hotspot/src/share/vm/runtime/virtualspace.hpp @@ -29,13 +29,15 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC { private: char* _base; size_t _size; + size_t _noaccess_prefix; size_t _alignment; bool _special; // ReservedSpace ReservedSpace(char* base, size_t size, size_t alignment, bool special); void initialize(size_t size, size_t alignment, bool large, - char* requested_address = NULL); + char* requested_address, + const size_t noaccess_prefix); // Release parts of an already-reserved memory region [addr, addr + len) to // get a new region that has "compound alignment." Return the start of the @@ -59,13 +61,19 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC { const size_t suffix_size, const size_t suffix_align); + protected: + // Create protection page at the beginning of the space. + void protect_noaccess_prefix(const size_t size); + public: // Constructor ReservedSpace(size_t size); ReservedSpace(size_t size, size_t alignment, bool large, - char* requested_address = NULL); + char* requested_address = NULL, + const size_t noaccess_prefix = 0); ReservedSpace(const size_t prefix_size, const size_t prefix_align, - const size_t suffix_size, const size_t suffix_align); + const size_t suffix_size, const size_t suffix_align, + const size_t noaccess_prefix); // Accessors char* base() const { return _base; } @@ -73,6 +81,8 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC { size_t alignment() const { return _alignment; } bool special() const { return _special; } + size_t noaccess_prefix() const { return _noaccess_prefix; } + bool is_reserved() const { return _base != NULL; } void release(); @@ -104,6 +114,16 @@ ReservedSpace ReservedSpace::last_part(size_t partition_size) return last_part(partition_size, alignment()); } +// Class encapsulating behavior specific of memory space reserved for Java heap +class ReservedHeapSpace : public ReservedSpace { +public: + // Constructor + ReservedHeapSpace(size_t size, size_t forced_base_alignment, + bool large, char* requested_address); + ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align, + const size_t suffix_size, const size_t suffix_align); +}; + // VirtualSpace is data structure for committing a previously reserved address range in smaller chunks. class VirtualSpace VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 561389eaa92..eeda67501aa 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -894,6 +894,7 @@ static inline uint64_t cast_uint64_t(size_t x) /*******************************************************************/ \ \ declare_unsigned_integer_type(size_t) \ + declare_integer_type(ssize_t) \ declare_unsigned_integer_type(const size_t) \ declare_integer_type(intx) \ declare_integer_type(intptr_t) \ @@ -1694,7 +1695,12 @@ static inline uint64_t cast_uint64_t(size_t x) declare_constant(markOopDesc::no_hash) \ declare_constant(markOopDesc::no_hash_in_place) \ declare_constant(markOopDesc::no_lock_in_place) \ - declare_constant(markOopDesc::max_age) + declare_constant(markOopDesc::max_age) \ + \ + /* Constants in markOop used by CMS. */ \ + declare_constant(markOopDesc::cms_shift) \ + declare_constant(markOopDesc::cms_mask) \ + declare_constant(markOopDesc::size_shift) \ /* NOTE that we do not use the last_entry() macro here; it is used */ /* in vmStructs__.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and */ @@ -1958,6 +1964,7 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { GENERATE_STATIC_VM_STRUCT_ENTRY) VM_STRUCTS_CMS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ + GENERATE_NONSTATIC_VM_STRUCT_ENTRY, \ GENERATE_STATIC_VM_STRUCT_ENTRY) #endif // SERIALGC @@ -2099,6 +2106,7 @@ VMStructs::init() { CHECK_STATIC_VM_STRUCT_ENTRY); VM_STRUCTS_CMS(CHECK_NONSTATIC_VM_STRUCT_ENTRY, + CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY, CHECK_STATIC_VM_STRUCT_ENTRY); #endif // SERIALGC @@ -2203,6 +2211,7 @@ VMStructs::init() { debug_only(VM_STRUCTS_PARALLELGC(ENSURE_FIELD_TYPE_PRESENT, \ ENSURE_FIELD_TYPE_PRESENT)); debug_only(VM_STRUCTS_CMS(ENSURE_FIELD_TYPE_PRESENT, \ + ENSURE_FIELD_TYPE_PRESENT, \ ENSURE_FIELD_TYPE_PRESENT)); #endif // SERIALGC debug_only(VM_STRUCTS_CPU(ENSURE_FIELD_TYPE_PRESENT, \ diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index 54264ad0dde..673ba2bbd63 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index 9c335eb44b3..653309db0ac 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 5a46f04fb1d..f3ae4385bc7 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index 1a30c05b5c1..4ad842ad747 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index 396f6204de9..5084dbf0b4e 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp index f3f84d0f21e..8122011ac40 100644 --- a/hotspot/src/share/vm/utilities/copy.hpp +++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 05360107789..e395102a666 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -208,7 +208,9 @@ void report_vm_out_of_memory(const char* file_name, int line_no, size_t size, co Thread* thread = ThreadLocalStorage::get_thread_slow(); VMError(thread, size, message, file_name, line_no).report_and_die(); } - vm_abort(); + + // Dump core and abort + vm_abort(true); } void report_vm_out_of_memory_vararg(const char* file_name, int line_no, size_t size, const char* format, ...) { diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.cpp b/hotspot/src/share/vm/utilities/globalDefinitions.cpp index acb8875acca..0bc9ba7692b 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.cpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index c46312f49d7..0eeb5dbe3d4 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp index a5629b2f826..f25364b72bf 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_sparcWorks.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index f50e8ba0a07..6839c78ba95 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -753,21 +753,28 @@ void staticBufferStream::vprint_cr(const char* format, va_list argptr) { write(str, len); } -bufferedStream::bufferedStream(size_t initial_size) : outputStream() { +bufferedStream::bufferedStream(size_t initial_size, size_t bufmax) : outputStream() { buffer_length = initial_size; buffer = NEW_C_HEAP_ARRAY(char, buffer_length); buffer_pos = 0; buffer_fixed = false; + buffer_max = bufmax; } -bufferedStream::bufferedStream(char* fixed_buffer, size_t fixed_buffer_size) : outputStream() { +bufferedStream::bufferedStream(char* fixed_buffer, size_t fixed_buffer_size, size_t bufmax) : outputStream() { buffer_length = fixed_buffer_size; buffer = fixed_buffer; buffer_pos = 0; buffer_fixed = true; + buffer_max = bufmax; } void bufferedStream::write(const char* s, size_t len) { + + if(buffer_pos + len > buffer_max) { + flush(); + } + size_t end = buffer_pos + len; if (end >= buffer_length) { if (buffer_fixed) { @@ -811,7 +818,7 @@ bufferedStream::~bufferedStream() { #endif // Network access -networkStream::networkStream() { +networkStream::networkStream() : bufferedStream(1024*10, 1024*10) { _socket = -1; @@ -831,7 +838,9 @@ int networkStream::read(char *buf, size_t len) { void networkStream::flush() { if (size() != 0) { - hpi::send(_socket, (char *)base(), (int)size(), 0); + int result = hpi::raw_send(_socket, (char *)base(), (int)size(), 0); + assert(result != -1, "connection error"); + assert(result == (int)size(), "didn't send enough data"); } reset(); } diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp index 7232b485096..b69fac590c8 100644 --- a/hotspot/src/share/vm/utilities/ostream.hpp +++ b/hotspot/src/share/vm/utilities/ostream.hpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -206,11 +206,12 @@ class bufferedStream : public outputStream { protected: char* buffer; size_t buffer_pos; + size_t buffer_max; size_t buffer_length; bool buffer_fixed; public: - bufferedStream(size_t initial_bufsize = 256); - bufferedStream(char* fixed_buffer, size_t fixed_buffer_size); + bufferedStream(size_t initial_bufsize = 256, size_t bufmax = 1024*1024*10); + bufferedStream(char* fixed_buffer, size_t fixed_buffer_size, size_t bufmax = 1024*1024*10); ~bufferedStream(); virtual void write(const char* c, size_t len); size_t size() { return buffer_pos; } diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp index 6e883d9e673..3221ddaacc8 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index f8df9042128..71ab720f028 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/hotspot/src/share/vm/utilities/xmlstream.cpp b/hotspot/src/share/vm/utilities/xmlstream.cpp index b7098c857aa..3f03a442773 100644 --- a/hotspot/src/share/vm/utilities/xmlstream.cpp +++ b/hotspot/src/share/vm/utilities/xmlstream.cpp @@ -59,6 +59,7 @@ void xmlStream::write(const char* s, size_t len) { if (!is_open()) return; out()->write(s, len); + update_position(s, len); } diff --git a/hotspot/test/compiler/6659207/Test.java b/hotspot/test/compiler/6659207/Test.java index 3c729758ef4..c684573a547 100644 --- a/hotspot/test/compiler/6659207/Test.java +++ b/hotspot/test/compiler/6659207/Test.java @@ -1,23 +1,24 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - * - * - * - * - * - * - * - * - * - * - * - * - * + * 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. * + * 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. * */ diff --git a/hotspot/test/compiler/6661247/Test.java b/hotspot/test/compiler/6661247/Test.java index 7a9f4318d54..b702f8d9837 100644 --- a/hotspot/test/compiler/6661247/Test.java +++ b/hotspot/test/compiler/6661247/Test.java @@ -1,23 +1,24 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - * - * - * - * - * - * - * - * - * - * - * - * - * + * 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. * + * 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. * */ diff --git a/hotspot/test/compiler/6663621/IVTest.java b/hotspot/test/compiler/6663621/IVTest.java index 7374f08c203..c0a1ab54afb 100644 --- a/hotspot/test/compiler/6663621/IVTest.java +++ b/hotspot/test/compiler/6663621/IVTest.java @@ -1,23 +1,24 @@ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. - * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. - * - * - * - * - * - * - * - * - * - * - * - * - * + * 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. * + * 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. * */ diff --git a/hotspot/test/compiler/6689060/Test.java b/hotspot/test/compiler/6689060/Test.java new file mode 100644 index 00000000000..f6361aee067 --- /dev/null +++ b/hotspot/test/compiler/6689060/Test.java @@ -0,0 +1,577 @@ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/* + * @test + * @bug 6689060 + * @summary Escape Analysis does not work with Compressed Oops + * @run main/othervm -Xbatch -XX:CompileCommand=exclude,Test.dummy -XX:+AggressiveOpts Test + */ + +import java.lang.reflect.Array; + +class Point { + int x; + int y; + Point next; + int ax[]; + int ay[]; + Point pax[]; + Point pay[]; + public Point getNext() { + return next; + } +} + +public class Test { + + void dummy() { + // Empty method to verify correctness of DebugInfo. + // Use -XX:CompileCommand=exclude,Test.dummy + } + + int ival(int i) { + return i*2; + } + + int test80(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[2]; + p.ay = new int[2]; + int x = 3; + p.ax[0] = x; + p.ay[1] = 3 * x + y; + dummy(); + return p.ax[0] * p.ay[1]; + } + + int test81(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[2]; + p.ay = new int[2]; + int x = 3; + p.ax[0] = x; + p.ay[1] = 3 * x + y; + dummy(); + return p.ax[0] * p.ay[1]; + } + + + int test44(int y) { + Point p1 = new Point(); + p1.x = ival(3); + dummy(); + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test43(int y) { + Point p1 = new Point(); + if ( (y & 1) == 1 ) { + p1.x = ival(3); + } else { + p1.x = ival(5); + } + dummy(); + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test42(int y) { + Point p1 = new Point(); + p1.x = 3; + for (int i = 0; i < y; i++) { + if ( (i & 1) == 1 ) { + p1.x += 4; + } + } + p1.y = 3 * y + p1.x; + return p1.y; + } + + int test40(int y) { + Point p1 = new Point(); + if ( (y & 1) == 1 ) { + p1.x = 3; + } else { + p1.x = 5; + } + p1.y = 3 * p1.x + y; + return p1.y; + } + + int test41(int y) { + Point p1 = new Point(); + if ( (y & 1) == 1 ) { + p1.x += 4; + } else { + p1.x += 5; + } + p1.y = 3 * p1.x + y; + return p1.y; + } + + Point test00(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + return p; + } + + Point test01(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + dummy(); + return p; + } + + Point test02(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + p1 = p2; + } + return p1; + } + + Point test03(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + p1 = p2; + } + dummy(); + return p1; + } + + Point test04(int y) { + int x = 3; + Point p1 = null; + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p2.next = p1; + dummy(); + p1 = p2; + } + return p1; + } + + int test05(int y) { + int x = 3; + Point p1 = new Point(); + for (int i = 0; i < y; i++) { + Point p2 = new Point(); + p2.x = x; + p2.y = 3 * y + x; + p1.next = p2; + p1 = p2; + } + return p1.y; + } + + int test0(int y) { + int x = 3; + Point p = new Point(); + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; + } + + int test1(int y) { + Point p = new Point(); + if ( (y & 1) == 1 ) { + p = new Point(); // Kill previous + } + int x = 3; + p.x = x; + p.y = 3 * x + y; + dummy(); + return p.x * p.y; + } + + int test2(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.x = 3; + p2.x = 4; + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test3(int y, Point p1) { + Point p2 = new Point(); + p1.x = 3; + p2.x = 4; + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test4(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + if ( (y & 1) == 1 ) { + p1.x = 3; + p2.x = 4; + } else { + p1.x = 5; + p2.x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test5(int y, Point p1) { + Point p2 = new Point(); + if ( (y & 1) == 1 ) { + p1.x = 3; + p2.x = 4; + } else { + p1.x = 5; + p2.x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test6(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.next = p2; + if ( (y & 1) == 1 ) { + p1.x = 3; + p1.getNext().x = 4; + } else { + p1.x = 5; + p1.getNext().x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test7(int y, Point p1) { + Point p2 = new Point(); + p1.next = p2; + if ( (y & 1) == 1 ) { + p1.x = 3; + p1.getNext().x = 4; + } else { + p1.x = 5; + p1.getNext().x = 6; + } + p1.y = 3 * p2.x + y; + p2.y = 3 * p1.x + y; + dummy(); + return p1.y * p2.y; + } + + int test8(int y, int l, int i) { + Point p = new Point(); + p.ax = new int[l]; + p.ay = new int[l]; + int x = 3; + p.ax[i] = x; + p.ay[i] = 3 * x + y; + dummy(); + return p.ax[i] * p.ay[i]; + } + + int test9(int y, int l, int i) { + Point p = new Point(); + p.pax = new Point[l]; + p.pay = new Point[l]; + p.pax[i] = new Point(); + p.pay[i] = new Point(); + p.pax[i].x = 3; + p.pay[i].x = 4; + p.pax[i].y = 3 * p.pay[i].x + y; + p.pay[i].y = 3 * p.pax[i].x + y; + dummy(); + return p.pax[i].y * p.pay[i].y; + } + + int test10(int y, int l, int i, Class cls) { + Point p = new Point(); + try { + p.pax = (Point[])Array.newInstance(cls, l); + p.pax[i] = (Point)cls.newInstance(); + } + catch(java.lang.InstantiationException ex) { + return 0; + } + catch(java.lang.IllegalAccessException ex) { + return 0; + } + p.pax[i].x = 3; + p.pax[i].y = 3 * p.pax[i].x + y; + dummy(); + return p.pax[i].x * p.pax[i].y; + } + + int test11(int y) { + Point p1 = new Point(); + Point p2 = new Point(); + p1.next = p2; + if ( (y & 1) == 1 ) { + p1.x = 3; + p1.next.x = 4; + } else { + p1.x = 5; + p1.next.x = 6; + } + p1.y = 3 * p1.next.x + y; + p1.next.y = 3 * p1.x + y; + dummy(); + return p1.y * p1.next.y; + } + + int test12(int y) { + Point p1 = new Point(); + p1.next = p1; + if ( (y & 1) == 1 ) { + p1.x = 3; + p1.next.x = 4; + } else { + p1.x = 5; + p1.next.x = 6; + } + p1.y = 3 * p1.next.x + y; + p1.next.y = 3 * p1.x + y; + dummy(); + return p1.y * p1.next.y; + } + + + public static void main(String args[]) { + Test tsr = new Test(); + Point p = new Point(); + Point ptmp = p; + Class cls = Point.class; + int y = 0; + for (int i=0; i<10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + for (int i=0; i<10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + for (int i=0; i<10000; i++) { + ptmp.next = tsr.test00(1); + ptmp.next = tsr.test01(1); + ptmp.next = tsr.test02(1); + ptmp.next = tsr.test03(1); + ptmp.next = tsr.test04(1); + + y = tsr.test05(1); + + y = tsr.test80(y, 1, 0); + y = tsr.test81(y, 1, 0); + + y = tsr.test44(y); + y = tsr.test43(y); + y = tsr.test42(y); + y = tsr.test40(y); + y = tsr.test41(y); + + y = tsr.test0(y); + y = tsr.test1(y); + y = tsr.test2(y); + y = tsr.test3(y, p); + y = tsr.test4(y); + y = tsr.test5(y, p); + y = tsr.test6(y); + y = tsr.test7(y, p); + y = tsr.test8(y, 1, 0); + y = tsr.test9(y, 1, 0); + y = tsr.test10(y, 1, 0, cls); + y = tsr.test11(y); + y = tsr.test12(y); + } + + int z = 0; + y = tsr.test80(0, 1, 0); + z += y; + System.out.println("After 'test80' y=" + y); + y = tsr.test81(0, 1, 0); + z += y; + System.out.println("After 'test81' y=" + y); + + y = tsr.test44(0); + z += y; + System.out.println("After 'test44' y=" + y); + y = tsr.test43(0); + z += y; + System.out.println("After 'test43' y=" + y); + y = tsr.test42(0); + z += y; + System.out.println("After 'test42' y=" + y); + y = tsr.test40(0); + z += y; + System.out.println("After 'test40' y=" + y); + y = tsr.test41(0); + z += y; + System.out.println("After 'test41' y=" + y); + + ptmp.next = tsr.test00(1); + z += y; + System.out.println("After 'test00' p.y=" + ptmp.next.y); + ptmp.next = tsr.test01(1); + z += y; + System.out.println("After 'test01' p.y=" + ptmp.next.y); + ptmp.next = tsr.test02(1); + z += y; + System.out.println("After 'test02' p.y=" + ptmp.next.y); + ptmp.next = tsr.test03(1); + z += y; + System.out.println("After 'test03' p.y=" + ptmp.next.y); + ptmp.next = tsr.test04(1); + z += y; + System.out.println("After 'test04' p.y=" + ptmp.next.y); + + y = tsr.test05(1); + z += y; + System.out.println("After 'test05' y=" + y); + + y = tsr.test0(0); + z += y; + System.out.println("After 'test0' y=" + y); + y = tsr.test1(0); + z += y; + System.out.println("After 'test1' y=" + y); + y = tsr.test2(0); + z += y; + System.out.println("After 'test2' y=" + y); + y = tsr.test3(0, new Point()); + z += y; + System.out.println("After 'test3' y=" + y); + y = tsr.test4(0); + z += y; + System.out.println("After 'test4' y=" + y); + y = tsr.test5(0, new Point()); + z += y; + System.out.println("After 'test5' y=" + y); + y = tsr.test6(0); + z += y; + System.out.println("After 'test6' y=" + y); + y = tsr.test7(0, new Point()); + z += y; + System.out.println("After 'test7' y=" + y); + y = tsr.test8(0, 1, 0); + z += y; + System.out.println("After 'test8' y=" + y); + y = tsr.test9(0, 1, 0); + z += y; + System.out.println("After 'test9' y=" + y); + y = tsr.test10(0, 1, 0, cls); + z += y; + System.out.println("After 'test10' y=" + y); + y = tsr.test11(0); + z += y; + System.out.println("After 'test11' y=" + y); + y = tsr.test12(0); + z += y; + System.out.println("After 'test12' y=" + y); + System.out.println("Sum of y =" + z); + } +} diff --git a/hotspot/test/compiler/6695810/Test.java b/hotspot/test/compiler/6695810/Test.java new file mode 100644 index 00000000000..77297671082 --- /dev/null +++ b/hotspot/test/compiler/6695810/Test.java @@ -0,0 +1,56 @@ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ + +/* + * @test + * @bug 6695810 + * @summary null oop passed to encode_heap_oop_not_null + * @run main/othervm -Xbatch Test + */ + +public class Test { + Test _t; + + static void test(Test t1, Test t2) { + if (t2 != null) + t1._t = t2; + + if (t2 != null) + t1._t = t2; + } + + public static void main(String[] args) { + Test t = new Test(); + for (int i = 0; i < 50; i++) { + for (int j = 0; j < 100; j++) { + test(t, t); + } + test(t, null); + } + for (int i = 0; i < 10000; i++) { + test(t, t); + } + test(t, null); + } +} diff --git a/hotspot/test/compiler/6714694/Tester.java b/hotspot/test/compiler/6714694/Tester.java new file mode 100644 index 00000000000..1431c413777 --- /dev/null +++ b/hotspot/test/compiler/6714694/Tester.java @@ -0,0 +1,820 @@ +/* + * Copyright 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. + * + * 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 6714694 + * @summary assertion in 64bit server vm (store->find_edge(load) != -1,"missing precedence edge") with COOPs + * @run main/othervm -Xcomp Tester + */ + +/* Complexity upper bound: 38602 ops */ + +interface Tester_Interface_0 { +} + + +abstract class Tester_Class_1 implements Tester_Interface_0 { + static int var_1 = (false ? (short)'b' : (short)-2.4256387E38F) | (byte)('g' * -7.660532860983624E307); + float var_2; + byte var_3; + static boolean var_4 = true; + double var_5 = 8.818325751338691E307; + Object var_6; + static short var_7; + final static char var_8 = 'x'; + final static float var_9 = 2.2030989E38F; + + + public Tester_Class_1() + { + var_6 = (var_6 = (var_6 = "xkx")); + switch (var_7 = (var_3 = (byte)var_5)) + { + case 113: + + case 114: + Object var_12; + var_4 = 4.9121917E37F < 1957795258; + var_4 |= (var_4 ^= !var_4) ^ (var_4 |= var_4); + var_3 = (var_3 = (var_3 = (byte)+6010964363045275648L)); + break; + + case 102: + + } + final float var_13 = 1.2443151E38F; + var_3 = (byte)(var_1 |= (var_7 = (var_3 = (byte)var_5))); + var_2 = (long)(var_7 = (var_3 = (byte)var_8)) - (var_7 = (byte)386742565); + var_4 &= var_4; + var_2 = (long)((var_3 = (var_3 = (byte)var_8)) / ((var_4 ^= (var_5 /= var_9) <= (var_1 &= var_1)) ? (var_7 = (short)6872886933545336832L) : (byte)var_8)); + var_6 = "uqflj"; + { + switch (((new String[var_3 = (byte)var_5])[var_3 = (byte)8097442298927900672L]).charAt(1540148550)) + { + case 'l': + + } + var_2 = (var_7 = (byte)2.9859440663042714E307); + { + Object var_14; + } + var_3 = (var_3 = (var_3 = (byte)3.3634427195550136E307)); + var_5 += '_'; + } + var_6 = "tempfdjen"; + var_3 = (((var_4 ^= new String("jmwiwmk").endsWith("rtlstmnuo")) ? !true : !false) ? true : (var_4 = false)) ? (var_3 = (byte)var_5) : (var_3 = (var_3 = (byte)var_5)); + var_4 ^= false; + if (1.6435436003809043E307 != var_9) + { + boolean var_15 = true; + } + else + { + var_4 = false; + } + { + Object var_16 = ((new Tester_Class_1[(byte)71832757][(byte)1.0694914E38F])[(byte)1315653071][(byte)(var_7 = (var_7 = (byte)var_8))]).var_6 = new int[(byte)var_8][var_3 = (byte)1933656747]; + } + var_7 = (var_4 = var_4) ? (short)2.756967E37F : (short)'K'; + byte var_17; + } + + + + abstract public Tester_Interface_0 func_0(double[][] arg_0, final Object arg_1); + + + final double func_0(final float arg_0, final short arg_1, final boolean arg_2) + { + var_6 = (var_6 = "lmshbl"); + var_3 = (var_3 = (new byte[(new byte[(byte)arg_1])[var_3 = (byte)arg_0]])[var_3 = (var_3 = (byte)(var_1 >>>= var_1))]); + var_5 %= (var_3 = (byte)1909375874); + var_1 /= (char)(short)'i'; + { + "vgar".length(); + } + int var_10; + { + var_3 = (var_4 &= true) ? (byte)(var_5 *= 6375499657746206720L) : (byte)+ (var_5 /= var_9); + var_7 = (var_4 = true) ? (byte)(false ? (short)749593632 : (byte)8.692758043260743E307) : (byte)var_1; + ((new Tester_Class_1[(byte)1.2890904018345944E308])[(byte)var_1]).var_3 = (var_3 = (byte)arg_0); + var_4 = true ^ var_4; + } + { + var_1 ^= (var_3 = (var_3 = (var_3 = (byte)'U'))); + } + var_3 = (var_3 = (var_3 = (var_3 = (byte)arg_1))); + char var_11; + var_1 += (var_2 = (var_7 = arg_1)); + { + var_7 = (var_7 = arg_1); + } + var_7 = arg_1; + var_6 = (new char[(byte)1985094111797788672L][var_3 = (byte)3112604683090268160L])[var_3 = (byte)~ (var_3 = (byte)(var_5 += var_1))]; + var_3 = (var_3 = (var_3 = (var_3 = (byte)3694858000202921984L))); + var_1 /= ~ ((byte)1311538336); + (((var_4 |= arg_2 ? !true && arg_2 : false) ? arg_2 : arg_2) ? "iih".substring(~ (var_3 = (byte)3.5401308E37F), 'g' * arg_1) : "gynskmvoj").trim(); + var_3 = (var_3 = arg_2 ? (byte)+ ~5247392660383928320L : (byte)8392160279007184896L); + var_3 = (var_3 = (var_3 = (byte)var_8)); + return (var_5 += 7.157559E37F) + (var_11 = 'V'); + } + + public String toString() + { + String result = "[\n"; + result += "Tester_Class_1.var_7 = "; result += Tester.Printer.print(var_7); + result += "\n"; + result += "Tester_Class_1.var_3 = "; result += Tester.Printer.print(var_3); + result += "\n"; + result += "Tester_Class_1.var_8 = "; result += Tester.Printer.print(var_8); + result += "\n"; + result += "Tester_Class_1.var_1 = "; result += Tester.Printer.print(var_1); + result += "\n"; + result += "Tester_Class_1.var_4 = "; result += Tester.Printer.print(var_4); + result += "\n"; + result += "Tester_Class_1.var_5 = "; result += Tester.Printer.print(var_5); + result += "\n"; + result += "Tester_Class_1.var_2 = "; result += Tester.Printer.print(var_2); + result += "\n"; + result += "Tester_Class_1.var_9 = "; result += Tester.Printer.print(var_9); + result += "\n"; + result += "Tester_Class_1.var_6 = "; result += Tester.Printer.print(var_6); + result += ""; + result += "\n]"; + return result; + } +} + + +class Tester_Class_2 extends Tester_Class_1 implements Tester_Interface_0 { + final static String var_18 = false | Tester_Class_1.var_4 | (Tester_Class_1.var_4 &= (Tester_Class_1.var_4 |= (Tester_Class_1.var_4 = var_4))) ? "tbobyhqne" : ""; + static String var_19 = "acxfj"; + + + public Tester_Class_2() + { + Tester_Class_1.var_4 = !Tester_Class_1.var_4; + var_1++; + var_2 = (byte)2.4009747E38F; + new String(); + var_6 = (var_19 = "hsshyw"); + var_19 = var_19; + } + + + public Tester_Interface_0 func_0(double[][] arg_0, final Object arg_1) + { + var_5 = 4.0352057E37F; + (((false && ! ((Tester_Class_1.var_4 |= !true) ^ (Tester_Class_1.var_4 ^ false))) ^ (var_4 &= true) ? var_4 : (var_4 ^= true)) ? "spskwj" : "xcqianm").length(); + ((var_4 |= (Tester_Class_1.var_4 ^= Tester_Class_1.var_4) ? (Tester_Class_1.var_4 &= false) : (Tester_Class_1.var_4 |= Tester_Class_1.var_4)) ? (Tester_Class_1)(var_6 = new double[(byte)6.628342687109622E307]) : (Tester_Class_1)arg_1).var_6 = arg_0; + var_7 = (short)(byte)(short)8775325134193811456L; + var_4 ^= (var_4 &= !false); + ((Tester_Class_1)arg_1).var_3 = (var_3 = (byte)(var_5 %= 8.933448E37F)); + Tester_Class_1 var_20 = Tester_Class_1.var_4 ? (Tester_Class_1)arg_1 : (Tester_Class_1)arg_1; + { + var_19.endsWith(var_19); + var_6 = var_20; + (var_20 = (var_20 = var_20)).var_2 = (short)('p' <= 1986176769 % (int)2242661265280256000L % 2664882044098145280L ? ~ (var_3 = (byte)1.1892553447967157E308) & ~1806805036550279168L : (var_7 = (byte)var_8)); + } + final boolean var_21 = Tester_Class_1.var_4; + var_20.var_3 = (var_3 = (var_20.var_3 = (byte)'t')); + boolean var_22 = true; + Tester_Class_1.var_4 |= (var_4 = var_21); + var_19 = "ocn"; + var_19 = var_19; + var_1 *= Tester_Class_1.var_8; + var_20 = var_22 ? var_20 : var_20; + var_7 = var_21 ? (byte)+ ((byte)var_1) : ((var_20 = (var_20 = var_20)).var_3 = (var_3 = (var_3 = (byte)'L'))); + return true ? (var_20 = var_20) : (new Tester_Interface_0[(byte)5618282952859970560L])[var_3 = (byte)Tester_Class_1.var_8]; + } + + + public boolean equals(Object obj) + { + Tester_Class_1.var_7 = (var_7 = (((Tester_Class_1)obj).var_3 = (byte)var_9)); + { + final Tester_Class_1 var_23 = (Tester_Class_1)obj; + } + ++Tester_Class_1.var_1; + var_5 = (Tester_Class_1.var_7 = var_4 ? (Tester_Class_1.var_7 = (((Tester_Class_1)obj).var_3 = (byte)Tester_Class_1.var_8)) : (var_7 = (byte)var_9)); + ((Tester_Class_1)obj).var_6 = var_18.replace(Tester_Class_1.var_8, Tester_Class_1.var_8); + ((new Tester_Class_1[((Tester_Class_1)(obj = new char[var_3 = (byte)Tester_Class_1.var_8])).var_3 = (((Tester_Class_1)obj).var_3 = (byte)(var_1 %= 787509251458841600L))])[(new byte[var_3 = (byte)Tester_Class_1.var_1])[((Tester_Class_1)obj).var_3 = (byte)1.2382548E38F]]).var_3 = (((Tester_Class_1)obj).var_3 = var_4 ? (byte)Tester_Class_1.var_8 : (byte)4.1085164E36F); + var_1 &= var_8; + var_7 = var_4 ? (var_3 = (byte)var_8) : (byte)var_5; + var_19 = var_18; + ("o".compareTo("kwlfk") > (var_2 = 5289241662482067456L) ? (Tester_Class_1)obj : (Tester_Class_1)obj).var_5 -= (((Tester_Class_1)obj).var_3 = (((Tester_Class_1)obj).var_3 = (((Tester_Class_1)obj).var_3 = (byte)var_9))); + return true; + } + + + public String toString() + { + String result = "[\n"; + result += "Tester_Class_2.var_7 = "; result += Tester.Printer.print(var_7); + result += "\n"; + result += "Tester_Class_2.var_8 = "; result += Tester.Printer.print(var_8); + result += "\n"; + result += "Tester_Class_2.var_3 = "; result += Tester.Printer.print(var_3); + result += "\n"; + result += "Tester_Class_2.var_18 = "; result += Tester.Printer.print(var_18); + result += "\n"; + result += "Tester_Class_2.var_19 = "; result += Tester.Printer.print(var_19); + result += "\n"; + result += "Tester_Class_2.var_1 = "; result += Tester.Printer.print(var_1); + result += "\n"; + result += "Tester_Class_2.var_4 = "; result += Tester.Printer.print(var_4); + result += "\n"; + result += "Tester_Class_2.var_5 = "; result += Tester.Printer.print(var_5); + result += "\n"; + result += "Tester_Class_2.var_2 = "; result += Tester.Printer.print(var_2); + result += "\n"; + result += "Tester_Class_2.var_9 = "; result += Tester.Printer.print(var_9); + result += "\n"; + result += "Tester_Class_2.var_6 = "; result += Tester.Printer.print(var_6); + result += ""; + result += "\n]"; + return result; + } +} + + +class Tester_Class_3 extends Tester_Class_2 implements Tester_Interface_0 { + long var_24 = 9026266006808413184L; + char var_25; + String var_26 = ((var_4 ^= Tester_Class_1.var_4) ? (!true ? false : (var_4 |= true)) : (Tester_Class_2.var_4 ^= var_4)) ? "dkmhvhl" : (var_19 = (Tester_Class_2.var_19 = (Tester_Class_2.var_19 = var_18))); + static Tester_Class_2 var_27; + short var_28 = Tester_Class_2.var_7 = (short)(Tester_Class_2.var_1 &= (var_3 = (var_3 = (var_3 = (byte)Tester_Class_2.var_9)))); + static boolean var_29 = false; + static Object[][] var_30; + int var_31 = 750583762; + Tester_Class_2 var_32; + final static long var_33 = 3050784555932008448L; + + + public Tester_Class_3() + { + byte[] var_34; + var_4 &= (Tester_Class_1.var_4 = true); + Tester_Class_1.var_1--; + switch (var_28 >>= ~ ((byte)var_28)) + { + case 9: + + case 26: + Tester_Class_1.var_4 ^= Tester_Class_1.var_4; + (Tester_Class_2.var_19 = "pwtic").indexOf(Tester_Class_2.var_18); + var_26.indexOf(var_19); + ((Tester_Class_1)(new Tester_Interface_0[(byte)var_5])[var_24 <= var_31 ? (byte)'^' : (byte)var_24]).var_2 = 5611775846881101824L; + var_29 |= (Tester_Class_2.var_4 ^= var_29); + Tester_Class_2 var_35; + var_24 <<= (var_31 >>= (var_25 = var_8)); + break; + + case 28: + + } + new String(); + var_5 %= (var_25 = 'n'); + ((Tester_Class_2)(Tester_Class_1)(((Tester_Class_1)(var_6 = Tester_Class_2.var_18)).var_6 = (var_26 = ""))).var_2 = var_31; + --var_1; + } + + + + + public String toString() + { + String result = "[\n"; + result += "Tester_Class_3.var_8 = "; result += Tester.Printer.print(var_8); + result += "\n"; + result += "Tester_Class_3.var_25 = "; result += Tester.Printer.print(var_25); + result += "\n"; + result += "Tester_Class_3.var_1 = "; result += Tester.Printer.print(var_1); + result += "\n"; + result += "Tester_Class_3.var_31 = "; result += Tester.Printer.print(var_31); + result += "\n"; + result += "Tester_Class_3.var_30 = "; result += Tester.Printer.print(var_30); + result += "\n"; + result += "Tester_Class_3.var_24 = "; result += Tester.Printer.print(var_24); + result += "\n"; + result += "Tester_Class_3.var_33 = "; result += Tester.Printer.print(var_33); + result += "\n"; + result += "Tester_Class_3.var_5 = "; result += Tester.Printer.print(var_5); + result += "\n"; + result += "Tester_Class_3.var_2 = "; result += Tester.Printer.print(var_2); + result += "\n"; + result += "Tester_Class_3.var_9 = "; result += Tester.Printer.print(var_9); + result += "\n"; + result += "Tester_Class_3.var_7 = "; result += Tester.Printer.print(var_7); + result += "\n"; + result += "Tester_Class_3.var_28 = "; result += Tester.Printer.print(var_28); + result += "\n"; + result += "Tester_Class_3.var_3 = "; result += Tester.Printer.print(var_3); + result += "\n"; + result += "Tester_Class_3.var_18 = "; result += Tester.Printer.print(var_18); + result += "\n"; + result += "Tester_Class_3.var_19 = "; result += Tester.Printer.print(var_19); + result += "\n"; + result += "Tester_Class_3.var_26 = "; result += Tester.Printer.print(var_26); + result += "\n"; + result += "Tester_Class_3.var_4 = "; result += Tester.Printer.print(var_4); + result += "\n"; + result += "Tester_Class_3.var_29 = "; result += Tester.Printer.print(var_29); + result += "\n"; + result += "Tester_Class_3.var_27 = "; result += Tester.Printer.print(var_27); + result += "\n"; + result += "Tester_Class_3.var_32 = "; result += Tester.Printer.print(var_32); + result += "\n"; + result += "Tester_Class_3.var_6 = "; result += Tester.Printer.print(var_6); + result += ""; + result += "\n]"; + return result; + } +} + +public class Tester { + static double var_36 = 2.679028326789642E307; + float var_37; + String var_38 = Tester_Class_2.var_18; + static Tester_Interface_0 var_39; + static char var_40 = 'D'; + Tester_Class_1 var_41; + static int var_42; + final static boolean var_43 = false; + + + final static Tester_Class_2 func_0(Tester_Class_1 arg_0, final Tester_Class_2 arg_1) + { + "ooots".replaceFirst("rdxor", ((new Tester_Class_3[arg_1.var_3 = (byte)2.7836305E38F])[arg_0.var_3 = (byte)+ + +1.4958218616334936E307]).var_26); + if (true) + { + arg_0 = (Tester_Class_3)arg_0; + ((Tester_Class_3)arg_0).var_25 = var_40; + final Tester_Class_2 var_44 = (Tester_Class_2)((Tester_Class_3.var_29 |= var_43) ? arg_0 : (arg_0.var_6 = Tester_Class_3.var_18)); + } + else + { + var_39 = (Tester_Class_3.var_27 = (Tester_Class_3)arg_1); + } + Tester_Class_3.var_19 = "onndgsil"; + var_39 = arg_0; + return (Tester_Class_2.var_4 &= Tester_Class_2.var_4 ^ true) ? (((Tester_Class_3)arg_0).var_32 = (Tester_Class_3)arg_1) : (((Tester_Class_3)arg_0).var_32 = (Tester_Class_3)arg_1); + } + + private final static float func_1(final short arg_0, int[][] arg_1, final long arg_2) + { + Tester_Class_2.var_1 *= arg_0; + double var_45 = 6.841391103184752E307; + long var_46; + Tester_Class_2.var_1--; + --var_40; + ++var_40; + ++Tester_Class_3.var_1; + Tester_Class_1.var_4 = false; + var_36 %= 'X'; + ++Tester_Class_2.var_1; + Tester_Class_1.var_1++; + return 3.2422038E38F; + } + + private final static char func_2(double arg_0, final byte arg_1, int arg_2) + { + --Tester_Class_3.var_1; + if (Tester_Class_1.var_4) + { + if (var_43) + { + Tester_Class_3.var_1++; + } + else + { + var_40 <<= 1329560515532651520L; + } + (false & Tester_Class_2.var_4 ? (new Tester_Class_1[arg_1])[arg_1] : (new Tester_Class_1[arg_1][arg_1])[arg_1][arg_1]).var_3 = arg_1; + Tester_Class_2.var_19 = Tester_Class_3.var_19; + --var_40; + final long var_47 = ~Tester_Class_3.var_33 << var_40--; + ((Tester_Class_3)(new Tester_Class_2[arg_1][arg_1])[arg_1][arg_1]).var_24 *= (var_36 *= (long)arg_1 * ~arg_1); + Tester_Class_2.var_19 = Tester_Class_2.var_19; + ++((new Tester_Class_3[arg_1])[arg_1]).var_24; + } + else + { + var_40++; + } + var_40 <<= var_40; + if (true) + { + ++arg_2; + } + else + { + Tester_Class_2.var_7 = arg_1; + } + boolean var_48 = true; + var_36 /= arg_1; + final short var_49 = 15276; + Tester_Interface_0 var_50; + ((Tester_Class_2.var_19 = (Tester_Class_2.var_19 = Tester_Class_2.var_19)) + "xhi").toString(); + arg_2++; + return var_40; + } + + public final static char func_4(final boolean arg_0) + { + float var_52 = 2.8063675E38F; + var_40--; + Object var_53; + Tester_Class_3.var_29 |= (Tester_Class_3.var_29 &= true); + if (!Tester_Class_1.var_4) + { + --var_40; + } + else + { + var_52 %= 2027756834; + } + int var_54 = Tester_Class_1.var_1++; + var_40--; + long var_55; + byte var_56 = 97; + var_36 *= 9.75628909363086E307 % + -1.9812653793936264E306; + int var_57; + boolean var_58 = Tester_Class_1.var_4 ^= var_43; + return 'J'; + } + + static float func_5(final Object arg_0, float arg_1, final Tester_Class_2 arg_2) + { + var_39 = arg_2; + Tester_Class_3.var_27 = arg_2; + arg_1 %= 1.7777554E38F; + var_39 = (Tester_Class_3.var_27 = arg_2); + Tester_Class_3 var_59; + { + var_40 -= arg_1 - ~ (((Tester_Class_3)arg_2).var_3 = (byte)1455854212); + } + Object var_60 = Tester_Class_1.var_4 ? arg_0 : new String[arg_2.var_3 = (byte)arg_1][(byte)((Tester_Class_3)arg_0).var_28]; + Tester_Class_3.var_27 = (Tester_Class_2)(var_39 = arg_2); + ((Tester_Class_3.var_4 |= var_43) ? (var_59 = (var_59 = (var_59 = (Tester_Class_3)var_60))) : (var_59 = (Tester_Class_3)arg_2)).var_24 ^= Tester_Class_3.var_1; + return Tester_Class_1.var_9; + } + + private static void func_6(char arg_0, final Tester_Class_3 arg_1, String arg_2, final double arg_3) + { + ((new Tester_Class_1[(byte)arg_1.var_28])[(arg_1.var_32 = arg_1).var_3 = (byte)var_40]).var_2 = Tester_Class_3.var_9; + double var_61; + (true ? (arg_1.var_32 = arg_1) : (arg_1.var_32 = (Tester_Class_3.var_27 = (arg_1.var_32 = arg_1)))).var_6 = var_43 | (Tester_Class_2.var_4 = !Tester_Class_3.var_4) ? (arg_1.var_26 = arg_2) : (Tester_Class_2.var_19 = Tester_Class_2.var_18); + } + + private final char func_7(int arg_0) + { + Tester_Class_2.var_4 &= var_43; + float var_62 = Tester_Class_3.var_9; + --var_40; + int var_63 = Tester_Class_1.var_1++; + { + "nncjfoit".indexOf((new int[(byte)'\\'])[(byte)var_36]); + if (var_43) + { + ((new Tester_Class_3[(byte)var_40][(byte)Tester_Class_2.var_1])[(byte)5046997225818337280L][(byte)var_63]).var_24 >>>= var_40; + } + else + { + --var_40; + } + --Tester_Class_2.var_1; + --var_63; + } + { + final byte var_64 = Tester_Class_1.var_4 ? (byte)'M' : (byte)(var_62 -= + ((byte)Tester_Class_1.var_8)); + float var_65; + var_62 *= ((Tester_Class_3)(new Tester_Interface_0[var_64])[var_64]).var_24++; + var_36 /= var_64; + { + double var_66; + } + var_40 += 3500240160155094016L; + ((new Tester_Class_1[var_64][var_64])[var_64][var_64]).var_3 = (byte)(Tester_Class_2.var_7 = (Tester_Class_1.var_7 = (Tester_Class_1.var_7 = (Tester_Class_1.var_7 = var_64)))); + ++Tester_Class_3.var_1; + } + --arg_0; + { + arg_0++; + } + Tester_Class_2.var_1++; + var_40 &= (short)((byte)Tester_Class_2.var_8 >> (((new Tester_Class_3[(byte)var_36])[(byte)(var_40 = Tester_Class_3.var_8)]).var_3 = (byte)((byte)3.3531374E38F * var_40))); + var_36 %= (var_62 = (byte)900943133); + var_36 = Tester_Class_3.var_33; + var_62 += (var_40 /= (byte)6766658341842315264L % (byte)'p') * (short)2019461672; + --var_40; + if (true) + { + var_62 *= 365879806965555200L; + } + else + { + var_36 -= ~9163555887358003200L; + } + Tester_Class_1.var_4 = Tester_Class_1.var_4; + { + var_40 <<= var_63; + } + var_40++; + String var_67; + return Tester_Class_1.var_8; + } + + private final static Tester_Interface_0 func_8(char arg_0, final Tester_Class_2 arg_1, final String arg_2) + { + ((new Tester[(byte)((Tester_Class_3)arg_1).var_28])[((Tester_Class_1)(var_39 = arg_1)).var_3 = ((Tester_Class_3.var_27 = (Tester_Class_3)arg_1).var_3 = (byte)+ -9.9100855E36F)]).var_38 = (var_43 ? "k" : Tester_Class_2.var_19).substring(350785312); + return (new Tester_Interface_0[(byte)'l'])[((Tester_Class_1)(var_39 = (Tester_Class_3.var_27 = (Tester_Class_3)arg_1))).var_3 = ((Tester_Class_3.var_27 = arg_1).var_3 = (((Tester_Class_3)arg_1).var_3 = (arg_1.var_3 = (arg_1.var_3 = (byte)'['))))]; + } + + private final int func_9(Tester_Class_3 arg_0, char arg_1) + { + final float var_68 = Tester_Class_3.var_9; + Tester_Class_2.var_18.toLowerCase(); + double var_69; + { + Tester_Class_3.var_29 ^= !false || Tester_Class_2.var_4; + } + Tester_Class_1 var_70; + (Tester_Class_3.var_27 = (Tester_Class_2)(var_70 = arg_0)).var_6 = (Tester_Class_2)((var_41 = arg_0).var_6 = (arg_0.var_6 = arg_0)); + "hv".codePointBefore(--Tester_Class_2.var_1); + var_41 = arg_0; + return ~ (((arg_0 = arg_0).var_24 &= arg_1) == 3.0764282E38F ? (byte)457565863 : ((arg_0 = arg_0).var_3 = (byte)arg_0.var_28)); + } + + private static void func_10(double arg_0, final Tester_Class_3 arg_1, double arg_2) + { + arg_1.var_32 = 'g' != 1.520646515461986E307 ? (arg_1.var_32 = arg_1) : arg_1; + Tester_Class_2.var_19.startsWith(Tester_Class_2.var_19 = Tester_Class_3.var_18); + Tester_Class_1.var_4 ^= true & (arg_1.var_3 = (arg_1.var_3 = (byte)- ((byte)1.4509185661781193E308))) > (arg_1.var_2 = var_40); + var_36 += Tester_Class_3.var_9; + } + + Tester_Interface_0 func_12(final Object arg_0, float arg_1) + { + switch (((Tester_Class_3)arg_0).var_3 = (byte)arg_1) + { + case 4: + var_41 = (Tester_Class_3)(var_39 = (Tester_Class_3.var_27 = (Tester_Class_3.var_27 = (Tester_Class_3)arg_0))); + double var_72 = (double)3858573493713776640L; + byte var_73 = (var_41 = (Tester_Class_2)arg_0).var_3 = (((Tester_Class_3)arg_0).var_3 = (byte)var_72); + break; + + case 13: + (Tester_Class_3.var_27 = (((Tester_Class_3)arg_0).var_32 = (Tester_Class_3)(Tester_Class_2)arg_0)).var_3 = (Tester_Class_2.var_1 *= ((Tester_Class_3)arg_0).var_24) == (byte)Tester_Class_3.var_33 ? (byte)188693954866039808L : (byte)Tester_Class_2.var_8; + break; + + default: + var_40 <<= (byte)157510337; + break; + + case 26: + + case 122: + + } + Tester_Interface_0 var_74; + long var_75; + var_41 = (var_41 = (var_41 = (Tester_Class_2)arg_0)); + arg_1 *= 1601420762; + var_74 = (var_41 = Tester_Class_1.var_4 ? (Tester_Class_3)arg_0 : (Tester_Class_2)arg_0); + (Tester_Class_1.var_4 ? (Tester_Class_3)(var_39 = (Tester_Class_3)arg_0) : (true ? (Tester_Class_3)arg_0 : (Tester_Class_3)arg_0)).var_28 *= 1066935145; + var_40 >>>= (byte)6.643183E36F / - ((byte)1.277596E37F); + { + ((Tester_Class_3)(((Tester_Class_3)((Tester_Class_3.var_29 ^= (Tester_Class_3.var_29 &= var_43)) ? (Tester_Class_2)arg_0 : (Tester_Class_2)arg_0)).var_32 = (Tester_Class_3.var_27 = (Tester_Class_2)arg_0))).var_28--; + } + var_38 = "qad"; + byte var_76 = ((Tester_Class_2)(var_39 = (Tester_Class_3)arg_0)).var_3 = true ? ((var_41 = (var_41 = (Tester_Class_3)arg_0)).var_3 = (byte)1.7128118638075888E308) : (byte)1.6562746603631249E308; + return var_39 = (Tester_Class_3)((var_41 = (Tester_Class_3)arg_0).var_6 = Tester_Class_2.var_18); + } + + protected final String func_13() + { + float var_77; + var_38 = (Tester_Class_2.var_19 = var_38); + Tester_Class_2.var_4 ^= !var_43 | (Tester_Class_3.var_29 ^= Tester_Class_1.var_4); + Tester_Class_3.var_1--; + Tester_Class_2.var_1++; + return Tester_Class_2.var_18; + } + + public static String execute() + { + try { + Tester t = new Tester(); + try { t.test(); } + catch(Throwable e) { } + try { return t.toString(); } + catch (Throwable e) { return "Error during result conversion to String"; } + } catch (Throwable e) { return "Error during test execution"; } + } + + public static void main(String[] args) + { + try { + Tester t = new Tester(); + try { t.test(); } + catch(Throwable e) { } + try { System.out.println(t); } + catch(Throwable e) { } + } catch (Throwable e) { } + } + + private void test() + { + int var_78 = 0; + var_39 = (new Tester_Class_1[(byte)var_40])[(byte)Tester_Class_3.var_33]; + while (var_43 && (var_78 < 70 && true)) + { + var_40 *= ~ ~Tester_Class_3.var_33 % Tester_Class_3.var_9; + var_78++; + var_39 = new Tester_Class_3(); + var_39 = (var_41 = (Tester_Class_3.var_27 = new Tester_Class_2())); + } + final Tester_Class_3 var_79 = (Tester_Class_1.var_4 ? ~Tester_Class_3.var_33 : var_36) == 1433764895112462336L ? new Tester_Class_3() : new Tester_Class_3(); + Tester_Class_2 var_80; + } + public String toString() + { + String result = "[\n"; + result += "Tester.var_40 = "; result += Printer.print(var_40); + result += "\n"; + result += "Tester.var_42 = "; result += Printer.print(var_42); + result += "\n"; + result += "Tester.var_36 = "; result += Printer.print(var_36); + result += "\n"; + result += "Tester.var_37 = "; result += Printer.print(var_37); + result += "\n"; + result += "Tester.var_39 = "; result += Printer.print(var_39); + result += "\n"; + result += "Tester.var_38 = "; result += Printer.print(var_38); + result += "\n"; + result += "Tester.var_43 = "; result += Printer.print(var_43); + result += "\n"; + result += "Tester.var_41 = "; result += Printer.print(var_41); + result += ""; + result += "\n]"; + return result; + } + static class Printer + { + public static String print(boolean arg) { return String.valueOf(arg); } + public static String print(byte arg) { return String.valueOf(arg); } + public static String print(short arg) { return String.valueOf(arg); } + public static String print(char arg) { return String.valueOf((int)arg); } + public static String print(int arg) { return String.valueOf(arg); } + public static String print(long arg) { return String.valueOf(arg); } + public static String print(float arg) { return String.valueOf(arg); } + public static String print(double arg) { return String.valueOf(arg); } + + + public static String print(Object arg) + { + return print_r(new java.util.Stack(), arg); + } + + private static String print_r(java.util.Stack visitedObjects, Object arg) + { + String result = ""; + if (arg == null) + result += "null"; + else + if (arg.getClass().isArray()) + { + for (int i = 0; i < visitedObjects.size(); i++) + if (visitedObjects.elementAt(i) == arg) return ""; + + visitedObjects.push(arg); + + final String delimiter = ", "; + result += "["; + + if (arg instanceof Object[]) + { + Object[] array = (Object[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print_r(visitedObjects, array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof boolean[]) + { + boolean[] array = (boolean[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof byte[]) + { + byte[] array = (byte[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof short[]) + { + short[] array = (short[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof char[]) + { + char[] array = (char[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof int[]) + { + int[] array = (int[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof long[]) + { + long[] array = (long[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof float[]) + { + float[] array = (float[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof double[]) + { + double[] array = (double[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + + result += "]"; + visitedObjects.pop(); + + } else + { + result += arg.toString(); + } + + return result; + } + } +} + + diff --git a/hotspot/test/compiler/6716441/Tester.java b/hotspot/test/compiler/6716441/Tester.java new file mode 100644 index 00000000000..9e76801cae3 --- /dev/null +++ b/hotspot/test/compiler/6716441/Tester.java @@ -0,0 +1,940 @@ +/* + * Copyright 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. + * + * 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 6716441 + * @summary error in meet with +DoEscapeAnalysis + * @run main/othervm -Xcomp -XX:+AggressiveOpts Tester + */ + +/* Complexity upper bound: 70070 ops */ + +class Tester_Class_0 { + Object var_1; + + + public Tester_Class_0() + { + var_1 = "cmlv"; + { + final Object var_7 = false ? (var_1 = "flwnujmm") : (var_1 = ""); + } + float var_8 = 0F; + boolean var_9; + do + { + ((var_9 = (var_9 = (var_9 = false))) && true ? new String("yvirc") : "rmfkjbx").indexOf(99854165); + var_8++; + boolean var_10 = true; + var_10 |= true ? true : false; + var_10 |= false | var_10 ? (var_10 |= true) : true; + } while (var_8 < 1 && "tpb".charAt(~ ((byte)2449669946597620736L)) >>> (byte)1.704554E38F >= ('t' < var_8 ? (short)var_8 : 1237471887 / +4199632387838836736L)); + var_1 = (var_1 = "y"); + switch ((var_9 = "".equalsIgnoreCase("kqalxwsnu") | false) ? (new char[(byte)1.3230508534158742E308])[(byte)(short)93390917] : 'c') + { + case 'U': + + case 'W': + + case 'A': + + case 72: + + } + var_9 = (var_9 = false); + float var_11 = 0F; + var_9 = true; + for (var_1 = (var_1 = new boolean[(new byte[(byte)'O'])[(byte)'l']]); var_11 < 2; var_1 = (true ? "" : "nn").toUpperCase()) + { + var_9 = true; + var_11++; + var_9 = true; + int var_12 = (new short[(byte)1825213428])[(byte)1.6151095881186834E308] + (byte)(short)'V'; + } + var_1 = (new boolean[(byte)1546704177][(byte)6314352927310996480L][(byte)6838913812451802112L])["e".equalsIgnoreCase("d") ? (byte)3.964472879846357E307 : (byte)'L']; + var_9 = (var_9 = false); + } + + + + protected Object clone() + { + var_1 = (var_1 = "dbogknllu"); + var_1 = "jljax"; + var_1 = (var_1 = false ? "s" : "upqinst"); + if (false) + { + var_1 = (var_1 = (var_1 = "nwhu")); + } + else + { + short var_2; + var_2 = false ? (byte)((short)'e' - (byte)2.267975E38F) : (byte)1.28920093132789E308; + } + (((byte)2.3450009E38F >= (byte)- (+ - -1.6256751428449317E306 * 954071273906192384L) ? true : true) ? "gpv".substring(468176669, 1915798010) : "macqbvf").offsetByCodePoints("ivwivjege".charAt(1819923298) >>> (byte)((- ~653213024937366528L + 'N') * +1.0297164E38F) + (short)~ + -4535402293751053312L, (short)3837656677199316992L + (new byte[(byte)2.1586717E38F])[(byte)((short)719847962 - 8.599263E37F)]); + new String((char)650047353 > (short)'I' ? "maygldu".replaceAll("hpn", "bacoyows") : "nkx").endsWith(new String("h" + "vx")); + byte var_3; + return var_1 = "vbiccvdu"; + } + + public boolean equals(Object obj) + { + var_1 = "rxpocj"; + obj = "ndogtwvuh"; + { + { + var_1 = "vmdkvs"; + } + final boolean var_4 = false; + long var_5; + var_5 = (short)'G' >> + ((byte)1.1872624048733707E308); + } + var_1 = (new byte[(byte)(short)1.7804576633213148E308][(byte)(short)8.300151422843056E307])[(byte)3110360603258978304L]; + obj = "fudebwroh"; + obj = new Object[(false && false) & false ? (byte)8796624364629753856L : (byte)- +1.5843542184394165E308]; + if (true) + { + var_1 = new float[(byte)1372189277][(byte)((byte)8.352642520619892E307 == (! !false ^ true ? (short)1.3871033E37F : (byte)'f') ? 7.33899E37F - (short)2.2558552E37F : 2.6072269E38F)]; + } + else + { + var_1 = obj; + obj = new boolean[(byte)8.623747E37F][(byte)~ ((byte)(short)(byte)2100816354)]; + } + var_1 = new int[(new byte[(byte)7410132537719084032L])[(byte)1524949007]][(byte)((long)9188640 ^ 'n')]; + if (-3.0364305E38F > 8.114229090672013E307) + { + var_1 = (var_1 = new boolean[(byte)1.0354788699727844E308][(byte)-4867581638981979136L]); + } + else + { + obj = (obj = obj); + obj = (new int[(byte)'f'][(byte)7563033606293564416L])[(byte)2052737645]; + } + long var_6; + var_6 = (+ + ~3862500564271147008L != (short)8549491352795953152L || (byte)+ + (var_6 = 'D') > (var_6 = 1687952259)) && true ? (short)1756260278 : (byte)(short)3.202384E36F; + return false ^ ((false ? !true : true) ? false : (true ? ! !false : false)); + } + + + + public String toString() + { + String result = "[\n"; + result += "Tester_Class_0.var_1 = "; result += Tester.Printer.print(var_1); + result += ""; + result += "\n]"; + return result; + } +} + + +interface Tester_Interface_1 { +} + + +final class Tester_Class_2 extends Tester_Class_0 { + static char var_13; + final static long var_14 = ~ ~ (((false ? !true ^ !true : !false | true) ? (byte)1.4363583E38F : (byte)(short)'X') * + + +3767002589844008960L << (var_13 = (var_13 = 'X'))); + + + public Tester_Class_2() + { + ((true ? (byte)- ((byte)2.6338962E38F) : (byte)'H') <= (short)8.671266E37F || !false & true ? (Tester_Class_0)(var_1 = "tgoexsr") : (Tester_Class_0)(var_1 = "mptusv")).var_1 = "tbxbgyti"; + var_1 = true ? (var_1 = "islgpxwa") : "rypkbu"; + var_1 = "vngiif"; + var_13 = (var_13 = (short)~ (-3250577075350561792L + +2983539228635145216L - '`') < 861590495 * (short)1.5299644E38F ? 'V' : 'G'); + Object[] var_27; + var_1 = (var_1 = "glu"); + } + + + + + + private static int func_0(Tester_Interface_1 arg_0, Tester_Interface_1 arg_1, final int arg_2) + { + var_13 = 'i'; + new String(); + (true ? "pu" : "oltbcysyd").substring(1236315614); + byte var_15; + var_15 = (new byte[(byte)1582653493940204544L][(byte)(char)-1.5806537192822515E308])[(byte)1.2986292E38F][(byte)(short)arg_2]; + if (true || true) + { + ((new Tester_Class_2[var_15 = (byte)'q'])[var_15 = 7.653082E37F < (var_13 = 'o') ? (byte)- - + +3.1640875E38F : (byte)-6820511772487837696L]).var_1 = (new Tester_Class_0[(byte)(short)(new byte[(byte)1080194717])[(byte)8297829563314362368L]])[var_15 = (var_15 = (var_15 = (var_15 = (byte)'t')))]; + double[] var_16; + } + else + { + arg_1 = (arg_1 = arg_0); + } + var_13 = (var_13 = 'o'); + var_13 = (false || false ^ false) ^ !true ? 'Z' : (var_13 = 'i'); + return true ? (var_15 = (byte)'C') : 1120493294; + } + + static double func_1(final int arg_0, long arg_1, long arg_2) + { + "ghtfhmbeg".compareToIgnoreCase("djn"); + { + ((true ? true : ! !true) ? "" : "ioowivxge").substring(1844979226, "ppsk".startsWith("lllmn") | false ? arg_0 * arg_0 : (byte)663320199); + ((Tester_Class_0)(((new Tester_Class_2[(byte)4797509007239530496L])[(byte)(- -2.8961086E38F - arg_1)]).var_1 = new float[(byte)('m' / 6.0657416E37F)])).var_1 = new boolean[(byte)(short)(+4.515459E37F - (short)arg_0)][(byte)(-1.3002677717712297E308 + (var_13 = "bcjfdnc".charAt(arg_0)) * (arg_2 - 1.6058080036165979E308))]; + var_13 = 'E'; + } + float var_17 = 0F; + --arg_1; + do + { + final String[] var_18 = new String[(byte)(short)arg_0]; + var_17++; + Object var_19 = (new Object[(byte)var_17])[(false ? "xfkx".equalsIgnoreCase("j") : !false) ^ !false ? (byte)(1.6627987E35F * 2.62825E38F) : (byte)var_17]; + } while (var_17 < 2 && false | ((byte)1.4661115E38F | arg_0 - 'l') < ('J' & (byte)+ ((float)1200013759))); + long var_20 = 0L; + arg_2--; + for (var_13 = (var_13 = (var_13 = (var_13 = (var_13 = (var_13 = 'p'))))); var_20 < 4; var_13 = 'y') + { + new String((true | true ? "oxpfy" : "gaynucv") + (true ? "cmrrk".substring(653981013, arg_0) : "ociewl" + "srhbvcgci")); + var_20++; + arg_2 >>= arg_0; + arg_2 = false ? (byte)'l' : (byte)(~var_20 - (byte)1.1290483681734838E308); + } + ((new Tester_Class_2[(byte)arg_1++])[(byte)685259385]).var_1 = new Tester_Interface_1[(byte)arg_0]; + --arg_1; + var_13 = 483446392 - (byte)'P' < ((short)(true ? (var_13 = 't') : 'n') & (short)'l') ? (var_13 = 'q') : (var_13 = (var_13 = 'h')); + var_13 = 'y'; + return 1.097000731360761E308; + } + + private final boolean func_2(final short[][] arg_0, byte arg_1, Object arg_2) + { + var_1 = new char[arg_1]; + arg_1 /= (var_13 = 'A') + -var_14; + int var_21 = 0; + arg_2 = (new Tester_Class_0[arg_1 += var_14][arg_1])[arg_1 >>>= 'R' + + -var_14 - 4078879817303787520L]; + for (arg_1--; (+ +1.1473423E38F < 'w' & false | var_21 != (short)4633877342445358080L | !false ? false | !false : true) && (var_21 < 1 && (arg_0[arg_1])[arg_1 %= 7.136449148111178E307] > 7.362329280963185E307); arg_1++) + { + arg_1 = (arg_1 %= + -9.872181578576624E307); + var_21++; + arg_1 /= 7.365334241099395E307; + var_13 = (var_13 = (var_13 = (var_13 = (var_13 = (var_13 = 'A'))))); + } + arg_1 >>= var_14; + boolean var_22 = false; + return ((var_22 &= true) && var_22 ? (short)1.568578228250838E308 : arg_1) >= (new float[arg_1])[arg_1 /= 1.6849858816110731E308]; + } + + public final String func_3(Tester_Interface_1 arg_0) + { + arg_0 = arg_0; + arg_0 = (arg_0 = arg_0); + var_13 = (var_13 = (var_13 = (var_13 = "rqimya".charAt(390686412)))); + ((Tester_Class_0)(var_1 = "suxd")).var_1 = new Tester_Class_0[(byte)(float)(short)1.584667675541511E308]; + arg_0 = ((byte)+ + - +1.3636011E38F == 'L' ^ true) & (!true | true) ? (arg_0 = arg_0) : arg_0; + var_1 = (((Tester_Class_0)(var_1 = (Tester_Class_0)(var_1 = "ndxcurdr"))).var_1 = (var_1 = (var_1 = "schnhe"))); + var_1 = (new Object[(byte)(var_13 = (var_13 = 'G'))])[(byte)((byte)1.5366658198344074E308 - 1.0051541518022535E308)]; + var_13 = (var_13 = 'x'); + (true ? (Tester_Class_0)(var_1 = "slesdph") : (Tester_Class_0)(var_1 = "wxj")).var_1 = false ? (Tester_Class_0)(var_1 = "iddvoil") : (Tester_Class_0)(var_1 = "yjbxhuip"); + var_13 = (var_13 = 'f'); + var_1 = (new short[(byte)1.8902424351360974E307])[(new byte[(byte)1552392028])[(byte)'V']] >= (1.2449926736063704E308 + 'K') / (short)1.0847178E38F / ((short)'M' % (1.225890077244388E308 + + ((byte)1.5358312881295287E308))) ? (Tester_Class_0)(var_1 = "khfntg".toString()) : (Tester_Class_0)(var_1 = "jkttx"); + { + arg_0 = arg_0; + } + arg_0 = arg_0; + var_13 = (true ? "jndbffakc" : "hhcsc").charAt((byte)7322932713210745856L >> (short)(var_13 = (var_13 = 'R'))); + var_13 = (var_13 = (var_13 = 'U')); + { + "gepdu".trim(); + } + var_13 = 'H'; + new String(); + { + (false ^ (true ^ ((!true | ! !true) ^ ! (1.7800668444792402E308 * var_14 >= (var_13 = (var_13 = (var_13 = 'g')))))) ? "dsm" : "g").toUpperCase().toString(); + ((Tester_Class_0)(var_1 = "fcdvd")).var_1 = (Tester_Class_0)(((Tester_Class_0)(var_1 = "uwhnte")).var_1 = "vpatqpd"); + } + switch (((byte)((byte)((int)'n' / var_14) >>> (short)7.786475993917233E307 - (var_13 = 'm')) <= (("".endsWith("pbypgis") ^ false) & true ? (byte)func_0(arg_0, arg_0, 723551781) : (short)140766856) ? true | (!false || false) : 'F' != (var_13 = 'V')) ? (var_13 = 'j') : 'D') + { + case 'p': + + } + var_13 = (var_13 = (var_13 = 'y')); + var_13 = ("" + "wwbxwyt").charAt((short)8373354379880418304L << (short)(byte)1.557224945027141E308); + arg_0 = true ? (arg_0 = arg_0) : arg_0; + ((Tester_Class_0)(((Tester_Class_0)(var_1 = "rmkvbp")).var_1 = (var_1 = "gvb"))).var_1 = new Tester_Class_0[(byte)var_14]; + arg_0 = arg_0; + return 2.5245162E38F + 3.9088502076337727E307 > 1.0883030748712796E308 ? "efttufmbg" : "xy"; + } + + protected short func_4(final double arg_0, long arg_1, final Object arg_2, final byte arg_3) + { + (((("ptnmpn".startsWith("xxgxjvsie") ? !true : ! !true) ? ! !false : false) ? (true ? true : false) : (var_13 = (var_13 = 'X')) == 1948276447) ? (Tester_Class_0)(var_1 = new float[arg_3][arg_3]) : (Tester_Class_0)arg_2).var_1 = new double[(new byte[arg_3][arg_3])[arg_3][arg_3]][arg_3]; + boolean var_23; + return true ? (short)'r' : (byte)(short)('\\' >>> arg_3); + } + + final static byte func_5(final long arg_0, float arg_1, final double arg_2) + { + arg_1 = arg_2 <= ((var_13 = 'D') <= - (3463565869695079424L << 'S') ? 'a' : (var_13 = 'o')) | (true ? !false : !false) ? (byte)(short)(var_13 = 'r') : (short)(byte)'S'; + { + { + arg_1 %= '_'; + } + char var_24 = 'G'; + "hc".lastIndexOf(""); + arg_1 *= (arg_1 /= (byte)-8.308933840953204E306); + --var_24; + arg_1 /= ~ ((byte)2.2736606E38F) <= (3392301601783633920L == 3.015267E38F ^ ! !true ? (byte)88382550 : (byte)1.2019729E38F) ? 1027309963 : + -4.355887546298483E307; + ((new Tester_Class_2[(byte)arg_2])[(byte)870592870]).var_1 = "i"; + arg_1 /= 't'; + } + var_13 = 'f'; + Tester_Class_0 var_25 = (new Tester_Class_0[(byte)arg_1])[(true | false ^ !false) & ! !true & - +2.758844E38F >= (new short[(byte)5.9160883E37F])[(byte)'r'] ? (byte)arg_0 : (byte)((short)1802078016 & arg_0)]; + arg_1 /= (byte)arg_2; + var_13 = 'R'; + boolean var_26 = (true ? false : !false) ? false : !true == ! !false; + arg_1 %= (var_26 ^= (byte)1101752087 <= (short)arg_1) ? arg_1 : (float)1882235314; + var_25 = var_25; + if (var_26 &= var_26) + { + var_13 = "".startsWith("vp", - ((byte)2040501187) ^ (byte)-3921263616446438400L) ? "gam".charAt(+ ((byte)arg_1)) : (var_13 = 'H'); + arg_1 /= var_26 | ! (var_26 ^ (byte)arg_0 <= (var_13 = 'r') | (var_26 |= var_26)) ? 'N' : ~8963227563301903360L; + } + else + { + var_13 = 'l'; + var_25 = (var_25 = var_25); + } + arg_1 += (byte)(("m".substring(837996717, 861903057).startsWith("vwpky", (var_13 = 'Z') % (byte)arg_1) ? !false ^ !var_26 : var_26) ? (byte)arg_1 : ((var_26 | var_26) ^ !false ? (short)'U' : (short)'d')); + ((1.3445538E38F < (arg_1 -= 1236356135) ^ (var_26 = true)) & var_26 ? var_25 : (var_25 = var_25)).var_1 = true ? (var_25.var_1 = var_25) : (var_25.var_1 = var_25); + var_26 |= - ((byte)251113415) < (short)arg_1 & false & false; + arg_1 += (var_26 &= true) ? 7.546147305340402E307 : (true & !var_26 ? (byte)1.5107802154474685E307 : (byte)arg_1); + var_25.var_1 = true ? "bqsewhn" : "aojssvan"; + return (byte)(var_13 = (char)(new short[(byte)46697464])[(byte)var_14]); + } + + public String toString() + { + String result = "[\n"; + result += "Tester_Class_2.var_13 = "; result += Tester.Printer.print(var_13); + result += "\n"; + result += "Tester_Class_2.var_14 = "; result += Tester.Printer.print(var_14); + result += "\n"; + result += "Tester_Class_2.var_1 = "; result += Tester.Printer.print(var_1); + result += ""; + result += "\n]"; + return result; + } +} + +public class Tester { + static Tester_Class_0 var_28; + double var_29 = 4.861846831496217E307; + static byte var_30 = 79; + static boolean var_31 = false; + final byte var_32 = 48; + + + public short func_0(final byte arg_0, boolean arg_1, final double arg_2) + { + --var_30; + new Tester_Class_2().var_1 = "xdwldeqhc"; + char var_33 = 'd'; + return (var_31 = var_30 < (new short[var_30])[var_30]) ? (short)(var_33 >>>= (short)2.3152642E38F) : var_30; + } + + private final float func_1(final long arg_0, final Tester_Class_0 arg_1, Tester_Class_0 arg_2, final char arg_3) + { + { + new Tester_Class_0(); + } + var_30 >>= (short)1.1469118780047631E308; + var_31 |= var_31; + if (true) + { + Tester_Class_2 var_34 = (var_31 ^= (var_31 ^= false)) ? (Tester_Class_2)arg_1 : (new Tester_Class_2[var_32])[var_30]; + } + else + { + "shqjwg".compareToIgnoreCase(false ? "gxoyw" + "cx" : "r" + "icj"); + } + ((new Tester_Class_2[var_32])[++var_30]).var_1 = (new Object[var_30][var_32][var_32])[var_30 |= var_32]; + arg_1.var_1 = (arg_2 = arg_2); + arg_1.var_1 = (((new Tester_Class_2[var_30])[var_30 = var_32]).var_1 = new String[var_32]); + var_28 = (Tester_Class_2)((arg_2 = arg_2).var_1 = new double[var_30]); + arg_2 = arg_1; + final boolean var_35 = "qjsdfuyru".endsWith("nuw" + "bne") | arg_3 >= 1.2054153346397785E308; + var_31 &= (var_31 ^= var_35); + { + var_31 &= var_31 ? false : !false; + } + if (var_31) + { + var_28 = (new Tester_Class_2[var_32])[var_32]; + } + else + { + arg_1.equals((new Object[var_32])[var_32]); + } + ((var_31 ^= true) ? "x" : "euc").substring(+ (var_30 ^= var_30) & (byte)(new short[var_30])[var_30 /= 4.220757896697652E307]); + arg_2 = var_31 ? (Tester_Class_2)arg_1 : (Tester_Class_2)arg_2; + arg_2 = (Tester_Class_2)(new Object[var_32][var_32])[var_30][var_32]; + return 9.932983E36F * (Tester_Class_2.var_13 = arg_3); + } + + public int func_2(Tester_Class_0 arg_0) + { + "ptwusxrxn".indexOf("v"); + var_30 |= 1770666843; + var_29 += (short)(Tester_Class_2.var_14 / Tester_Class_2.var_14); + if (var_31) + { + var_30 = var_32; + } + else + { + double var_36; + } + if (true) + { + var_30 -= 2.1474216E38F; + } + else + { + var_29 += 'f'; + } + var_29 -= Tester_Class_2.var_14; + if (false) + { + arg_0.var_1 = arg_0; + } + else + { + arg_0 = (var_28 = (var_28 = arg_0)); + } + { + Tester_Class_2.var_13 = 'p'; + } + var_29 = ~Tester_Class_2.var_14 % 'y'; + switch (var_30 >>>= var_30) + { + case 115: + + } + arg_0 = arg_0; + var_31 ^= (var_31 = true); + return "".charAt(~var_32) >> ((var_31 &= true) ? var_30 : var_32); + } + + protected double func_3(boolean[] arg_0, double arg_1, long[][] arg_2) + { + switch (var_31 ? (short)(var_32 / (arg_1 /= (int)(arg_1 *= (Tester_Class_2.var_13 = ']')))) : (var_30 ^= + +Tester_Class_2.var_14 * (+ +3075166460237931520L / '['))) + { + case 31: + + case 118: + + } + Tester_Class_2.var_13 = 'm'; + "mwkh".indexOf("hdgiquve", (new char[var_32])[var_30 &= 'S'] % var_30); + final boolean var_37 = false; + char var_38 = 'F'; + var_28 = (new Tester_Class_2[var_30][var_30])[var_30 *= var_38][var_32]; + new Tester_Class_0().var_1 = new char[var_32][var_30]; + var_30 &= var_30; + var_31 |= (var_31 |= true); + int var_39 = 1769831681; + final Tester_Class_2 var_40 = (var_31 |= false ? var_31 : var_37) ? (Tester_Class_2)((new Object[var_30][var_30][var_32])[var_30 <<= var_30])[var_30][var_30++] : (Tester_Class_2)new Tester_Class_0(); + var_30 -= +var_30; + "dvmuim".replaceFirst("clmisuxu", "".toLowerCase() + "xi"); + var_39 = var_38 - (short)585806817; + arg_1 += (double)(short)(6.4329855E37F / var_32 * (var_38 += 'w')); + ++var_39; + var_40.var_1 = (var_28 = (var_28 = var_40)); + var_29 /= 3.5705444317400964E306; + Tester_Interface_1 var_41; + return arg_1; + } + + final char func_4(final long arg_0, int arg_1, final int arg_2) + { + { + Tester_Class_2.var_13 = 'D'; + var_31 = false; + } + if (var_31) + { + var_30--; + Tester_Class_0 var_42 = var_28 = (new Tester_Class_0[var_32])[var_32]; + } + else + { + Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'H'); + } + var_28 = (Tester_Class_2)(new Tester_Class_2().var_1 = (var_28 = (new Tester_Class_0[var_30])[var_30])); + arg_1 &= var_32; + --var_30; + return Tester_Class_2.var_13 = 'n'; + } + + final static Object func_5() + { + var_28 = (Tester_Class_2)(! (var_31 |= true & var_31) ? (new Tester_Class_0[var_30])[var_30] : (var_28 = (new Tester_Class_0[var_30])[var_30])); + var_31 |= false; + return var_31 ? (((Tester_Class_2)(new Object[var_30])[var_30]).var_1 = (new Tester_Class_0[var_30 /= 1366944127])[var_30]) : (new Tester_Class_0[var_30][var_30])[var_30 += 1.4070924450257891E307][var_30]; + } + + static Tester_Class_2 func_6(final Object arg_0) + { + var_28 = (var_31 ^= true) ? (Tester_Class_2)arg_0 : (Tester_Class_2)arg_0; + ((new Tester[--var_30])[var_30]).var_29 -= -3.0029087E38F * (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'k')); + var_28 = (Tester_Class_2)(var_28 = (var_28 = (var_28 = (Tester_Class_0)arg_0))); + return false ? new Tester_Class_2() : new Tester_Class_2(); + } + + private static Tester_Interface_1 func_7(byte arg_0, Tester_Class_2 arg_1, final int arg_2, char arg_3) + { + { + var_31 = var_31; + var_31 |= (var_31 &= (var_31 |= !true)); + arg_0 += Tester_Class_2.var_14; + } + var_30 = (var_30 *= ((new Tester[arg_0 ^= 1039546367])[arg_0]).var_32); + arg_1.var_1 = (var_31 ^= (var_31 &= !var_31 && !var_31)) ? (arg_1 = (arg_1 = arg_1)) : (new Tester_Class_0[arg_0++][arg_0])[arg_0][arg_0]; + arg_1.var_1 = var_31 ? "jpmg" : "epwvupaqp"; + var_28 = arg_1; + if (false) + { + arg_1 = arg_1; + } + else + { + arg_3 += var_30 % -9.298157E37F; + } + arg_1.var_1 = ((var_28 = (var_28 = arg_1)).var_1 = ((var_28 = arg_1).var_1 = "rlmf")); + var_28 = (arg_1 = arg_1); + arg_1 = arg_1; + { + var_31 = true; + } + (arg_1 = arg_1).var_1 = (arg_1.var_1 = (arg_1 = arg_1)); + final short[] var_43 = new short[(var_31 &= false) ? arg_0 : var_30]; + final short var_44 = 18087; + return false ? (new Tester_Interface_1[var_30 %= Tester_Class_2.var_14])[arg_0 -= 8.913955E37F * +arg_0] : (new Tester_Interface_1[var_30])[var_30]; + } + + private static float func_8(final Object[] arg_0, final byte arg_1, Tester_Class_0[] arg_2) + { + ((new Tester_Class_2[var_30 /= -2.37832E38F])[((new Tester[arg_1])[(new byte[arg_1])[arg_1]]).var_32]).var_1 = new Tester_Interface_1[arg_1]; + if (var_31) + { + var_28 = (Tester_Class_2)(var_28 = arg_2[var_30]); + } + else + { + var_30 -= Tester_Class_2.var_14; + final int var_45 = 1864933386; + final Tester_Class_0 var_46 = var_28 = (new Tester_Class_2[arg_1][var_30 |= Tester_Class_2.var_14])[((new Tester[arg_1][var_30])[var_30][var_30]).var_32][arg_1]; + var_31 &= (var_31 ^= false); + var_30 += (false ? 2.7581227E37F : + +1.8832631E38F) * ('P' * -1.9479086E38F); + } + (var_28 = (Tester_Class_2)arg_2[arg_1]).var_1 = (new Tester_Class_2[var_30][arg_1][arg_1])[arg_1]; + ++var_30; + (var_28 = (new Tester_Class_2[var_30])[arg_1]).var_1 = false ? (new Tester_Class_0[var_30][var_30])[var_30][arg_1] : arg_2[var_30]; + var_31 |= false; + ((new Tester[arg_1][var_30 >>>= (char)1981599])[arg_1][arg_1]).var_29 = false ^ (var_31 = var_31) ? (Tester_Class_2.var_13 = "nes".charAt(1080898679)) : - (var_30 %= 'n') ^ arg_1; + { + ((new Tester[arg_1])[var_30]).var_29 = (short)(Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'h')); + } + Tester_Class_2.var_13 = 'j'; + ((new Tester_Class_2[arg_1])[var_30]).var_1 = new byte[var_30]; + var_31 ^= (var_31 ^= !false); + "wcbi".toString(); + final byte var_47 = var_30; + if (true) + { + "mpbkilw".substring(199662864); + } + else + { + var_30++; + } + Tester_Class_2.var_13 = '`'; + "yujypq".indexOf("crve" + "inmvh", false ? ~arg_1 : "vukbkc".charAt(528096652)); + Tester_Class_2 var_48 = (Tester_Class_2)((!var_31 & (var_31 ^= false ^ !true) ? false | !true : false) ? (var_28 = (Tester_Class_2)arg_0[var_30]) : (new Tester_Class_2[arg_1])[var_30]); + return (float)(var_31 ^ var_31 ? (var_30 ^= (short)((new Tester[var_30])[var_30]).var_29) : (var_30 /= - -5.917837279005691E307 - - +3.2004715720509636E306)); + } + + final Tester_Class_0 func_9() + { + var_30 += -3531557622894482432L / ~var_30; + var_28 = (var_28 = (new Tester_Class_2[var_30 += + -7.0203367E37F])[var_30]); + var_31 ^= ! !false ^ false; + if (true) + { + byte[] var_49; + var_31 &= true; + short var_50 = 14869; + } + else + { + (((new Tester[var_32][var_30][var_32])[var_30])[var_32][var_30]).var_29 *= 'h'; + } + final int var_51 = false ? +var_32 >>> ~var_30 : --var_30; + var_31 |= false; + return (new Tester_Class_0[var_32][var_32])[var_30][var_30]; + } + + public static Object func_10() + { + Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'O'); + return ((Tester_Class_2)(new Object[--var_30])[var_30]).var_1 = (((Tester_Class_2)(new Object[var_30])[var_30]).var_1 = "iu"); + } + + protected byte func_11(final Tester_Interface_1[] arg_0) + { + { + --var_30; + var_29 *= (short)1749707986816114688L; + var_31 = (var_31 = (var_31 |= var_31)); + var_30 -= 6.4575257E37F; + } + var_28 = (var_28 = func_9()); + Tester_Class_2.var_13 = 'b'; + var_30--; + var_28 = (var_28 = (var_28 = (var_28 = (Tester_Class_2)func_10()))); + var_28 = (new Tester_Class_2[var_32])[var_30]; + char var_52 = (var_31 = false) ? (char)+ +Tester_Class_2.var_14 : (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = '_')); + if (false) + { + var_30 += (short)(var_32 + 840104459); + } + else + { + var_29 /= 2.5320765E38F; + } + if (true) + { + var_30 %= 379977167934025728L; + } + else + { + var_52 = var_52; + } + var_30 >>= ('A' ^ --var_30) & 'H'; + Tester_Class_2 var_53; + final int var_54 = 771623383; + var_29 %= (+1.938582E37F - 'G') * ++var_30; + int var_55 = (short)6.234053079170724E306 - (int)'^' / ((var_31 &= (var_31 ^= var_31)) ? (short)var_30 : ++var_30); + var_55 >>>= var_55 / ~6865244393150017536L; + var_31 ^= !false; + return var_30 >>>= 4351766607072508928L >> func_0(var_32, var_31, 1.021781609675458E308); + } + + public static String execute() + { + try { + Tester t = new Tester(); + try { t.test(); } + catch(Throwable e) { } + try { return t.toString(); } + catch (Throwable e) { return "Error during result conversion to String"; } + } catch (Throwable e) { return "Error during test execution"; } + } + + public static void main(String[] args) + { + try { + Tester t = new Tester(); + try { t.test(); } + catch(Throwable e) { } + try { System.out.println(t); } + catch(Throwable e) { } + } catch (Throwable e) { } + } + + private void test() + { + { + ((Tester_Class_2)(Tester_Class_0)((var_31 = true) ^ (var_31 |= false & true) ? func_10() : new Tester_Class_2[var_32])).var_1 = ((var_28 = new Tester_Class_0()).var_1 = (new Tester_Class_0().var_1 = new Tester_Class_2())); + } + new String(); + Tester_Class_2.var_13 = '['; + var_28 = (Tester_Class_2)(((var_31 ^= true) ? func_9() : new Tester_Class_0()).var_1 = new Tester_Class_2()); + var_28 = new Tester_Class_0(); + new String(); + { + if ((new boolean[var_30])[var_30] & 732877932 == 1.4654316E38F & "xpqy".replace(']', 'f').startsWith("pqrqunvfx") ? ((var_31 ^= (var_31 &= var_31)) ? !var_31 : (var_31 &= true)) : var_31) + { + var_31 &= var_31; + } + else + { + func_2(var_28 = new Tester_Class_0()); + } + { + ((new Tester_Class_0[var_30][var_30])[var_30][var_30]).var_1 = "uwrbjvl"; + var_28 = (Tester_Class_0)func_5(); + } + Tester_Class_2.var_13 = 's'; + Tester_Class_0 var_56 = var_28 = true ? func_6(func_5()) : (new Tester_Class_2[var_30][var_32])[var_32][var_32]; + double var_57 = 0; + var_29 += 1024895641427426304L % ~ ~Tester_Class_2.var_14; + while ((true || (var_31 = var_31)) && var_57 < 12) + { + (false & !false ? var_56 : (var_56 = var_56)).var_1 = "vbc"; + var_57++; + var_29 += func_0(var_30 /= (short)var_30 / var_32, false, var_57); + (var_31 ? (Tester_Class_2)var_56 : (new Tester_Class_2[var_30])[var_30]).var_1 = new double[var_31 ? (var_30 |= 177265600183083008L) : var_32]; + } + switch (var_31 ^ var_31 | ! (var_31 = false) & (var_31 & false) ? (true ? (short)var_30 : func_0(var_30, true, var_57)) : func_0(var_30, var_31, var_29 /= 2.7203017E38F)) + { + case 23: + var_31 ^= true ? var_31 : var_31; + break; + + case 40: + + default: + + case 104: + + } + Object var_58 = (var_31 ^= (var_31 ^= false) | (~3392263608888292352L < 1681682009 | var_31)) ? (((new Tester_Class_2[Tester_Class_2.func_5(Tester_Class_2.var_14, 3.3507317E38F, var_57)])[var_30 %= var_32]).var_1 = (var_56 = (Tester_Class_0)func_5())) : func_5(); + (var_56 = (var_28 = (var_56 = func_6(var_58)))).var_1 = (((new Tester_Class_2[var_30])[var_30]).var_1 = new float[(byte)Tester_Class_2.var_14][var_32]); + new Tester_Class_2().var_1 = new double[var_30]; + final Tester_Class_0 var_59 = var_28 = (!false & (false || (var_31 && !var_31) & false) ? var_31 : (var_31 |= !var_31)) ? (Tester_Class_2)(var_28 = new Tester_Class_2()) : (false ? new Tester_Class_2() : (Tester_Class_2)var_58); + } + var_30--; + { + var_29 += ~func_11(((new Tester_Interface_1[var_32][var_30][var_32])[var_30 ^= var_30])[var_32]); + } + float var_60 = 0F; + double var_61 = var_29; + do + { + long var_62; + var_60++; + "vcs".offsetByCodePoints((short)('w' | (short)var_30) & (new short[--var_30])[var_30], ((var_31 |= var_31) ^ (var_31 = var_31) ? var_32 : var_30) - (short)86413218); + } while (false && (var_60 < 100 && ((var_31 = false) ? var_31 : (var_31 ^= false)) & var_31)); + long var_63 = 0L; + double var_64 = (var_31 ? (Tester_Class_2.var_13 = 'V') : 'e') - (var_29 = 'A') * (var_29 = var_30); + var_31 &= (short)+ var_30-- + var_30 <= var_60; + while (false && (var_63 < 23 && false)) + { + var_30 >>= func_0(var_30, var_31, var_29) ^ ("".endsWith("mecvlajq" + "jhrbf") ? var_30 : (short)var_61); + var_63++; + var_28 = (Tester_Class_2)(var_28 = new Tester_Class_2()); + new Tester_Class_0(); + } + double var_65 = 0; + var_61 -= var_65; + for (((var_31 &= (var_31 ^= var_31)) | var_31 ? new Tester_Class_2() : new Tester_Class_2()).var_1 = ! (var_31 = false) && !var_31 ? func_10() : new Object[var_32][var_32]; var_31 | var_31 && (var_65 < 107 && (false ? !var_31 : (var_31 &= var_31))); var_30 *= Tester_Class_2.var_14) + { + var_28 = var_30 > (var_31 | true ? (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'k')) : (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'r'))) ? (Tester_Class_2)((var_28 = (Tester_Class_0)func_5()).var_1 = func_5()) : new Tester_Class_2(); + var_65++; + var_29 = "efothsl".startsWith("qk") ? 3.2306712E37F : +1.1835607464479516E308; + new Tester_Class_2().var_1 = new Tester_Class_0(); + } + double var_66 = 0; + func_6(((Tester_Class_2)((true ? (Tester_Class_2)func_10() : (Tester_Class_2)func_9()).var_1 = (var_28 = (Tester_Class_2)func_10()))).var_1 = ""); + while (false | (new boolean[var_30][var_30])[var_30][var_32] && (var_66 < 104 && false)) + { + ((var_31 ^= !false) ? "" : "slgr").toUpperCase(); + var_66++; + var_28 = func_6(func_9().var_1 = func_10()); + var_31 |= (var_31 |= true); + } + Tester_Class_2.var_13 = var_31 ? (Tester_Class_2.var_13 = 'Y') : (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = (Tester_Class_2.var_13 = func_4(var_63, 137999726, 1870981930)))); + int var_67 = 0; + final double var_68 = 9.955130040461458E307; + do + { + "".lastIndexOf(var_32 != (Tester_Class_2.var_13 = 'f') ? (Tester_Class_2.var_13 = 'C') : ~var_30, (char)3.187607E38F + (var_30 /= var_30)); + var_67++; + Tester_Class_2.var_13 = (Tester_Class_2.var_13 = 'B'); + } while (var_67 < 9 && var_31 ^ var_31); + int var_69 = 0; + (true ? func_6(func_10()) : (Tester_Class_2)func_9()).var_1 = ((var_28 = (var_28 = new Tester_Class_2())).var_1 = (func_6(new Tester_Class_2().var_1 = new Tester_Class_0()).var_1 = (Tester_Class_2)func_9())); + do + { + var_28 = (Tester_Class_2)(var_28 = (Tester_Class_0)(new Tester_Class_2().var_1 = "qs")); + var_69++; + var_31 ^= var_31; + } while (var_69 < 189); + (! (var_31 = true) | var_31 ? new Tester_Class_2() : (new Tester_Class_0[var_30])[var_30]).var_1 = (((new Tester_Class_2[var_30 ^= (short)var_30])[var_30]).var_1 = (var_31 ? var_31 : (var_31 |= false)) ? "lfhliyphg" : "impovq"); + ((var_31 ? var_32 == (short)8901596111720974336L : 220705842 != var_60) ? (new Tester_Class_2[var_30])[var_32] : (new Tester_Class_2[var_30][var_32])[var_30][var_30]).var_1 = (var_28 = ((char)var_30 >= "pngjthlf".lastIndexOf("jjbuojp") & var_31 ? var_31 : var_31) ? (new Tester_Class_2[var_32])[var_30] : func_6(new Tester_Class_2().var_1 = new String[var_32])); + Tester_Class_2.var_13 = 'c'; + } + public String toString() + { + String result = "[\n"; + result += "Tester.var_29 = "; result += Printer.print(var_29); + result += "\n"; + result += "Tester.var_30 = "; result += Printer.print(var_30); + result += "\n"; + result += "Tester.var_32 = "; result += Printer.print(var_32); + result += "\n"; + result += "Tester.var_31 = "; result += Printer.print(var_31); + result += "\n"; + result += "Tester.var_28 = "; result += Printer.print(var_28); + result += ""; + result += "\n]"; + return result; + } + static class Printer + { + public static String print(boolean arg) { return String.valueOf(arg); } + public static String print(byte arg) { return String.valueOf(arg); } + public static String print(short arg) { return String.valueOf(arg); } + public static String print(char arg) { return String.valueOf((int)arg); } + public static String print(int arg) { return String.valueOf(arg); } + public static String print(long arg) { return String.valueOf(arg); } + public static String print(float arg) { return String.valueOf(arg); } + public static String print(double arg) { return String.valueOf(arg); } + + + public static String print(Object arg) + { + return print_r(new java.util.Stack(), arg); + } + + private static String print_r(java.util.Stack visitedObjects, Object arg) + { + String result = ""; + if (arg == null) + result += "null"; + else + if (arg.getClass().isArray()) + { + for (int i = 0; i < visitedObjects.size(); i++) + if (visitedObjects.elementAt(i) == arg) return ""; + + visitedObjects.push(arg); + + final String delimiter = ", "; + result += "["; + + if (arg instanceof Object[]) + { + Object[] array = (Object[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print_r(visitedObjects, array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof boolean[]) + { + boolean[] array = (boolean[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof byte[]) + { + byte[] array = (byte[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof short[]) + { + short[] array = (short[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof char[]) + { + char[] array = (char[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof int[]) + { + int[] array = (int[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof long[]) + { + long[] array = (long[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof float[]) + { + float[] array = (float[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + else + if (arg instanceof double[]) + { + double[] array = (double[]) arg; + for (int i = 0; i < array.length; i++) + { + result += print(array[i]); + if (i < array.length - 1) result += delimiter; + } + } + + result += "]"; + visitedObjects.pop(); + + } else + { + result += arg.toString(); + } + + return result; + } + } +} + + diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 63a4b81940f..c749c17a66d 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -2,3 +2,7 @@ a3b3ba7d6034dc754b51ddc3d281399ac1cae5f1 jdk7-b25 da43cb85fac1646d6f97e4a35e510bbfdff97bdb jdk7-b26 bafed478d67c3acf7744aaad88b9404261ea6739 jdk7-b27 +b996318955c0ad8e9fa0ffb56c74f626786e863f jdk7-b28 +617ee8607cfd5fd81f233f3c0b690f85084687a0 jdk7-b29 +2d94a238a1641d074e6032dcdceed461d6f85d6a jdk7-b30 +255d64ee287e926e8629dd80bc67690e65eeba30 jdk7-b31 diff --git a/jaxp/make/Makefile b/jaxp/make/Makefile index 6de97e7e673..1f742fd849d 100644 --- a/jaxp/make/Makefile +++ b/jaxp/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 95df1d8c5f8..0224fa8b6b1 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -2,3 +2,7 @@ 59fd8224ba2da5c2d8d4c68e33cf33ab41ce8de0 jdk7-b25 debd37e1a422e580edb086c95d6e89199133a39c jdk7-b26 27d8f42862c11b4ddc4af2dd2d2a3cd86cda04c2 jdk7-b27 +eefcd5204500a11d6aa802dca9f961cf10ab64c2 jdk7-b28 +836c55713abab186e4de0c6eabd06ff008c7b8d0 jdk7-b29 +7f2466f8cc7009702e548d1a763254f546024d7e jdk7-b30 +f978623825364a2ad9c6f51d02fc9424a8b0bc86 jdk7-b31 diff --git a/jaxws/make/Makefile b/jaxws/make/Makefile index 3dc17bfa39f..e3019a3d45e 100644 --- a/jaxws/make/Makefile +++ b/jaxws/make/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/.hgtags b/jdk/.hgtags index 940e5c1079d..92c22dd5bf0 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -3,3 +3,7 @@ fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26 3e599d98875ddf919c8ea11cff9b3a99ba631a9b jdk7-b27 02e4c5348592a8d7fc2cba28bc5f8e35c0e17277 jdk7-b28 +e21f4266466cd1306b176aaa08b2cd8337a9be3d jdk7-b29 +b6d6877c1155621a175dccd12dc14c54f938fb8b jdk7-b30 +b7474b739d13bacd9972f88ac91f6350b7b0be12 jdk7-b31 +c51121419e30eac5f0fbbce45ff1711c4ce0de28 jdk7-b32 diff --git a/jdk/make/com/sun/Makefile b/jdk/make/com/sun/Makefile index 10a8642c817..0328f120d31 100644 --- a/jdk/make/com/sun/Makefile +++ b/jdk/make/com/sun/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/com/sun/java/pack/Makefile b/jdk/make/com/sun/java/pack/Makefile index 0a230f7364f..9229e3f4c99 100644 --- a/jdk/make/com/sun/java/pack/Makefile +++ b/jdk/make/com/sun/java/pack/Makefile @@ -97,9 +97,6 @@ ifeq ($(PLATFORM), windows) /D "J2SE_FTYPE=0x1L" RES = $(OBJDIR)/$(PGRM).res - - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false else LDOUTPUT = -o #Have a space LDDFLAGS += -lc diff --git a/jdk/make/com/sun/security/auth/module/Makefile b/jdk/make/com/sun/security/auth/module/Makefile index 303c8475163..d9f705d4df7 100644 --- a/jdk/make/com/sun/security/auth/module/Makefile +++ b/jdk/make/com/sun/security/auth/module/Makefile @@ -55,9 +55,6 @@ LIBRARY = jaas_nt EXTRA_LIBS += netapi32.lib user32.lib mpr.lib endif #fdlibm # code generates errors when compiled at warning level 3 and warnings are fatal - ifeq ($(ARCH_DATA_MODEL), 64) - COMPILER_WARNINGS_FATAL=false - endif # ARCH_DATA_MODEL endif # windows ifeq ($(PLATFORM), solaris) diff --git a/jdk/make/common/Defs-linux.gmk b/jdk/make/common/Defs-linux.gmk index 674b6f6a0e6..65814ba472a 100644 --- a/jdk/make/common/Defs-linux.gmk +++ b/jdk/make/common/Defs-linux.gmk @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -149,10 +149,9 @@ endif # ARCH PIC_CODE_LARGE = -fPIC PIC_CODE_SMALL = -fpic GLOBAL_KPIC = $(PIC_CODE_LARGE) +CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) ifeq ($(ARCH), amd64) - CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) -pipe -else - CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS) + CFLAGS_COMMON += -pipe endif # Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1 diff --git a/jdk/make/common/Defs-solaris.gmk b/jdk/make/common/Defs-solaris.gmk index 052c0c88fc8..d0874e43070 100644 --- a/jdk/make/common/Defs-solaris.gmk +++ b/jdk/make/common/Defs-solaris.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 @@ -40,6 +40,9 @@ # LDLIBS (set $(EXTRA_LIBS) instead) # LDLIBS_COMMON (set $(EXTRA_LIBS) instead) # LINTFLAGS (set $(OTHER_LINTFLAGS) instead) +# +# Note: CPPFLAGS are used in C and C++ compiles. +# # Get shared JDK settings include $(JDK_MAKE_SHARED_DIR)/Defs.gmk @@ -112,6 +115,10 @@ endif # Required with many of the source files. # -mt Assume multi-threaded (important) # +# The more unusual options to the Sun C compiler: +# +w Print more warnings +# +w2 Maximum warnings +# # # Debug flag for C and C++ compiler @@ -140,15 +147,34 @@ ifeq ($(FASTDEBUG), true) CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT) endif -CFLAGS_COMMON = -v -mt -L$(OBJDIR) -xc99=%none +CFLAGS_COMMON = -L$(OBJDIR) + +# Do not allow C99 language features like declarations in code etc. +CFLAGS_COMMON += -xc99=%none + +# Allow C++ comments in C code CFLAGS_COMMON += -xCC -CFLAGS_COMMON += -errshort=tags + +# Show error message tags on errors +CFLAGS_COMMON += -errshort=tags +CXXFLAGS_COMMON += -errtags=yes + +# Optimization flags CFLAGS_OPT = $(POPT) + +# Debug version flags CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) -CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) + +# Required C compiler flags +CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) + +# Maximum warnings all the time +CXXFLAGS_COMMON += +w +CFLAGS_COMMON += -v # Assume MT behavior all the time (important) -CXXFLAGS_COMMON = -mt +CXXFLAGS_COMMON += -mt +CFLAGS_COMMON += -mt # Assume no C++ exceptions are used CXXFLAGS_COMMON += -features=no%except -DCC_NOEX @@ -197,7 +223,6 @@ endif # Lint Flags: # -Xa ANSI C plus K&R, favor ANSI rules -# -Xarch=XXX Same as 'cc -xarch=XXX' # -fd report on old style func defs # -errchk=structarg report on 64bit struct args by value # -errchk=longptr64 report on 64bit to 32bit issues (ignores casts) @@ -206,6 +231,7 @@ endif # -x suppress unused externs # -u suppress extern func/vars used/defined # -errfmt=simple use one line errors with position info +# $(LINT_XARCH_OPTION) See Compiler-sun.gwk LINTFLAGS_COMMON = -Xa LINTFLAGS_COMMON += -fd @@ -224,42 +250,12 @@ LINTFLAGS_DBG = # Tell the compilers to never generate globalized names, all the time. CFLAGS_COMMON += -W0,-noglobal -# Arch specific settings (determines type of .o files and instruction set) -ifeq ($(ARCH_FAMILY), sparc) - ifdef VIS_NEEDED - XARCH_VALUE/32=v8plusa - XARCH_VALUE/64=v9a - else - # Someday this should change to improve optimization on UltraSPARC - # and abandon the old v8-only machines like the SPARCstation 10. - # Indications with Mustang is that alacrity runs do not show a - # big improvement using v8plus over v8, but other benchmarks might. - XARCH_VALUE/32=v8 - XARCH_VALUE/64=v9 - endif -endif -ifeq ($(ARCH_FAMILY), i586) - XARCH_VALUE/64=amd64 - XARCH_VALUE/32= -endif - -# Arch value based on current data model being built -XARCH_VALUE=$(XARCH_VALUE/$(ARCH_DATA_MODEL)) -ifneq ($(XARCH_VALUE), ) - # The actual compiler -xarch options to use - XARCH_OPTION/32 = -xarch=$(XARCH_VALUE/32) - XARCH_OPTION/64 = -xarch=$(XARCH_VALUE/64) - XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL)) -endif - -# If we have a specific -xarch value to use, add it -ifdef XARCH_OPTION - CFLAGS_COMMON += $(XARCH_OPTION) - CXXFLAGS_COMMON += $(XARCH_OPTION) - ASFLAGS_COMMON += $(XARCH_OPTION) - EXTRA_LIBS += $(XARCH_OPTION) - LINTFLAGS_COMMON += -Xarch=$(XARCH_VALUE) -endif +# If we have a specific arch value to use, add it +CFLAGS_COMMON += $(XARCH_OPTION) +CXXFLAGS_COMMON += $(XARCH_OPTION) +ASFLAGS_COMMON += $(AS_XARCH_OPTION) +EXTRA_LIBS += $(XARCH_OPTION) +LINTFLAGS_COMMON += $(LINT_XARCH_OPTION) # # uncomment the following to build with PERTURBALOT set @@ -267,8 +263,8 @@ endif # OTHER_CFLAGS += -DPERTURBALOT # -CPPFLAGS_COMMON = -D$(ARCH_FAMILY) -D__solaris__ -D_REENTRANT -CPPFLAGS_OPT = +CPPFLAGS_COMMON = -D__solaris__ -D$(ARCH_FAMILY) +CPPFLAGS_OPT = -DNDEBUG CPPFLAGS_DBG = -DDEBUG ifeq ($(ARCH_FAMILY), i586) diff --git a/jdk/make/common/Defs-windows.gmk b/jdk/make/common/Defs-windows.gmk index e9bdea85278..d7c11837e96 100644 --- a/jdk/make/common/Defs-windows.gmk +++ b/jdk/make/common/Defs-windows.gmk @@ -1,5 +1,5 @@ # -# Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 @@ -283,7 +283,7 @@ CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN ifeq ($(ARCH), amd64) CPPFLAGS_COMMON += -D_AMD64_ -Damd64 else - CPPFLAGS_COMMON += -DWIN32 -D_X86_ -Dx86 + CPPFLAGS_COMMON += -D_X86_ -Dx86 endif CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN @@ -292,17 +292,24 @@ CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN # CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map +# +# Use -wdNNNN to disable warning NNNN. +# C4800 is a warning about bool performance casts (can't make go away) +# +COMPILER_WARNINGS_TO_IGNORE = 4800 +CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%) + # # Add warnings and extra on 64bit issues # ifeq ($(ARCH_DATA_MODEL), 64) CFLAGS_COMMON += -Wp64 endif -CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL) # # Treat compiler warnings as errors, if requested # +CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL) ifeq ($(COMPILER_WARNINGS_FATAL),true) CFLAGS_COMMON += -WX endif @@ -352,17 +359,9 @@ else # BUILD_WIN_SA=1 # on the make command. ifdef BUILD_WIN_SA - ifeq ($(ARCH), amd64) - INCLUDE_SA = true - else - INCLUDE_SA = true - endif + INCLUDE_SA = true else - ifeq ($(ARCH), amd64) - INCLUDE_SA = false - else - INCLUDE_SA = false - endif + INCLUDE_SA = false endif endif @@ -404,7 +403,6 @@ ifdef JDK_UPDATE_VERSION else JDK_UPDATE_VER := 0 endif -JDK_VER = $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER) RC_FLAGS = /l 0x409 /r @@ -414,15 +412,23 @@ else RC_FLAGS += $(MS_RC_DEBUG_OPTION) endif -ifndef COPYRIGHT_YEAR - COPYRIGHT_YEAR = 2007 -endif +# Values for the RC variables defined in RC_FLAGS +JDK_RC_BUILD_ID = $(FULL_VERSION) +JDK_RC_COMPANY = $(COMPANY_NAME) +JDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary +JDK_RC_VER = \ + $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER) +JDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR) +JDK_RC_NAME = \ + $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG) +JDK_RC_FVER = \ + $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER) # J2SE name required here -RC_FLAGS += -d "J2SE_BUILD_ID=$(FULL_VERSION)" \ - -d "J2SE_COMPANY=$(COMPANY_NAME)" \ - -d "J2SE_COMPONENT=$(PRODUCT_NAME) Platform SE binary" \ - -d "J2SE_VER=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)" \ - -d "J2SE_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \ - -d "J2SE_NAME=$(PRODUCT_NAME) Platform SE $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)" \ - -d "J2SE_FVER=$(JDK_VER)" +RC_FLAGS += -d "J2SE_BUILD_ID=$(JDK_RC_BUILD_ID)" \ + -d "J2SE_COMPANY=$(JDK_RC_COMPANY)" \ + -d "J2SE_COMPONENT=$(JDK_RC_COMPONENT)" \ + -d "J2SE_VER=$(JDK_RC_VER)" \ + -d "J2SE_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \ + -d "J2SE_NAME=$(JDK_RC_NAME)" \ + -d "J2SE_FVER=$(JDK_RC_FVER)" diff --git a/jdk/make/common/Defs.gmk b/jdk/make/common/Defs.gmk index e83095ae917..16eb1e2258f 100644 --- a/jdk/make/common/Defs.gmk +++ b/jdk/make/common/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 @@ -703,7 +703,7 @@ endif ifdef ALT_COPYRIGHT_YEAR COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) else - COPYRIGHT_YEAR = $(shell $(DATE) '+%Y') + COPYRIGHT_YEAR := $(shell $(DATE) '+%Y') endif # Install of imported file (JDK_IMPORT_PATH, or some other external location) diff --git a/jdk/make/common/Release.gmk b/jdk/make/common/Release.gmk index f3a6c626d3b..42de79f70d6 100644 --- a/jdk/make/common/Release.gmk +++ b/jdk/make/common/Release.gmk @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -369,6 +369,7 @@ TOOLS = \ com/sun/jarsigner \ com/sun/mirror \ com/sun/source \ + com/sun/tools/classfile \ com/sun/tools/doclets \ com/sun/tools/example/debug/expr \ com/sun/tools/example/debug/tty \ @@ -378,6 +379,7 @@ TOOLS = \ com/sun/tools/javadoc \ com/sun/tools/apt \ com/sun/tools/javah \ + com/sun/tools/javap \ com/sun/tools/corba \ com/sun/tools/internal/xjc \ com/sun/tools/internal/ws \ @@ -568,6 +570,8 @@ $(NOT_RT_JAR_LIST): FRC $(ECHO) "sun/tools/java/" >> $@ $(ECHO) "sun/tools/javac/" >> $@ $(ECHO) "sun/tools/javap/" >> $@ + $(ECHO) "com/sun/tools/classfile/" >> $@ + $(ECHO) "com/sun/tools/javap/" >> $@ $(ECHO) "sun/tools/jconsole/" >> $@ $(ECHO) "sun/tools/jps/" >> $@ $(ECHO) "sun/tools/jstat/" >> $@ @@ -1236,7 +1240,6 @@ ifeq ($(PLATFORM), windows) $(RM) $(TEMPDIR)/rebase.input endif $(RM) -r $(JDK_IMAGE_DIR) - $(RM) -r $(JDK_DEBUG_IMAGE_DIR) $(RM) -r $(JRE_IMAGE_DIR) images images-clobber:: diff --git a/jdk/make/common/Rules.gmk b/jdk/make/common/Rules.gmk index 5325eeaedfe..251b31f53a2 100644 --- a/jdk/make/common/Rules.gmk +++ b/jdk/make/common/Rules.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 diff --git a/jdk/make/common/internal/BinaryPlugs.gmk b/jdk/make/common/internal/BinaryPlugs.gmk index 8eeb95d1284..a52b6175286 100644 --- a/jdk/make/common/internal/BinaryPlugs.gmk +++ b/jdk/make/common/internal/BinaryPlugs.gmk @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/common/internal/Defs-langtools.gmk b/jdk/make/common/internal/Defs-langtools.gmk index 4a1444bc932..e90b00a061f 100644 --- a/jdk/make/common/internal/Defs-langtools.gmk +++ b/jdk/make/common/internal/Defs-langtools.gmk @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -31,13 +31,15 @@ IMPORT_RT_PACKAGES += \ javax/tools IMPORT_TOOLS_PACKAGES += \ + com/sun/javadoc \ com/sun/mirror \ com/sun/source \ com/sun/tools/apt \ - com/sun/tools/javac \ - com/sun/tools/javah \ - com/sun/tools/javadoc \ + com/sun/tools/classfile \ com/sun/tools/doclets \ - com/sun/javadoc \ + com/sun/tools/javac \ + com/sun/tools/javadoc \ + com/sun/tools/javah \ + com/sun/tools/javap \ sun/tools/javap diff --git a/jdk/make/common/shared/Compiler-gcc.gmk b/jdk/make/common/shared/Compiler-gcc.gmk index d12adac959e..27501956368 100644 --- a/jdk/make/common/shared/Compiler-gcc.gmk +++ b/jdk/make/common/shared/Compiler-gcc.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -73,23 +73,18 @@ ifeq ($(PLATFORM), linux) REQUIRED_CC_VER = 4.0 REQUIRED_GCC_VER = 4.0.* else - ifeq ($(ARCH_DATA_MODEL), 32) - # i586 REQUIRED_CC_VER = 3.2 - REQUIRED_GCC_VER = 3.2.1* - REQUIRED_GCC_VER_INT = 3.2.1-7a - else - ifeq ($(ARCH), amd64) - # amd64 - REQUIRED_CC_VER = 3.2 - REQUIRED_GCC_VER = 3.2.* - endif - ifeq ($(ARCH), ia64) - # ia64 - REQUIRED_CC_VER = 3.2 - REQUIRED_GCC_VER = 2.9[56789].* - endif - endif + ifeq ($(ARCH_DATA_MODEL), 32) + REQUIRED_GCC_VER = 3.2.1* + REQUIRED_GCC_VER_INT = 3.2.1-7a + else + ifeq ($(ARCH), amd64) + REQUIRED_GCC_VER = 3.2.* + endif + ifeq ($(ARCH), ia64) + REQUIRED_GCC_VER = 2.9[56789].* + endif + endif endif # Option used to create a shared library SHARED_LIBRARY_FLAG = -shared -mimpure-text diff --git a/jdk/make/common/shared/Compiler-msvc.gmk b/jdk/make/common/shared/Compiler-msvc.gmk index 41509e51b09..a4b62617810 100644 --- a/jdk/make/common/shared/Compiler-msvc.gmk +++ b/jdk/make/common/shared/Compiler-msvc.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/make/common/shared/Compiler-sun.gmk b/jdk/make/common/shared/Compiler-sun.gmk index 8ce54825b7c..b4806bb4bc3 100644 --- a/jdk/make/common/shared/Compiler-sun.gmk +++ b/jdk/make/common/shared/Compiler-sun.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -31,6 +31,9 @@ COMPILER_NAME=Sun Studio # Sun Studio Compiler settings specific to Solaris ifeq ($(PLATFORM), solaris) + # FIXUP: Change to SS12 when validated + #COMPILER_VERSION=SS12 + #REQUIRED_CC_VER=5.9 COMPILER_VERSION=SS11 REQUIRED_CC_VER=5.8 CC = $(COMPILER_PATH)cc @@ -51,8 +54,8 @@ endif # Sun Studio Compiler settings specific to Linux ifeq ($(PLATFORM), linux) # This has not been tested - COMPILER_VERSION=SS11 - REQUIRED_CC_VER=5.8 + COMPILER_VERSION=SS12 + REQUIRED_CC_VER=5.9 CC = $(COMPILER_PATH)cc CPP = $(COMPILER_PATH)cc -E CXX = $(COMPILER_PATH)CC @@ -74,3 +77,58 @@ endif _CC_VER :=$(shell $(CC) -V 2>&1 | $(HEAD) -n 1) CC_VER :=$(call GetVersion,"$(_CC_VER)") +# Arch specific settings (determines type of .o files and instruction set) +# Starting in SS12 (5.9), the arch options changed. +# The assembler /usr/ccs/bin/as wants older SS11 (5.8) style options. +# Note: We need to have both 32 and 64 values at all times for awt Makefiles. +# +XARCH_OPTION_OLD/32 = +XARCH_OPTION_OLD/64 = +XARCH_OPTION_NEW/32 = -m32 +XARCH_OPTION_NEW/64 = -m64 +# Lint options are slightly different +LINT_XARCH_OPTION_OLD/32 = +LINT_XARCH_OPTION_OLD/64 = +LINT_XARCH_OPTION_NEW/32 = -m32 +LINT_XARCH_OPTION_NEW/64 = -m64 +ifeq ($(ARCH_FAMILY), sparc) + ifdef VIS_NEEDED + XARCH_OPTION_OLD/32 += -xarch=v8plusa + XARCH_OPTION_OLD/64 += -xarch=v9a + XARCH_OPTION_NEW/32 += -xarch=sparcvis + XARCH_OPTION_NEW/64 += -xarch=sparcvis + else + # Someday this should change to improve optimization on UltraSPARC + # and abandon v8, even change to sparcvis or sparcvis2, this + # abandons machines like the SPARCstation 10. + # Indications with jdk6 is that alacrity runs do not show a + # big improvement using v8plus over v8, but other benchmarks might. + XARCH_OPTION_OLD/32 += -xarch=v8 + XARCH_OPTION_OLD/64 += -xarch=v9 + # Note that this new option (SS12+) effectively means v8plus + XARCH_OPTION_NEW/32 += -xarch=sparc + XARCH_OPTION_NEW/64 += -xarch=sparc + endif + LINT_XARCH_OPTION_OLD/64 += -Xarch=v9 +endif +ifeq ($(ARCH_FAMILY), i586) + XARCH_OPTION_OLD/64 += -xarch=amd64 + LINT_XARCH_OPTION_OLD/64 += -Xarch=amd64 +endif +# Pick the options we want based on the compiler being used. +ifeq ($(shell expr $(CC_VER) \>= 5.9), 1) + XARCH_OPTION/32 = $(XARCH_OPTION_NEW/32) + XARCH_OPTION/64 = $(XARCH_OPTION_NEW/64) + LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_NEW/32) + LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_NEW/64) +else + XARCH_OPTION/32 = $(XARCH_OPTION_OLD/32) + XARCH_OPTION/64 = $(XARCH_OPTION_OLD/64) + LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_OLD/32) + LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_OLD/64) +endif +XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL)) +LINT_XARCH_OPTION = $(LINT_XARCH_OPTION/$(ARCH_DATA_MODEL)) +# The /usr/ccs/bin/as assembler always wants the older SS11 (5.8) options. +AS_XARCH_OPTION = $(XARCH_OPTION_OLD/$(ARCH_DATA_MODEL)) + diff --git a/jdk/make/common/shared/Defs-control.gmk b/jdk/make/common/shared/Defs-control.gmk index ee319616172..592f26de13b 100644 --- a/jdk/make/common/shared/Defs-control.gmk +++ b/jdk/make/common/shared/Defs-control.gmk @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 diff --git a/jdk/make/common/shared/Defs-java.gmk b/jdk/make/common/shared/Defs-java.gmk index b3e02702783..179e53a01a9 100644 --- a/jdk/make/common/shared/Defs-java.gmk +++ b/jdk/make/common/shared/Defs-java.gmk @@ -107,7 +107,10 @@ JAVACFLAGS = ifeq ($(DEBUG_CLASSFILES),true) JAVACFLAGS += -g endif -ifeq ($(COMPILER_WARNINGS_FATAL), true) +ifeq ($(JAVAC_MAX_WARNINGS), true) + JAVACFLAGS += -Xlint:all +endif +ifeq ($(JAVAC_WARNINGS_FATAL), true) JAVACFLAGS += -Werror endif @@ -180,7 +183,10 @@ endif # The javac options supplied to the boot javac is limited. This compiler # should only be used to build the 'make/tools' sources, which are not # class files that end up in the classes directory. -ifeq ($(COMPILER_WARNINGS_FATAL), true) +ifeq ($(JAVAC_MAX_WARNINGS), true) + BOOT_JAVACFLAGS += -Xlint:all +endif +ifeq ($(JAVAC_WARNINGS_FATAL), true) BOOT_JAVACFLAGS += -Werror endif BOOT_JAVACFLAGS += -encoding ascii diff --git a/jdk/make/common/shared/Defs-utils.gmk b/jdk/make/common/shared/Defs-utils.gmk index fe0ab883169..dacb4080093 100644 --- a/jdk/make/common/shared/Defs-utils.gmk +++ b/jdk/make/common/shared/Defs-utils.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/make/common/shared/Defs.gmk b/jdk/make/common/shared/Defs.gmk index 8fc28e239e0..af86be8085d 100644 --- a/jdk/make/common/shared/Defs.gmk +++ b/jdk/make/common/shared/Defs.gmk @@ -188,16 +188,18 @@ ifndef MILESTONE endif # Default names -LAUNCHER_NAME = java -PRODUCT_NAME = Java(TM) -PRODUCT_SUFFIX = SE Runtime Environment -COMPANY_NAME = Sun Microsystems, Inc. - ifdef OPENJDK LAUNCHER_NAME = openjdk PRODUCT_NAME = OpenJDK PRODUCT_SUFFIX = Runtime Environment - COMPANY_NAME = + JDK_RC_PLATFORM_NAME = Platform + COMPANY_NAME = N/A +else + LAUNCHER_NAME = java + PRODUCT_NAME = Java(TM) + PRODUCT_SUFFIX = SE Runtime Environment + JDK_RC_PLATFORM_NAME = Platform SE + COMPANY_NAME = Sun Microsystems, Inc. endif RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX) diff --git a/jdk/make/common/shared/Platform.gmk b/jdk/make/common/shared/Platform.gmk index 32cb08e3473..8da23c83fc4 100644 --- a/jdk/make/common/shared/Platform.gmk +++ b/jdk/make/common/shared/Platform.gmk @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -72,7 +72,6 @@ PLATFORM_SHARED=done # ISA_DIR solaris only: /sparcv9 or /amd64 # LIBARCH32 solaris only: sparc or i386 # LIBARCH64 solaris only: sparcv9 or amd64 -# REQUIRED_WINDOWS_NAME windows only: basic name of windows # REQUIRED_WINDOWS_VERSION windows only: specific version of windows # USING_CYGWIN windows only: true or false # WINDOWS_NT_VERSION_STRING windows only: long version name @@ -311,19 +310,11 @@ ifeq ($(PLATFORM), windows) endif endif export ARCH_DATA_MODEL - # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel - ARCH=i586 - LIBARCH=i386 - # Value of Java os.arch property - ARCHPROP=x86 - REQUIRED_WINDOWS_NAME=Windows Professional 2000 - REQUIRED_WINDOWS_VERSION=5 0 Service Pack 4 ifeq ($(ARCH_DATA_MODEL), 64) # If the user wants to perform a cross compile build then they must # - set ARCH_DATA_MODEL=64 and either # + set ARCH to ia64 or amd64, or - REQUIRED_WINDOWS_NAME=Windows Server 2003 - REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1 + REQUIRED_WINDOWS_VERSION=Server 2003 Enterprise x64 Edition ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64) ARCH=amd64 else @@ -332,6 +323,14 @@ ifeq ($(PLATFORM), windows) LIBARCH=$(ARCH) # Value of Java os.arch property ARCHPROP=$(LIBARCH) + else + REQUIRED_WINDOWS_VERSION=2000 or Unknown + #REQUIRED_WINDOWS_VERSION=XP Professional + # LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel + ARCH=i586 + LIBARCH=i386 + # Value of Java os.arch property + ARCHPROP=x86 endif ARCH_FAMILY = $(ARCH) # Where is unwanted output to be delivered? @@ -371,37 +370,43 @@ ifeq ($(PLATFORM), windows) # ISHIELD_TEMP_MIN is the difference of an empty C:\TEMP vs. one after a # bundles build on windows. ISHIELD_TEMP_MIN=250000 - REQUIRED_DXSDK_VER = 0x0700 + REQUIRED_DXSDK_VER = 0x0900 OS_VENDOR = Microsoft # How much RAM does this machine have: - ifeq ($(USING_CYGWIN),true) - # CYGWIN has the 'free' utility - _MB_OF_MEMORY := \ - $(shell free -m | grep Mem: | awk '{print $$2;}' ) - else - # Windows 2000 has the mem utility, but two memory areas - # extended memory is what is beyond 1024M - _B_OF_EXT_MEMORY := \ - $(shell mem 2> $(DEV_NULL) | grep 'total contiguous extended memory' | awk '{print $$1;}') - ifeq ($(_B_OF_EXT_MEMORY),) - _B_OF_MEMORY := \ - $(shell mem 2> $(DEV_NULL) | grep 'total conventional memory' | awk '{print $$1;}') - else - _B_OF_MEMORY := \ - $(shell expr 1048576 '+' $(_B_OF_EXT_MEMORY) 2> $(DEV_NULL)) - endif - ifeq ($(_B_OF_MEMORY),) - # Windows 2003 has the systeminfo utility use it if mem doesn't work + ifeq ($(JDK_HAS_MEM_INFO),) + ifeq ($(USING_CYGWIN),true) + # CYGWIN has the 'free' utility _MB_OF_MEMORY := \ - $(shell systeminfo 2> $(DEV_NULL) | grep 'Total Physical Memory:' | awk '{print $$4;}' | sed -e 's@,@@') + $(shell free -m | grep Mem: | awk '{print $$2;}' ) else - _MB_OF_MEMORY := $(shell expr $(_B_OF_MEMORY) '/' 1024 2> $(DEV_NULL)) + # Windows 2000 has the mem utility, but two memory areas + # extended memory is what is beyond 1024M + _B_OF_EXT_MEMORY := \ + $(shell mem 2> $(DEV_NULL) | \ + grep 'total contiguous extended memory' | awk '{print $$1;}') + ifeq ($(_B_OF_EXT_MEMORY),) + _B_OF_MEMORY := \ + $(shell mem 2> $(DEV_NULL) | \ + grep 'total conventional memory' | awk '{print $$1;}') + else + _B_OF_MEMORY := \ + $(shell expr 1048576 '+' $(_B_OF_EXT_MEMORY) 2> $(DEV_NULL)) + endif + ifeq ($(_B_OF_MEMORY),) + # Windows 2003 has the systeminfo utility use it if mem doesn't work + _MB_OF_MEMORY := \ + $(shell systeminfo 2> $(DEV_NULL) | \ + grep 'Total Physical Memory:' | \ + awk '{print $$4;}' | sed -e 's@,@@') + else + _MB_OF_MEMORY := $(shell expr $(_B_OF_MEMORY) '/' 1024 2> $(DEV_NULL)) + endif + endif + ifeq ($(shell expr $(_MB_OF_MEMORY) '+' 0 2> $(DEV_NULL)), $(_MB_OF_MEMORY)) + MB_OF_MEMORY := $(_MB_OF_MEMORY) + else + MB_OF_MEMORY := 512 endif - endif - ifeq ($(shell expr $(_MB_OF_MEMORY) '+' 0 2> $(DEV_NULL)), $(_MB_OF_MEMORY)) - MB_OF_MEMORY := $(_MB_OF_MEMORY) - else - MB_OF_MEMORY := 512 endif endif @@ -447,30 +452,38 @@ endif # system swapping during the build. # If we don't know, assume 512. Subtract 128 from MB for VM MAX. # Don't set VM max over 1024-128=896. -ifneq ($(MB_OF_MEMORY),) - LOW_MEMORY_MACHINE := $(shell \ - if [ $(MB_OF_MEMORY) -le 512 ] ; then \ - echo "true"; \ - else \ - echo "false"; \ - fi) - MAX_VM_MEMORY := $(shell \ - if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ - expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \ - else \ - echo "896"; \ - fi) - MIN_VM_MEMORY := $(shell \ - if [ $(MAX_VM_MEMORY) -le 128 ] ; then \ - expr $(MAX_VM_MEMORY) '-' 8 2> $(DEV_NULL) ; \ - else \ - echo "128"; \ - fi) -else - MB_OF_MEMORY := unknown - LOW_MEMORY_MACHINE := true - MAX_VM_MEMORY := 384 - MIN_VM_MEMORY := 128 +ifeq ($(JDK_HAS_MEM_INFO),) + JDK_HAS_MEM_INFO=true + export JDK_HAS_MEM_INFO + ifneq ($(MB_OF_MEMORY),) + LOW_MEMORY_MACHINE := $(shell \ + if [ $(MB_OF_MEMORY) -le 512 ] ; then \ + echo "true"; \ + else \ + echo "false"; \ + fi) + MAX_VM_MEMORY := $(shell \ + if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ + expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \ + else \ + echo "896"; \ + fi) + MIN_VM_MEMORY := $(shell \ + if [ $(MAX_VM_MEMORY) -le 128 ] ; then \ + expr $(MAX_VM_MEMORY) '-' 8 2> $(DEV_NULL) ; \ + else \ + echo "128"; \ + fi) + else + MB_OF_MEMORY := unknown + LOW_MEMORY_MACHINE := true + MAX_VM_MEMORY := 384 + MIN_VM_MEMORY := 128 + endif + export MB_OF_MEMORY + export LOW_MEMORY_MACHINE + export MAX_VM_MEMORY + export MIN_VM_MEMORY endif # If blanks in the username, use the first 4 words and pack them together diff --git a/jdk/make/common/shared/Sanity.gmk b/jdk/make/common/shared/Sanity.gmk index a6b19476c0b..3048281df91 100644 --- a/jdk/make/common/shared/Sanity.gmk +++ b/jdk/make/common/shared/Sanity.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -82,16 +82,17 @@ ifeq ($(PLATFORM), linux) endif ifeq ($(PLATFORM), windows) - WINVER=$(JDK_TOPDIR)/make/tools/winver/bin/winver.exe FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}') TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}') - WINDOWS_VERSION := $(shell \ - if [ -x $(WINVER) ]; then \ - $(WINVER) ; \ - else \ - $(ECHO) "Unknown Windows Version"; \ - fi) - DXSDK_VER := $(shell $(EGREP) DIRECTDRAW_VERSION $(DXSDK_INCLUDE_PATH)/ddraw.h 2>&1 | \ + # Localized systeminfo has localized labels, but not localized values. + _WINDOWS_VERSION := \ + $(shell systeminfo 2> $(DEV_NULL) | grep 'Microsoft' | grep 'Windows' | \ + cut -d':' -f2) + ifeq ($(_WINDOWS_VERSION),) + _WINDOWS_VERSION := Windows 2000 or Unknown (no systeminfo utility) + endif + WINDOWS_VERSION := $(strip $(_WINDOWS_VERSION)) + DXSDK_VER := $(shell $(EGREP) DIRECT3D_VERSION $(DXSDK_INCLUDE_PATH)/d3d9.h 2>&1 | \ $(EGREP) "\#define" | $(NAWK) '{print $$3}') endif @@ -264,9 +265,9 @@ ifndef OPENJDK "" >> $(WARNING_FILE) ; \ fi ifeq ($(PLATFORM), windows) - @if [ "$(WINDOWS_VERSION)" != "$(REQUIRED_WINDOWS_VERSION)" ]; then \ - $(ECHO) "WARNING: $(YOU_ARE_USING) an unsupported version of $(REQUIRED_WINDOWS_NAME). \n" \ - " The supported version is $(REQUIRED_WINDOWS_NAME) $(REQUIRED_WINDOWS_VERSION). \n" \ + @if [ "$(findstring $(REQUIRED_WINDOWS_VERSION),$(WINDOWS_VERSION))" = "" ]; then \ + $(ECHO) "WARNING: $(YOU_ARE_USING) an unknown version of Windows. \n" \ + " The required version is $(REQUIRED_WINDOWS_VERSION). \n" \ " $(YOU_ARE_USING) $(WINDOWS_VERSION) \n" \ "" >> $(WARNING_FILE) ; \ fi @@ -1257,7 +1258,7 @@ sane-unzip_version: ###################################################### sane-dxsdk: ifeq ($(PLATFORM), windows) - @if [ ! -r $(DXSDK_INCLUDE_PATH)/ddraw.h ]; then \ + @if [ ! -r $(DXSDK_INCLUDE_PATH)/d3d9.h ]; then \ $(ECHO) "ERROR: You do not have access to a valid DirectX SDK Include dir.\n" \ " The value of DXSDK_INCLUDE_PATH must point a valid DX SDK dir.\n" \ " Please check your access to \n" \ @@ -1286,7 +1287,7 @@ ifeq ($(PLATFORM), windows) " This may result in a build failure.\n" \ " The DirectX SDK Include dir was obtained from the following location:\n" \ " $(DXSDK_INCLUDE_PATH) \n" \ - " Please change your DirectX SDK to version 7 or 9 (Summer 2004 Update or newer).\n" \ + " Please change your DirectX SDK to version 9 (Summer 2004 Update or newer).\n" \ " Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \ " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \ " Or http://www.microsoft.com/directx\n" \ diff --git a/jdk/make/docs/CORE_PKGS.gmk b/jdk/make/docs/CORE_PKGS.gmk index 03d95a606aa..c768e7023db 100644 --- a/jdk/make/docs/CORE_PKGS.gmk +++ b/jdk/make/docs/CORE_PKGS.gmk @@ -1,5 +1,5 @@ # -# Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-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 diff --git a/jdk/make/docs/Makefile b/jdk/make/docs/Makefile index 5a5b496da51..21d7825d3a5 100644 --- a/jdk/make/docs/Makefile +++ b/jdk/make/docs/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/docs/NON_CORE_PKGS.gmk b/jdk/make/docs/NON_CORE_PKGS.gmk index 8c78c6ed78d..ccf7a0f79a8 100644 --- a/jdk/make/docs/NON_CORE_PKGS.gmk +++ b/jdk/make/docs/NON_CORE_PKGS.gmk @@ -1,5 +1,5 @@ # -# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-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 diff --git a/jdk/make/java/awt/Makefile b/jdk/make/java/awt/Makefile index 579aa58cff6..e019a309d9f 100644 --- a/jdk/make/java/awt/Makefile +++ b/jdk/make/java/awt/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 diff --git a/jdk/make/java/fdlibm/Makefile b/jdk/make/java/fdlibm/Makefile index fd2442b0321..ab7a411579c 100644 --- a/jdk/make/java/fdlibm/Makefile +++ b/jdk/make/java/fdlibm/Makefile @@ -46,8 +46,6 @@ ifeq ($(PLATFORM),windows) _OPT = $(CC_NO_OPT) OTHER_CFLAGS = CPPFLAGS_DBG += -DLOGGING - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif # diff --git a/jdk/make/java/hpi/windows/Makefile b/jdk/make/java/hpi/windows/Makefile index da163368e21..fa04ec6a362 100644 --- a/jdk/make/java/hpi/windows/Makefile +++ b/jdk/make/java/hpi/windows/Makefile @@ -37,8 +37,6 @@ include $(BUILDDIR)/common/Defs.gmk # windows compiler flags ifeq ($(PLATFORM),windows) CPPFLAGS_DBG += -DLOGGING - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif FILES_c = \ diff --git a/jdk/make/java/java/Makefile b/jdk/make/java/java/Makefile index 863ee1a303b..8755a4c3a6e 100644 --- a/jdk/make/java/java/Makefile +++ b/jdk/make/java/java/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -37,8 +37,6 @@ include $(BUILDDIR)/common/Defs.gmk # windows compiler flags ifeq ($(PLATFORM),windows) OTHER_CFLAGS = - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false # build directly into BINDIR... LIB_LOCATION = $(BINDIR) # Exported functions diff --git a/jdk/make/java/java/genlocales.gmk b/jdk/make/java/java/genlocales.gmk index 8ea0a0f2559..bda003b9ce1 100644 --- a/jdk/make/java/java/genlocales.gmk +++ b/jdk/make/java/java/genlocales.gmk @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/make/java/java/localegen.sh b/jdk/make/java/java/localegen.sh index b4506b97854..8f79eaebb88 100644 --- a/jdk/make/java/java/localegen.sh +++ b/jdk/make/java/java/localegen.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/make/java/java/mapfile-vers b/jdk/make/java/java/mapfile-vers index 38f9e126d82..ad0380979a9 100644 --- a/jdk/make/java/java/mapfile-vers +++ b/jdk/make/java/java/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/java/java_crw_demo/Makefile b/jdk/make/java/java_crw_demo/Makefile index 2157e2f892c..c65a84df1e8 100644 --- a/jdk/make/java/java_crw_demo/Makefile +++ b/jdk/make/java/java_crw_demo/Makefile @@ -47,11 +47,6 @@ FILES_c = java_crw_demo.c OTHER_INCLUDES = -I$(SRCDIR) -# -# This removes all asserts in the optimized version -# -CPPFLAGS_OPT += -DNDEBUG - # # Library to compile. # diff --git a/jdk/make/java/java_hprof_demo/Makefile b/jdk/make/java/java_hprof_demo/Makefile index 71529433b14..9c97a6a24e5 100644 --- a/jdk/make/java/java_hprof_demo/Makefile +++ b/jdk/make/java/java_hprof_demo/Makefile @@ -91,11 +91,6 @@ endif # INIT += $(LIBDIR)/jvm.hprof.txt -# -# This removes all asserts in the optimized version -# -CPPFLAGS_OPT += -DNDEBUG - # # This puts logging code in # diff --git a/jdk/make/java/jli/Makefile b/jdk/make/java/jli/Makefile index 236654fd4a9..5a1c312d7ab 100644 --- a/jdk/make/java/jli/Makefile +++ b/jdk/make/java/jli/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -115,9 +115,6 @@ ifeq ($(PLATFORM), windows) -export:JLI_ManifestIterate \ -export:JLI_SetTraceLauncher - # Files from zlib built here do not compile with warning level 3 - # if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC) diff --git a/jdk/make/java/main/java/Makefile b/jdk/make/java/main/java/Makefile index 5c876294c98..140a3001f80 100644 --- a/jdk/make/java/main/java/Makefile +++ b/jdk/make/java/main/java/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/java/main/javaw/Makefile b/jdk/make/java/main/javaw/Makefile index 1c03b23fab7..1ed70daa87e 100644 --- a/jdk/make/java/main/javaw/Makefile +++ b/jdk/make/java/main/javaw/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/jdk/make/java/net/Makefile b/jdk/make/java/net/Makefile index 6218c63776e..4141294c02c 100644 --- a/jdk/make/java/net/Makefile +++ b/jdk/make/java/net/Makefile @@ -94,8 +94,6 @@ include $(BUILDDIR)/common/Library.gmk ifeq ($(PLATFORM), windows) OTHER_LDLIBS = ws2_32.lib $(JVMLIB) - # Will not compile at warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false else OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB) endif diff --git a/jdk/make/java/nio/Makefile b/jdk/make/java/nio/Makefile index 635d80ce842..cff9ce5ceb2 100644 --- a/jdk/make/java/nio/Makefile +++ b/jdk/make/java/nio/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -134,7 +134,6 @@ ifeq ($(PLATFORM),windows) $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj endif ifeq ($(PLATFORM), linux) -COMPILER_WARNINGS_FATAL=true OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl endif ifeq ($(PLATFORM), solaris) @@ -166,8 +165,8 @@ include $(BUILDDIR)/common/Library.gmk # Generate source files # -SPP = spp.sh -SPP_CMD = $(SH) $(SPP) +SPP_JARFILE = $(BUILDTOOLJARDIR)/spp.jar +SPP_CMD = $(BOOT_JAVA_CMD) -jar $(SPP_JARFILE) FILES_genout = $(FILES_gen:%.java=$(GENSRCDIR)/%.java) @@ -183,7 +182,7 @@ CS_GEN=$(NIO_GEN)/charset SCH_GEN=$(SNIO_GEN)/ch SCS_GEN=$(SNIO_GEN)/cs -sources: $(SPP) $(FILES_genout) +sources: $(SPP_JARFILE) $(FILES_genout) # # Generated buffer classes diff --git a/jdk/make/java/nio/genCharsetProvider.sh b/jdk/make/java/nio/genCharsetProvider.sh index 574722fb4a9..58cfdf0dbd7 100644 --- a/jdk/make/java/nio/genCharsetProvider.sh +++ b/jdk/make/java/nio/genCharsetProvider.sh @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-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 diff --git a/jdk/make/java/nio/genCoder.sh b/jdk/make/java/nio/genCoder.sh index def83d94dfd..769b98cd523 100644 --- a/jdk/make/java/nio/genCoder.sh +++ b/jdk/make/java/nio/genCoder.sh @@ -53,8 +53,8 @@ if [ x$what = xdecoder ]; then -Dcoding='decoding' \ -DOtherCoder='Encoder' \ -DreplTypeName='string' \ - -DdefaultRepl='"\\\\uFFFD"' \ - -DdefaultReplName='"\\\\uFFFD"<\/tt>' \ + -DdefaultRepl='"\\uFFFD"' \ + -DdefaultReplName='"\\uFFFD"<\/tt>' \ -DreplType='String' \ -DreplFQType='java.lang.String' \ -DreplLength='length()' \ @@ -84,7 +84,7 @@ elif [ x$what = xencoder ]; then -DOtherCoder='Decoder' \ -DreplTypeName='byte array' \ -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \ - -DdefaultReplName='{<\/tt>\\\ (byte)'"'"\\?"'"'<\/tt>\\\ }<\/tt>' \ + -DdefaultReplName='{<\/tt>\ (byte)'"'"\\?"'"'<\/tt>\ }<\/tt>' \ -DreplType='byte[]' \ -DreplFQType='byte[]' \ -DreplLength='length' \ diff --git a/jdk/make/java/nio/genExceptions.sh b/jdk/make/java/nio/genExceptions.sh index 2de5e9cd784..da72ef9a3bc 100644 --- a/jdk/make/java/nio/genExceptions.sh +++ b/jdk/make/java/nio/genExceptions.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 diff --git a/jdk/make/java/nio/spp.sh b/jdk/make/java/nio/spp.sh deleted file mode 100644 index 036ca228882..00000000000 --- a/jdk/make/java/nio/spp.sh +++ /dev/null @@ -1,165 +0,0 @@ -#! /bin/sh - -# -# Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. -# 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. -# - -# SPP: A simple/sed-based/stream preprocessor -# Mark Reinhold / mr@sun.com -# -# Usage: spp [-be] [-Kkey] -Dvar=value ... out -# -# Source-file constructs -# -# Meaningful only at beginning of line, works with any number of keys: -# -# #if[key] Includes text between #if/#end if -Kkey specified, -# #else[key] otherwise changes text to blank lines; key test -# #end[key] may be negated by prefixing !, e.g., #if[!key] -# -# #begin If -be is specified then lines up to and including -# #end #begin, and from #end to EOF, are deleted -# -# #warn Changed into warning that file is generated -# -# // ## Changed into blank line -# -# Meaningful anywhere in line, works only for first two keys: -# -# {#if[key]?yes} Expands to yes if -Kkey specified -# {#if[key]?yes:no} Expands to yes if -Kkey, otherwise no -# {#if[!key]?yes} Expands to yes if -Kother -# {#if[!key]?yes:no} Expands to yes if -Kother, otherwise no -# $var$ Expands to value if -Dvar=value given -# -# yes, no must not contain whitespace -# -# If the environment variable SED is defined, uses that instead of sed -# If the environment variable NAWK is defined, uses that instead of awk -# - -SED=${SED:-sed} -NAWK=${NAWK:-awk} - -# Map a string of the form -Dvar=value into an appropriate sed command -# -subst() { - # The first two lines are to avoid the direct use of echo, - # which does not treat backslashes consistently across platforms - echo '' \ - | $SED -e "s.*$*" \ - | $SED -e 's-D\([a-zA-Z_][-a-zA-Z_]*\)=\(.*\)'"s\\\\\$\\1\\\\\$\2gg" \ - -e 's-D\([a-zA-Z_][-a-zA-Z_]*\)'"s\\\\\$\\1\\\\\$1gg" \ - -e 's/ //g' -} - -es= -be= -keys= -key1=_1_ -key2=_2_ -while [ $# -gt 0 ]; do - case "$1" in - -be) - be='-e 1,/^#begin$/d -e /^#end$/,$d' - ;; - -D*) - es="$es -e `subst $1`" - ;; - -K*) - nk=`echo $1 | $SED -e 's/-K//'` - if [ "x$keys" = x ]; then keys="$nk"; else keys="$keys $nk"; fi - if [ "x$key1" = x_1_ ]; then key1="$nk"; - elif [ "x$key2" = x_2_ ]; then key2="$nk"; fi - ;; - *) - echo "Usage: $0 [-be] [-Kkey] -Dvar=value ... out" - exit 1 - ;; - esac - shift -done - -text='[-a-zA-Z0-9&;,.<>/#() ]' - -$SED $es \ - -e 's// /g' \ - -e "s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@" \ - -e 's-// ##.*$--' $be \ - -e "s/{#if\[$key1\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[!$key1\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[$key1\]?\($text*\)}/\1/g" \ - -e "s/{#if\[!$key1\]?\($text*\)}//g" \ - -e "s/{#if\[$key2\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[!$key2\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[$key2\]?\($text*\)}/\1/g" \ - -e "s/{#if\[!$key2\]?\($text*\)}//g" \ - -e "s/{#if\[[a-z]*\]?\($text*\):\($text*\)}/\2/g" \ - -e "s/{#if\[![a-z]*\]?\($text*\):\($text*\)}/\1/g" \ - -e "s/{#if\[[a-z]*\]?\($text*\)}//g" \ - -e "s/{#if\[![a-z]*\]?\($text*\)}/\1/g" \ -| $NAWK \ - 'function key(s) { - i = match(s, "[a-zA-Z][a-zA-Z]*\\]"); - if (i > 0) return substr(s, i, RLENGTH - 1); - return "XYZZY"; } - function neg(s) { return match(s, "!") > 0; } - BEGIN { - KEYS = "'"$keys"'" - n = split(KEYS, ks, " *"); - for (i = 1; i <= n; i++) keys[ks[i]] = 1; - top = 1; copy[top] = 1 } - /^#if\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - n = neg($0); - stack[++top] = k; - if ((k in keys) == !n) { - copy[top] = copy[top - 1]; - } else { - copy[top] = 0; - } - print ""; next } - /^#else\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - if (stack[top] == k) { - copy[top] = copy[top - 1] && !copy[top]; - } else { - printf "%d: Mismatched #else key\n", NR | "cat 1>&2"; - exit 11 - } - print ""; next } - /^#end\[!?[a-zA-Z][a-zA-Z]*\]/ \ - { k = key($0); - if (stack[top] == k) { - top--; - } else { - printf "%d: Mismatched #end key\n", NR | "cat 1>&2" - exit 11 - } - print ""; next } - /^#/ { - printf "%d: Malformed #directive\n", NR | "cat 1>&2" - exit 11 - } - { if (copy[top]) print; else print "" }' diff --git a/jdk/make/java/npt/Makefile b/jdk/make/java/npt/Makefile index 48cab86ae07..fe9eb0ad4e3 100644 --- a/jdk/make/java/npt/Makefile +++ b/jdk/make/java/npt/Makefile @@ -52,11 +52,6 @@ FILES_c = \ OTHER_INCLUDES = -I$(SRCDIR) -I$(PSRCDIR) -# -# This removes all asserts in the optimized version -# -CPPFLAGS_OPT += -DNDEBUG - # # Library to compile. # diff --git a/jdk/make/java/sun_nio/FILES_java.gmk b/jdk/make/java/sun_nio/FILES_java.gmk index 13f4fe88d27..91fc9efed28 100644 --- a/jdk/make/java/sun_nio/FILES_java.gmk +++ b/jdk/make/java/sun_nio/FILES_java.gmk @@ -1,5 +1,5 @@ # -# Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 diff --git a/jdk/make/java/verify/Makefile b/jdk/make/java/verify/Makefile index a90862d516a..c647d508569 100644 --- a/jdk/make/java/verify/Makefile +++ b/jdk/make/java/verify/Makefile @@ -43,8 +43,6 @@ ifeq ($(PLATFORM), windows) # JAVALIB = EXTRA_LIBS = - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif # diff --git a/jdk/make/java/zip/Makefile b/jdk/make/java/zip/Makefile index e25e46f1e4a..00b381d5085 100644 --- a/jdk/make/java/zip/Makefile +++ b/jdk/make/java/zip/Makefile @@ -49,9 +49,6 @@ FILES_export = \ ifneq ($(PLATFORM), windows) OTHER_CFLAGS += -DUSE_MMAP -else - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif # diff --git a/jdk/make/javax/Makefile b/jdk/make/javax/Makefile index 678fe8926f8..8ec72ade7e1 100644 --- a/jdk/make/javax/Makefile +++ b/jdk/make/javax/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/jdk/make/javax/others/Makefile b/jdk/make/javax/others/Makefile index f5ce890138a..cf8f30fd5e1 100644 --- a/jdk/make/javax/others/Makefile +++ b/jdk/make/javax/others/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 diff --git a/jdk/make/jdk_generic_profile.sh b/jdk/make/jdk_generic_profile.sh index 73801313b4f..32dd86197ef 100644 --- a/jdk/make/jdk_generic_profile.sh +++ b/jdk/make/jdk_generic_profile.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -119,7 +119,7 @@ if [ "${osname}" = SunOS ] ; then # System place where JDK installed images are stored? jdk_instances=/usr/jdk/instances - # Get the SS11 compilers (and latest patches for them too) + # Get the Sun Studio compilers (and latest patches for them too) if [ "${ALT_COMPILER_PATH}" = "" ] ; then ALT_COMPILER_PATH=/opt/SUNWspro/bin export ALT_COMPILER_PATH diff --git a/jdk/make/jpda/back/Makefile b/jdk/make/jpda/back/Makefile index a974bff608b..bd9818365e3 100644 --- a/jdk/make/jpda/back/Makefile +++ b/jdk/make/jpda/back/Makefile @@ -52,11 +52,6 @@ ifneq ($(PLATFORM), windows) OTHER_LDLIBS += -ldl endif # PLATFORM -# -# This turns off all assert() checking in the optimized library -# -CPPFLAGS_OPT += -DNDEBUG - # # This controls the ability to do logging in the library. # diff --git a/jdk/make/jpda/transport/shmem/Makefile b/jdk/make/jpda/transport/shmem/Makefile index ad5ff4b3729..a1e2382500a 100644 --- a/jdk/make/jpda/transport/shmem/Makefile +++ b/jdk/make/jpda/transport/shmem/Makefile @@ -36,13 +36,6 @@ FILES_m = mapfile-vers include $(BUILDDIR)/common/Defs.gmk -# 64-bit windows does not build at -W3 if warnings are fatal -ifeq ($(PLATFORM), windows) - ifeq ($(ARCH_DATA_MODEL), 64) - COMPILER_WARNINGS_FATAL=false - endif -endif - FILES_c = \ SharedMemoryTransport.c \ SharedMemoryConnection.c \ diff --git a/jdk/make/jpda/transport/socket/Makefile b/jdk/make/jpda/transport/socket/Makefile index 07c5642a2d3..828613d49ed 100644 --- a/jdk/make/jpda/transport/socket/Makefile +++ b/jdk/make/jpda/transport/socket/Makefile @@ -36,11 +36,6 @@ FILES_m = mapfile-vers include $(BUILDDIR)/common/Defs.gmk -ifeq ($(PLATFORM), windows) - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false -endif - ifeq ($(PLATFORM), linux) OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread endif diff --git a/jdk/make/jprt.config b/jdk/make/jprt.config index 0d18b274ca5..99ee4c4e793 100644 --- a/jdk/make/jprt.config +++ b/jdk/make/jprt.config @@ -1,7 +1,7 @@ #!echo "This is not a shell script" ############################################################################# # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 @@ -133,9 +133,15 @@ if [ "${osname}" = SunOS ] ; then solaris_arch=i386 fi - # Get the SS11 compilers into path (make sure it matches ALT setting) - compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/SS11/bin - compiler_name=SS11 + # Get the compilers into path (make sure it matches ALT setting) + if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then + compiler_name=${JPRT_SOLARIS_COMPILER_NAME} + else + # FIXUP: Change to SS12 when validated + #compiler_name=SS12 + compiler_name=SS11 + fi + compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin ALT_COMPILER_PATH="${compiler_path}" export ALT_COMPILER_PATH dirMustExist "${compiler_path}" ALT_COMPILER_PATH diff --git a/jdk/make/sun/Makefile b/jdk/make/sun/Makefile index 0ce9014e7e1..8964d1db29f 100644 --- a/jdk/make/sun/Makefile +++ b/jdk/make/sun/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 diff --git a/jdk/make/sun/awt/FILES_c_windows.gmk b/jdk/make/sun/awt/FILES_c_windows.gmk index d01e5e8dc32..1a9b3b6ad3c 100644 --- a/jdk/make/sun/awt/FILES_c_windows.gmk +++ b/jdk/make/sun/awt/FILES_c_windows.gmk @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -112,29 +112,11 @@ FILES_cpp = \ GDIHashtable.cpp \ Devices.cpp \ ObjectList.cpp \ - DDBlitLoops.cpp \ - DDRenderer.cpp \ GDIBlitLoops.cpp \ GDIRenderer.cpp \ - Win32OffScreenSurfaceData.cpp \ - Win32SurfaceData.cpp \ - WinBackBufferSurfaceData.cpp \ + GDIWindowSurfaceData.cpp \ WindowsFlags.cpp \ - WBufferStrategy.cpp \ WPrinterJob.cpp \ - ddrawUtils.cpp \ - dxCapabilities.cpp \ - dxInit.cpp \ - RegistryKey.cpp \ - D3DBlitLoops.cpp \ - D3DContext.cpp \ - D3DMaskFill.cpp \ - D3DRenderer.cpp \ - D3DRuntimeTest.cpp \ - D3DSurfaceData.cpp \ - D3DTextRenderer_md.cpp \ - D3DUtils.cpp \ - ddrawObject.cpp \ awt_AWTEvent.cpp \ awt_BitmapUtil.cpp \ awt_Brush.cpp \ @@ -171,7 +153,6 @@ FILES_cpp = \ awt_Menu.cpp \ awt_MenuBar.cpp \ awt_MenuItem.cpp \ - awt_MMStub.cpp \ awt_MouseEvent.cpp \ awt_Object.cpp \ awt_Palette.cpp \ @@ -189,7 +170,6 @@ FILES_cpp = \ awt_TextComponent.cpp \ awt_TextField.cpp \ awt_Toolkit.cpp \ - awt_Unicode.cpp \ awt_Window.cpp \ awt_Win32GraphicsEnv.cpp \ awt_Win32GraphicsDevice.cpp \ @@ -199,10 +179,25 @@ FILES_cpp = \ awt_Mlib.cpp \ awt_new.cpp \ awt_TrayIcon.cpp \ + ShaderList.cpp \ + D3DBlitLoops.cpp \ + D3DBufImgOps.cpp \ + D3DContext.cpp \ + D3DGlyphCache.cpp \ + D3DGraphicsDevice.cpp \ + D3DMaskBlit.cpp \ + D3DMaskCache.cpp \ + D3DMaskFill.cpp \ + D3DPipelineManager.cpp \ + D3DPaints.cpp \ + D3DRenderer.cpp \ + D3DRenderQueue.cpp \ + D3DResourceManager.cpp \ + D3DSurfaceData.cpp \ + D3DTextRenderer.cpp \ + D3DVertexCacher.cpp \ ShellFolder2.cpp \ ThemeReader.cpp \ ComCtl32Util.cpp \ initIDs.cpp \ - awt_dlls.cpp \ - UnicowsLoader.cpp \ MouseInfo.cpp diff --git a/jdk/make/sun/awt/FILES_export_unix.gmk b/jdk/make/sun/awt/FILES_export_unix.gmk index f20666caaf0..43637e7c4cb 100644 --- a/jdk/make/sun/awt/FILES_export_unix.gmk +++ b/jdk/make/sun/awt/FILES_export_unix.gmk @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -49,6 +49,9 @@ FILES_export = \ sun/java2d/loops/TransformHelper.java \ sun/java2d/loops/GraphicsPrimitiveMgr.java \ sun/java2d/loops/GraphicsPrimitive.java \ + sun/java2d/pipe/hw/AccelSurface.java \ + sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \ + sun/java2d/pipe/hw/ContextCapabilities.java \ sun/awt/image/ImagingLib.java \ sun/java2d/SurfaceData.java \ sun/java2d/SunGraphics2D.java \ @@ -74,6 +77,7 @@ FILES_export = \ sun/java2d/pipe/BufferedContext.java \ sun/java2d/pipe/BufferedMaskBlit.java \ sun/java2d/pipe/BufferedOpCodes.java \ + sun/java2d/pipe/BufferedMaskBlit.java \ sun/java2d/pipe/BufferedPaints.java \ sun/java2d/pipe/BufferedRenderPipe.java \ sun/java2d/pipe/BufferedTextPipe.java \ diff --git a/jdk/make/sun/awt/FILES_export_windows.gmk b/jdk/make/sun/awt/FILES_export_windows.gmk index 418e896ba89..95933ceb396 100644 --- a/jdk/make/sun/awt/FILES_export_windows.gmk +++ b/jdk/make/sun/awt/FILES_export_windows.gmk @@ -1,5 +1,5 @@ # -# Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2000-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 @@ -125,14 +125,9 @@ FILES_export2 = \ sun/awt/image/BufImgSurfaceData.java \ sun/awt/image/DataBufferNative.java \ sun/awt/shell/Win32ShellFolder2.java \ - sun/java2d/windows/DDBlitLoops.java \ - sun/java2d/windows/DDRenderer.java \ - sun/java2d/windows/DDScaleLoops.java \ sun/java2d/windows/GDIBlitLoops.java \ sun/java2d/windows/GDIRenderer.java \ - sun/java2d/windows/Win32OffScreenSurfaceData.java \ - sun/java2d/windows/Win32SurfaceData.java \ - sun/java2d/windows/WinBackBufferSurfaceData.java \ + sun/java2d/windows/GDIWindowSurfaceData.java \ sun/java2d/windows/WindowsFlags.java \ sun/java2d/loops/Blit.java \ sun/java2d/loops/BlitBg.java \ @@ -219,6 +214,9 @@ FILES_export3 = \ sun/awt/windows/WBufferStrategy.java \ sun/awt/windows/WTrayIconPeer.java \ sun/awt/image/ImagingLib.java \ + sun/java2d/pipe/hw/AccelSurface.java \ + sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \ + sun/java2d/pipe/hw/ContextCapabilities.java \ sun/java2d/pipe/BufferedContext.java \ sun/java2d/pipe/BufferedMaskBlit.java \ sun/java2d/pipe/BufferedOpCodes.java \ @@ -229,13 +227,6 @@ FILES_export3 = \ sun/java2d/pipe/ShapeSpanIterator.java \ sun/java2d/pipe/SpanClipRenderer.java \ sun/java2d/pipe/RegionIterator.java \ - sun/java2d/d3d/D3DBlitLoops.java \ - sun/java2d/d3d/D3DMaskFill.java \ - sun/java2d/d3d/D3DRenderer.java \ - sun/java2d/d3d/D3DContext.java \ - sun/java2d/d3d/D3DSurfaceData.java \ - sun/java2d/d3d/D3DBackBufferSurfaceData.java \ - sun/java2d/d3d/D3DTextRenderer.java \ sun/java2d/opengl/OGLBlitLoops.java \ sun/java2d/opengl/OGLContext.java \ sun/java2d/opengl/OGLMaskFill.java \ @@ -245,4 +236,13 @@ FILES_export3 = \ sun/java2d/opengl/OGLSurfaceData.java \ sun/java2d/opengl/OGLTextRenderer.java \ sun/java2d/opengl/WGLGraphicsConfig.java \ - sun/java2d/opengl/WGLSurfaceData.java + sun/java2d/opengl/WGLSurfaceData.java \ + sun/java2d/d3d/D3DBlitLoops.java \ + sun/java2d/d3d/D3DGraphicsDevice.java \ + sun/java2d/d3d/D3DSurfaceData.java \ + sun/java2d/d3d/D3DMaskFill.java \ + sun/java2d/d3d/D3DPaints.java \ + sun/java2d/d3d/D3DRenderQueue.java \ + sun/java2d/d3d/D3DRenderer.java \ + sun/java2d/d3d/D3DTextRenderer.java \ + sun/java2d/d3d/D3DContext.java diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index 53db7b5b674..2754dd75ec3 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-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 @@ -69,7 +69,6 @@ include FILES_export_windows.gmk # AUTO_JAVA_PRUNE += RemoteOffScreenImage.java -OTHER_CXXFLAGS += -DD3D_OVERLOADS OTHER_CFLAGS += $(GX_OPTION) -DMLIB_NO_LIBSUNMATH -DUNICODE -D_UNICODE OTHER_CXXFLAGS += $(GX_OPTION) -DUNICODE -D_UNICODE @@ -252,8 +251,14 @@ endif # PLATFORM ifeq ($(PLATFORM), windows) # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv WINDOWS OTHER_LDLIBS = kernel32.lib user32.lib gdi32.lib winspool.lib \ - imm32.lib ole32.lib uuid.lib $(JVMLIB) \ - shell32.lib + imm32.lib ole32.lib uuid.lib shell32.lib \ + comdlg32.lib winmm.lib comctl32.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 clean:: awt.clean @@ -448,7 +453,7 @@ OTHER_INCLUDES += -I$(CLASSHDRDIR)/../../java/jvm \ -I$(SHARE_SRC)/native/sun/dc/path \ -I$(SHARE_SRC)/native/sun/dc/doe \ -I$(SHARE_SRC)/native/sun/awt/debug \ - -I$(PLATFORM_SRC)/native/sun/awt \ + -I$(PLATFORM_SRC)/native/sun/awt # -I$(WINAWT_COMMON_native) # this is only required for compiling )/native/sun/awt/medialib/*.c files diff --git a/jdk/make/sun/awt/make.depend b/jdk/make/sun/awt/make.depend index dc05d779bf4..650e4c7fde8 100644 --- a/jdk/make/sun/awt/make.depend +++ b/jdk/make/sun/awt/make.depend @@ -1,4 +1,4 @@ -$(OBJDIR)/AccelGlyphCache.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(OBJDIR)/AccelGlyphCache.obj:: ../../../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 @@ -14,149 +14,145 @@ $(OBJDIR)/AnyInt.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/sha $(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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_AWTEvent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_BitmapUtil.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_BitmapUtil.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_Brush.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Brush.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Canvas.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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_Clipboard.obj:: $(CLASSHDRDIR)/sun_awt_windows_WClipboard.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Clipboard.obj:: $(CLASSHDRDIR)/sun_awt_windows_WClipboard.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.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_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_Color.obj:: $(CLASSHDRDIR)/sun_awt_windows_WColor.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Color.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Color.obj:: $(CLASSHDRDIR)/sun_awt_windows_WColor.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.h ../../../src/windows/native/sun/windows/awt_Color.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_Component.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Color.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_KeyboardFocusManager.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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/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/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_InputEvent.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_KeyboardFocusManager.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_InputEvent.h ../../../src/windows/native/sun/windows/awt_InputTextInfor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MouseEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Container.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Container.h ../../../src/windows/native/sun/windows/awt_Debug.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_IconCursor.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_IconCursor.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_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.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_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_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/locale_str.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Dialog.h ../../../src/windows/native/sun/windows/awt_dlls.h ../../../src/windows/native/sun/windows/awt_DnDDT.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_TextComponent.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_DataTransferer.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.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_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_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.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.h ../../../src/windows/native/sun/windows/awtmsg.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_Dialog.h ../../../src/windows/native/sun/windows/awt_DnDDT.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_PrintDialog.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Debug.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h $(OBJDIR)/awt_Desktop.obj:: ../../../src/share/javavm/export/jni.h ../../../src/windows/javavm/export/jni_md.h -$(OBJDIR)/awt_DesktopProperties.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WDesktopProperties.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/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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_DesktopProperties.h ../../../src/windows/native/sun/windows/awt_Dialog.h ../../../src/windows/native/sun/windows/awt_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_DesktopProperties.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WDesktopProperties.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_DesktopProperties.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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/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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Dimension.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Dimension.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_dlls.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_DnDDT.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WDropTargetContextPeer.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Dialog.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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/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_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_dnd_DnDConstants.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WDropTargetContextPeer.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Dialog.h ../../../src/windows/native/sun/windows/awt_dlls.h ../../../src/windows/native/sun/windows/awt_DnDDS.h ../../../src/windows/native/sun/windows/awt_DnDDT.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_DrawingSurface.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_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_DrawingSurface.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jawt.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Event.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_Event.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Event.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Font.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_Font.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_IconCursor.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_IconCursor.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_GDIObject.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.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_GDIObject.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_IconCursor.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_IconCursor.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_IconCursor.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.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_ImageRep.obj:: $(CLASSHDRDIR)/sun_awt_image_ImageRepresentation.h ../../../src/share/javavm/export/jni.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 +$(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_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/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_proto.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h +$(OBJDIR)/awt_InputEvent.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_InputEvent.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_InputEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_InputMethod.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethodDescriptor.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_InputMethod.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_WInputMethod.h $(CLASSHDRDIR)/sun_awt_windows_WInputMethodDescriptor.h $(CLASSHDRDIR)/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_InputTextInfor.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_InputTextInfor.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_InputTextInfor.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Insets.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_Insets.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_KeyboardFocusManager.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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_KeyboardFocusManager.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_KeyEvent.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_KeyEvent.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Label.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Label.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_Label.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Label.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_List.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_List.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_List.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Menu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_Menu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_MenuBar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_MenuBar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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_Mlib.obj:: $(CLASSHDRDIR)/java_awt_image_BufferedImage.h ../../../src/share/javavm/export/jni.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h +$(OBJDIR)/awt_MouseEvent.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/awt_MMStub.obj:: ../../../src/windows/native/sun/windows/awt_MMStub.h +$(OBJDIR)/awt_new.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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_MouseEvent.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MouseEvent.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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_new.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Palette.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Object.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Panel.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_Palette.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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_Panel.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Pen.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.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_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/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/safe_alloc.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/common/gdefs_md.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/windows/awt_Mlib.h +$(OBJDIR)/awt_PopupMenu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_Pen.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_GDIObject.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_PrintControl.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_PopupMenu.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WPrintDialog.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_PrintControl.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WPrinterJob.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WPrintDialog.h $(CLASSHDRDIR)/sun_awt_windows_WPrintDialogPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Rectangle.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Rectangle.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_WPrinterJob.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Robot.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_Rectangle.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Rectangle.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Scrollbar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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_Robot.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_AdjustmentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_ScrollPane.h $(CLASSHDRDIR)/java_awt_ScrollPaneAdjustable.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Insets.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_Scrollbar.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_TextArea.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_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_WTextAreaPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_PrintDialog.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_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.h $(CLASSHDRDIR)/java_awt_event_AdjustmentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_ScrollPane.h $(CLASSHDRDIR)/java_awt_ScrollPaneAdjustable.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_Insets.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_TextComponent.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.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_TextArea.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_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_WTextAreaPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_TextField.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_TextField.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_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextFieldPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.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.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_PrintDialog.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/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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_InputEvent.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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/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_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.h $(CLASSHDRDIR)/java_awt_TextComponent.h $(CLASSHDRDIR)/java_awt_TextField.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_WTextComponentPeer.h $(CLASSHDRDIR)/sun_awt_windows_WTextFieldPeer.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_awt_windows_WWindowPeer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_KeyboardFocusManager.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_TrayIcon.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_ActionEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_Toolkit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_List.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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_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 ../../../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/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/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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_InputEvent.h ../../../src/windows/native/sun/windows/awt_KeyEvent.h ../../../src/windows/native/sun/windows/awt_List.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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/GDIHashtable.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/ObjectList.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Win32GraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_TrayIcon.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_ActionEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Win32GraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_DataBuffer.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.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_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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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/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_Unicode.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/awt_Win32GraphicsEnv.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_Win32GraphicsConfig.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/awt_Win32GraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_color_ColorSpace.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_DataBuffer.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.h $(CLASSHDRDIR)/java_awt_MenuItem.h $(CLASSHDRDIR)/java_awt_peer_MenuComponentPeer.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_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/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/awt_Win32GraphicsEnv.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/dxInit.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/awt_Window.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(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.h $(CLASSHDRDIR)/java_awt_event_ComponentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Insets.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_IconCursor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_ComponentEvent.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Insets.h $(CLASSHDRDIR)/java_awt_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_IconCursor.h ../../../src/windows/native/sun/windows/awt_Insets.h ../../../src/windows/native/sun/windows/awt_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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/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)/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)/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)/BufferedMaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedMaskBlit.h $(CLASSHDRDIR)/sun_java2d_pipe_BufferedOpCodes.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/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/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/sun/windows/colordata.h ../../../src/windows/native/sun/windows/img_util_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 @@ -168,45 +164,53 @@ $(OBJDIR)/ByteGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src/s $(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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/ComCtl32Util.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBlitLoops.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.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/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/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 -$(OBJDIR)/D3DContext.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(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_SunGraphics2D.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.h ../../../src/share/native/sun/font/sunfontids.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/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/D3DRuntimeTest.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.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/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/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 -$(OBJDIR)/D3DMaskFill.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DMaskFill.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.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/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/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 -$(OBJDIR)/D3DRenderer.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DRenderer.h $(CLASSHDRDIR)/sun_java2d_windows_DDRenderer.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.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/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/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 -$(OBJDIR)/D3DRuntimeTest.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(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 ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DRuntimeTest.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DTestRaster.h ../../../src/windows/native/sun/java2d/d3d/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/dxInit.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/D3DGraphicsDevice.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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)/D3DSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_image_AffineTransformOp.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DBackBufferSurfaceData.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DSurfaceData.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/D3DTextRenderer_md.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DTextRenderer.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/D3DUtils.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(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 ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DSurfaceData.h ../../../src/windows/native/sun/java2d/d3d/D3DUtils.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/DataBufferNative.obj:: $(CLASSHDRDIR)/sun_awt_image_DataBufferNative.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/DDBlitLoops.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_DDBlitLoops.h $(CLASSHDRDIR)/sun_java2d_windows_DDScaleLoops.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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)/ddrawObject.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_DisplayMode.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/ddrawUtils.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/dxInit.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/DDRenderer.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_DDRenderer.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/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/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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/debug_assert.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(OBJDIR)/D3DSurfaceData.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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)/debug_mem.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.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/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/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 -$(OBJDIR)/debug_trace.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(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/jni.h ../../../src/share/native/common/gdefs.h ../../../src/share/native/common/jlong.h ../../../src/share/native/sun/java2d/ShaderList.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/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 -$(OBJDIR)/debug_util.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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 +$(OBJDIR)/DataBufferNative.obj:: $(CLASSHDRDIR)/sun_awt_image_DataBufferNative.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)/Devices.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/Trace.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/debug_assert.obj:: ../../../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/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/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/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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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 @@ -214,17 +218,13 @@ $(OBJDIR)/dither.obj:: ../../../src/share/native/sun/awt/image/cvutils/img_globa $(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/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/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/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/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)/dxCapabilities.obj:: ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h - -$(OBJDIR)/dxInit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/java_awt_Transparency.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_d3d_D3DContext.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/d3d/D3DRuntimeTest.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/dxInit.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/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/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 @@ -234,21 +234,23 @@ $(OBJDIR)/FourByteAbgr.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../s $(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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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)/java_awt_AlphaComposite.h $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIBlitLoops.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/GDIBlitLoops.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h $(CLASSHDRDIR)/sun_java2d_windows_GDIBlitLoops.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.h ../../../src/windows/native/sun/windows/awtmsg.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_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)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dialog.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_PrintDialog.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/awt_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/GDIHashtable.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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_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/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)/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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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/jni_util.h ../../../src/windows/javavm/export/jni_md.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.h ../../../src/windows/native/sun/windows/awt_Toolkit.h ../../../src/windows/native/sun/windows/Hashtable.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/Hashtable.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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/jni_util.h ../../../src/share/native/sun/awt/image/imageInitIDs.h ../../../src/windows/javavm/export/jni_md.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/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/javavm/export/jvm_md.h +$(OBJDIR)/img_colors.obj:: ../../../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 @@ -256,7 +258,7 @@ $(OBJDIR)/Index12Gray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../sr $(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/jni_util.h ../../../src/windows/javavm/export/jni_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)/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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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 @@ -274,171 +276,57 @@ $(OBJDIR)/MaskBlit.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h $(CLASSHDRDIR) $(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)/mlib_c_ImageAffineIndex_BC.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageColormap.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h +$(OBJDIR)/MouseInfo.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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)/mlib_c_ImageAffineIndex_BL.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageColormap.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.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)/mlib_c_ImageAffine_BC.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_BC_S16.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_BC_U16.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_BL.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h +$(OBJDIR)/OGLFuncs.obj:: ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_BL_S16.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_BL_U16.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageAffine_NN.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageConvClearEdge.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageConvCopyEdge.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageConvVersion.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageConv_f.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageCopy.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/mlib_c_ImageLookUp.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.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)/mlib_c_ImageLookUp_f.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_c_ImageThresh1_U8.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageThresh1.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageColormap.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffineEdge.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageColormap.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BC_D64.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BC_F32.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BC_S32.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BL_D64.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BL_F32.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_BL_S32.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_NN.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageAffine_NN_Bit.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageClipping.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageClipping.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCreate.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageColorTrue2Index.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageColormap.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv2x2_f.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvClearEdge_Bit.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvClearEdge_Fp.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvCopyEdge_Bit.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvKernelConvert.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_SysMath.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvMxN.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageClipping.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConvEdge.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCreate.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvMxN_ext.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConvMxN_Fp.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCheck.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_SysMath.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_16ext.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_16nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_32nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_8ext.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_8nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_D64nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_F32nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_u16ext.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageConv_u16nw.obj:: ../../../src/share/native/sun/awt/medialib/mlib_c_ImageConv.h ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageCopy_Bit.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageCreate.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCreate.h ../../../src/share/native/sun/awt/medialib/mlib_ImageRowTable.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageDivTables.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageFilters.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageLookUp_64.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageLookUp_Bit.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageCopy.h ../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageScanPoly.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_ImageAffine.h ../../../src/share/native/sun/awt/medialib/mlib_ImageDivTables.h ../../../src/share/native/sun/awt/medialib/mlib_ImageFilters.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_SysMath.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_ImageUtils.obj:: ../../../src/share/native/sun/awt/medialib/mlib_image.h ../../../src/share/native/sun/awt/medialib/mlib_image_blend_proto.h ../../../src/share/native/sun/awt/medialib/mlib_image_get.h ../../../src/share/native/sun/awt/medialib/mlib_image_proto.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_sys.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/mlib_sys.obj:: ../../../src/share/native/sun/awt/medialib/mlib_SysMath.h ../../../src/share/native/sun/awt/medialib/mlib_sys_proto.h ../../../src/share/native/sun/awt/medialib/mlib_types.h - -$(OBJDIR)/MouseInfo.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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_SunGraphics2D.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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/jni.h ../../../src/share/javavm/export/jvm.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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/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_SunGraphics2D.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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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_SunGraphics2D.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/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/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/sun/java2d/j2d_md.h - -$(OBJDIR)/Region.obj:: ../../../src/share/javavm/export/jni.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 - -$(OBJDIR)/RegistryKey.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.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/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/sun/java2d/j2d_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/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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/ShellFolder2.obj:: ../../../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.h ../../../src/windows/native/sun/windows/awt_Debug.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/jni_util.h ../../../src/windows/javavm/export/jni_md.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/ThemeReader.obj:: $(CLASSHDRDIR)/java_awt_AWTEvent.h $(CLASSHDRDIR)/java_awt_Component.h $(CLASSHDRDIR)/java_awt_Dimension.h $(CLASSHDRDIR)/java_awt_Event.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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/jni.h ../../../src/share/javavm/export/jvm.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 +$(OBJDIR)/Trace.obj:: ../../../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/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/sun/java2d/j2d_md.h - -$(OBJDIR)/UnicowsLoader.obj:: ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_md.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/stdhdrs.h ../../../src/windows/native/sun/windows/UnicowsLoader.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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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 @@ -452,18 +340,10 @@ $(OBJDIR)/UshortGray.obj:: $(CLASSHDRDIR)/java_awt_AlphaComposite.h ../../../src $(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/IntArgb.h ../../../src/share/native/sun/java2d/loops/IntArgbBm.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)/WBufferStrategy.obj:: $(CLASSHDRDIR)/sun_awt_windows_WBufferStrategy.h ../../../src/share/javavm/export/jni.h ../../../src/share/native/common/jni_util.h ../../../src/windows/javavm/export/jni_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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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)/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 ../../../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/gl.h ../../../src/share/native/sun/java2d/opengl/J2D_GL/glext.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/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.h ../../../src/windows/native/sun/windows/awt_Debug.h ../../../src/windows/native/sun/windows/stdhdrs.h -$(OBJDIR)/Win32OffScreenSurfaceData.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Transparency.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_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_windows_Win32OffScreenSurfaceData.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.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/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/sun/java2d/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/Win32SurfaceData.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Transparency.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_d3d_D3DContext.h $(CLASSHDRDIR)/sun_java2d_windows_Win32SurfaceData.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/font/AccelGlyphCache.h ../../../src/share/native/sun/font/fontscalerdefs.h ../../../src/share/native/sun/font/glyphblitting.h ../../../src/share/native/sun/font/sunfontids.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/d3d/D3DContext.h ../../../src/windows/native/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/WinBackBufferSurfaceData.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_WinBackBufferSurfaceData.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.h ../../../src/share/native/common/gdefs.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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/ddrawUtils.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/WindowsFlags.obj:: $(CLASSHDRDIR)/sun_awt_windows_WToolkit.h ../../../src/share/javavm/export/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/dxInit.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/java2d/windows/WindowsFlags.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h - -$(OBJDIR)/WPrinterJob.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/jni.h ../../../src/share/javavm/export/jvm.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/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.h ../../../src/windows/native/sun/windows/alloc.h ../../../src/windows/native/sun/windows/awt.h ../../../src/windows/native/sun/windows/awtmsg.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_dlls.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.h ../../../src/windows/native/sun/windows/awt_MMStub.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/WPrinterJob.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.h $(CLASSHDRDIR)/java_awt_event_FocusEvent.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_Menu.h $(CLASSHDRDIR)/java_awt_MenuBar.h $(CLASSHDRDIR)/java_awt_MenuComponent.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/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.h ../../../src/windows/native/sun/windows/awtmsg.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_Menu.h ../../../src/windows/native/sun/windows/awt_MenuBar.h ../../../src/windows/native/sun/windows/awt_MenuItem.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/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 diff --git a/jdk/make/sun/awt/mapfile-mawt-vers b/jdk/make/sun/awt/mapfile-mawt-vers index 8e4d99c562c..ca3b430c57b 100644 --- a/jdk/make/sun/awt/mapfile-mawt-vers +++ b/jdk/make/sun/awt/mapfile-mawt-vers @@ -1,5 +1,5 @@ # -# Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-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 @@ -417,12 +417,14 @@ SUNWprivate_1.1 { Java_sun_java2d_x11_X11SurfaceData_XSetForeground; Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures; + Java_sun_java2d_opengl_OGLContext_getOGLIdString; Java_sun_java2d_opengl_OGLMaskFill_maskFill; Java_sun_java2d_opengl_OGLRenderer_drawPoly; Java_sun_java2d_opengl_OGLRenderQueue_flushBuffer; Java_sun_java2d_opengl_OGLSurfaceData_initTexture; Java_sun_java2d_opengl_OGLSurfaceData_initFBObject; Java_sun_java2d_opengl_OGLSurfaceData_initFlipBackbuffer; + Java_sun_java2d_opengl_OGLSurfaceData_getTextureID; Java_sun_java2d_opengl_OGLSurfaceData_getTextureTarget; Java_sun_java2d_opengl_OGLTextRenderer_drawGlyphList; Java_sun_java2d_opengl_GLXGraphicsConfig_getGLXConfigInfo; @@ -511,6 +513,7 @@ SUNWprivate_1.1 { AWTCharAscent; AWTCharDescent; AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; local: *; diff --git a/jdk/make/sun/awt/mapfile-vers b/jdk/make/sun/awt/mapfile-vers index db3f5252df8..9ab965e07fa 100644 --- a/jdk/make/sun/awt/mapfile-vers +++ b/jdk/make/sun/awt/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -137,7 +137,6 @@ SUNWprivate_1.1 { RegionToYXBandedRectangles; GrPrim_CompGetXorInfo; GrPrim_CompGetAlphaInfo; - GrPrim_ColorGetRGB; J2dTraceImpl; J2dTraceInit; img_makePalette; diff --git a/jdk/make/sun/awt/mapfile-vers-linux b/jdk/make/sun/awt/mapfile-vers-linux index 4905e40f674..83afeebc7f2 100644 --- a/jdk/make/sun/awt/mapfile-vers-linux +++ b/jdk/make/sun/awt/mapfile-vers-linux @@ -1,5 +1,5 @@ # -# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-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 @@ -568,6 +568,7 @@ SUNWprivate_1.1 { AWTCharAscent; AWTCharDescent; AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; local: *; diff --git a/jdk/make/sun/cmm/Makefile b/jdk/make/sun/cmm/Makefile index 6aae4d1e326..bbed857654c 100644 --- a/jdk/make/sun/cmm/Makefile +++ b/jdk/make/sun/cmm/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2006-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 diff --git a/jdk/make/sun/cmm/kcms/Makefile b/jdk/make/sun/cmm/kcms/Makefile index b430a140716..000f2527e5b 100644 --- a/jdk/make/sun/cmm/kcms/Makefile +++ b/jdk/make/sun/cmm/kcms/Makefile @@ -47,8 +47,6 @@ FILES_export = \ ifeq ($(PLATFORM), windows) # Override the default version info with our own resource file (see 5043594) VERSIONINFO_RESOURCE = $(CLOSED_SRC)/share/native/sun/java2d/cmm/kcms/cmm.rc - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false endif # Rules diff --git a/jdk/make/sun/font/FILES_c.gmk b/jdk/make/sun/font/FILES_c.gmk index 37e00af67fc..2940ac78a08 100644 --- a/jdk/make/sun/font/FILES_c.gmk +++ b/jdk/make/sun/font/FILES_c.gmk @@ -1,5 +1,5 @@ # -# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2003-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 @@ -116,7 +116,7 @@ ifeq ($(PLATFORM),windows) FILES_c_platform = fontpath.c \ lcdglyph.c -FILES_cpp_platform = D3DTextRenderer.cpp +FILES_cpp_platform = else FILES_c_platform = X11FontScaler.c \ X11TextRenderer.c diff --git a/jdk/make/sun/font/Makefile b/jdk/make/sun/font/Makefile index e1d89a7633f..ae06bbe8225 100644 --- a/jdk/make/sun/font/Makefile +++ b/jdk/make/sun/font/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 @@ -77,16 +77,11 @@ FILES_export = \ ifeq ($(PLATFORM), windows) - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false - LDLIBS += user32.lib gdi32.lib $(OBJDIR)/../../../sun.awt/awt/$(OBJDIRNAME)/awt.lib OTHER_CFLAGS += -DCC_NOEX OTHER_CXXFLAGS += -DCC_NOEX - FILES_export += sun/java2d/d3d/D3DTextRenderer.java - else # PLATFORM unix FILES_export += \ @@ -171,7 +166,6 @@ endif ifeq ($(PLATFORM), windows) vpath %.cpp $(PLATFORM_SRC)/native/sun/windows -vpath %.cpp $(PLATFORM_SRC)/native/sun/java2d/d3d else # PLATFORM # @@ -206,7 +200,6 @@ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \ -I$(TEMPDIR)/../../sun.awt/awt/CClassHeaders ifeq ($(PLATFORM), windows) -CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows \ - -I$(PLATFORM_SRC)/native/sun/java2d/d3d +CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows endif diff --git a/jdk/make/sun/font/t2k/Makefile b/jdk/make/sun/font/t2k/Makefile index 93d2e59d29b..65f7f99a4dd 100644 --- a/jdk/make/sun/font/t2k/Makefile +++ b/jdk/make/sun/font/t2k/Makefile @@ -64,9 +64,6 @@ FILES_export = \ ifeq ($(PLATFORM), windows) - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false - # t2k imports several shared methods from fontmanager.dll LDLIBS += user32.lib $(OBJDIR)/../../../sun.font/fontmanager/$(OBJDIRNAME)/fontmanager.lib diff --git a/jdk/make/sun/headless/mapfile-vers b/jdk/make/sun/headless/mapfile-vers index f27f007d75d..a94d5a5c9ef 100644 --- a/jdk/make/sun/headless/mapfile-vers +++ b/jdk/make/sun/headless/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2001-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 @@ -60,6 +60,7 @@ SUNWprivate_1.1 { X11SurfaceData_GetOps; Java_java_awt_Font_initIDs; Java_sun_font_FontManager_getFontConfig; + Java_sun_font_FontManager_getFontConfigVersion; Java_sun_font_FontManager_getFontConfigAASettings; Java_sun_font_FontManager_getFontPath; Java_sun_font_FontManager_setNativeFontPath; @@ -98,6 +99,7 @@ SUNWprivate_1.1 { AWTCharAscent; AWTCharDescent; AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; local: diff --git a/jdk/make/sun/jawt/Makefile b/jdk/make/sun/jawt/Makefile index 96723281450..45d337258a4 100644 --- a/jdk/make/sun/jawt/Makefile +++ b/jdk/make/sun/jawt/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1999-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 diff --git a/jdk/make/sun/jawt/make.depend b/jdk/make/sun/jawt/make.depend index 35b399bfa88..2eefe099c35 100644 --- a/jdk/make/sun/jawt/make.depend +++ b/jdk/make/sun/jawt/make.depend @@ -1 +1 @@ -$(OBJDIR)/jawt.obj:: $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_AlphaComposite.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_AWTEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Component.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Dimension.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Event.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Font.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_PlatformFont.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WToolkit.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/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/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/sun/java2d/j2d_md.h ../../../src/windows/native/sun/java2d/windows/ddrawObject.h ../../../src/windows/native/sun/java2d/windows/dxCapabilities.h ../../../src/windows/native/sun/java2d/windows/RegistryKey.h ../../../src/windows/native/sun/java2d/windows/Win32SurfaceData.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/awt_MMStub.h ../../../src/windows/native/sun/windows/awtmsg.h ../../../src/windows/native/sun/windows/awt_Multimon.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_Unicode.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 ../../../src/windows/native/sun/windows/UnicowsLoader.h +$(OBJDIR)/jawt.obj:: $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_AWTEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Component.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Dimension.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Event.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_Font.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_FocusEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_KeyEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_MouseEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/java_awt_event_WindowEvent.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_FontDescriptor.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_PlatformFont.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WComponentPeer.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WFontMetrics.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WObjectPeer.h $(CLASSHDRDIR)/../../awt/CClassHeaders/sun_awt_windows_WToolkit.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/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/alloc.h ../../../src/windows/native/sun/windows/awt.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_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/awtmsg.h ../../../src/windows/native/sun/windows/colordata.h ../../../src/windows/native/sun/windows/stdhdrs.h diff --git a/jdk/make/sun/jdbc/Makefile b/jdk/make/sun/jdbc/Makefile index d520b22cf85..818a89d0e8b 100644 --- a/jdk/make/sun/jdbc/Makefile +++ b/jdk/make/sun/jdbc/Makefile @@ -69,11 +69,6 @@ ifneq ($(PLATFORM), windows) INIT += $(ODBC_FAKE_LIBRARIES) endif -ifeq ($(PLATFORM),windows) - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false -endif - # # Rules # diff --git a/jdk/make/sun/jpeg/Makefile b/jdk/make/sun/jpeg/Makefile index 45bc70855dd..e3513763316 100644 --- a/jdk/make/sun/jpeg/Makefile +++ b/jdk/make/sun/jpeg/Makefile @@ -73,10 +73,5 @@ include $(BUILDDIR)/common/Library.gmk # vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -ifeq ($(PLATFORM), windows) - # Files built here do not compile with warning level 3 if warnings are fatal - COMPILER_WARNINGS_FATAL=false -endif # PLATFORM - CLASSES.export += java.io.InputStream diff --git a/jdk/make/sun/splashscreen/Makefile b/jdk/make/sun/splashscreen/Makefile index 8a0dffe62c9..0df06e4482e 100644 --- a/jdk/make/sun/splashscreen/Makefile +++ b/jdk/make/sun/splashscreen/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 @@ -67,7 +67,7 @@ ifneq ($(PLATFORM), windows) OTHER_LDLIBS += -L$(OPENWIN_LIB) -lX11 -lXext $(LIBM) -lpthread else # PLATFORM CFLAGS += -DWITH_WIN32 - OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib + OTHER_LDLIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib /DELAYLOAD:user32.dll #$(JVMLIB) $(OBJDIR)/../../jpeg/$(OBJDIRNAME)/jpeg$(SUFFIX).lib endif # PLATFORM @@ -85,13 +85,6 @@ vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 -ifeq ($(PLATFORM), linux) - ifeq ($(ARCH_DATA_MODEL), 64) - # 64-bit gcc has problems compiling MMX instructions. - # Google it for more details. Possibly the newer versions of - # the PNG-library and/or the new compiler will not need this - # option in the future. - CPPFLAGS += -DPNG_NO_MMX_CODE - endif -endif - +# Shun the less than portable MMX assembly code in pnggccrd.c, +# and use alternative implementations in C. +CPPFLAGS += -DPNG_NO_MMX_CODE diff --git a/jdk/make/sun/xawt/mapfile-vers b/jdk/make/sun/xawt/mapfile-vers index 7828481bd2d..3f6bcdeb821 100644 --- a/jdk/make/sun/xawt/mapfile-vers +++ b/jdk/make/sun/xawt/mapfile-vers @@ -1,5 +1,5 @@ # -# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2002-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 @@ -151,6 +151,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl; Java_sun_awt_X11_XRobotPeer_mouseWheelImpl; Java_sun_awt_X11_XRobotPeer_setup; + Java_sun_awt_X11_XRobotPeer_getNumberOfButtonsImpl; Java_java_awt_Component_initIDs; Java_java_awt_Container_initIDs; Java_java_awt_Button_initIDs; @@ -177,6 +178,7 @@ SUNWprivate_1.1 { Java_java_awt_TextField_initIDs; Java_java_awt_TrayIcon_initIDs; Java_sun_font_FontManager_getFontConfig; + Java_sun_font_FontManager_getFontConfigVersion; Java_sun_font_FontManager_getFontConfigAASettings; Java_sun_font_FontManager_getFontPath; Java_sun_font_FontManager_setNativeFontPath; @@ -241,6 +243,7 @@ SUNWprivate_1.1 { AWTCharAscent; AWTCharDescent; AWTDrawGlyphList; + AccelGlyphCache_RemoveAllCellInfos; Java_sun_awt_X11_XToolkit_waitForEvents; Java_java_awt_Event_initIDs; @@ -286,6 +289,7 @@ SUNWprivate_1.1 { Java_sun_awt_X11_XlibWrapper_XGetIconSizes; Java_sun_awt_X11_XlibWrapper_XKeycodeToKeysym; Java_sun_awt_X11_XlibWrapper_XKeysymToKeycode; + Java_sun_awt_X11_XlibWrapper_XQueryKeymap; Java_sun_awt_X11_XlibWrapper_XGetModifierMapping; Java_sun_awt_X11_XlibWrapper_XFreeModifiermap; Java_sun_awt_X11_XlibWrapper_XChangeActivePointerGrab; diff --git a/jdk/make/tools/Makefile b/jdk/make/tools/Makefile index be1c59a7cfa..68dfe8ef333 100644 --- a/jdk/make/tools/Makefile +++ b/jdk/make/tools/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1998-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 @@ -51,7 +51,7 @@ SUBDIRS = \ jdwpgen \ makeclasslist \ strip_properties \ - winver \ + spp \ CharsetMapping all build clean clobber:: diff --git a/jdk/make/tools/freetypecheck/Makefile b/jdk/make/tools/freetypecheck/Makefile index c96854309f2..94c983565ac 100644 --- a/jdk/make/tools/freetypecheck/Makefile +++ b/jdk/make/tools/freetypecheck/Makefile @@ -1,5 +1,5 @@ # -# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# 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 diff --git a/jdk/make/tools/freetypecheck/freetypecheck.c b/jdk/make/tools/freetypecheck/freetypecheck.c index 12b26f7e88b..3f900a840a9 100644 --- a/jdk/make/tools/freetypecheck/freetypecheck.c +++ b/jdk/make/tools/freetypecheck/freetypecheck.c @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/make/tools/winver/Makefile b/jdk/make/tools/spp/Makefile similarity index 80% rename from jdk/make/tools/winver/Makefile rename to jdk/make/tools/spp/Makefile index 9b8638a9437..5f720120b0d 100644 --- a/jdk/make/tools/winver/Makefile +++ b/jdk/make/tools/spp/Makefile @@ -1,5 +1,5 @@ # -# Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 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 @@ -24,25 +24,22 @@ # # -# Makefile for building the winver tool +# Makefile for build spp tool # BUILDDIR = ../.. +PACKAGE = build.tools.spp PRODUCT = tools -PROGRAM = winver +PROGRAM = spp include $(BUILDDIR)/common/Defs.gmk -build: permissions -permissions: -ifeq ($(PLATFORM),windows) - $(CHMOD) a+x bin/winver.exe -endif +BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src +BUILDTOOL_MAIN = $(PKGDIR)/Spp.java # -# Rules. +# Build tool jar rules. # -include $(BUILDDIR)/common/Rules.gmk +include $(BUILDDIR)/common/BuildToolJar.gmk -.PHONY: permissions diff --git a/jdk/make/tools/src/build/tools/jdwpgen/CommandNode.java b/jdk/make/tools/src/build/tools/jdwpgen/CommandNode.java index ec8666453ae..2e153061e16 100644 --- a/jdk/make/tools/src/build/tools/jdwpgen/CommandNode.java +++ b/jdk/make/tools/src/build/tools/jdwpgen/CommandNode.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/make/tools/src/build/tools/jdwpgen/ConstantSetNode.java b/jdk/make/tools/src/build/tools/jdwpgen/ConstantSetNode.java index 325ebc9ef46..56ca041c4ff 100644 --- a/jdk/make/tools/src/build/tools/jdwpgen/ConstantSetNode.java +++ b/jdk/make/tools/src/build/tools/jdwpgen/ConstantSetNode.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/make/tools/src/build/tools/jdwpgen/RepeatNode.java b/jdk/make/tools/src/build/tools/jdwpgen/RepeatNode.java index 4c8f20982f2..107072a52d3 100644 --- a/jdk/make/tools/src/build/tools/jdwpgen/RepeatNode.java +++ b/jdk/make/tools/src/build/tools/jdwpgen/RepeatNode.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/make/tools/src/build/tools/spp/Spp.java b/jdk/make/tools/src/build/tools/spp/Spp.java new file mode 100644 index 00000000000..8a220f59234 --- /dev/null +++ b/jdk/make/tools/src/build/tools/spp/Spp.java @@ -0,0 +1,189 @@ +/* + * Copyright 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 build.tools.spp; + +import java.util.*; +import java.util.regex.*; + +/* + * Spp: A simple regex-based stream preprocessor based on Mark Reinhold's + * sed-based spp.sh + * + * Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out + * + * Source-file constructs + * + * Meaningful only at beginning of line, works with any number of keys: + * + * #if[key] Includes text between #if/#end if -Kkey specified, + * #else[key] otherwise changes text to blank lines; key test + * #end[key] may be negated by prefixing !, e.g., #if[!key] + * + * #begin If -be is specified then lines up to and including + * #end #begin, and from #end to EOF, are deleted + * + * #warn Changed into warning that file is generated + * + * // ## Changed into blank line + * + * Meaningful anywhere in line + * + * {#if[key]?yes} Expands to yes if -Kkey specified + * {#if[key]?yes:no} Expands to yes if -Kkey, otherwise no + * {#if[!key]?yes} Expands to yes if -Kother + * {#if[!key]?yes:no} Expands to yes if -Kother, otherwise no + * $var$ Expands to value if -Dvar=value given + * + * yes, no must not contain whitespace + * + * @author Xueming Shen + */ + +public class Spp { + public static void main(String args[]) throws Exception { + Map vars = new HashMap(); + Set keys = new HashSet(); + boolean be = false; + + for (String arg:args) { + if (arg.startsWith("-D")) { + int i = arg.indexOf('='); + vars.put(arg.substring(2, i),arg.substring(i+1)); + } else if (arg.startsWith("-K")) { + keys.add(arg.substring(2)); + } else if ("-be".equals(arg)) { + be = true; + } else { + System.err.println("Usage: java build.tools.spp.Spp [-be] [-Kkey] -Dvar=value ... out"); + System.exit(-1); + } + } + + StringBuffer out = new StringBuffer(); + new Spp().spp(new Scanner(System.in), + out, "", + keys, vars, be, + false); + System.out.print(out.toString()); + } + + static final String LNSEP = System.getProperty("line.separator"); + static final String KEY = "([a-zA-Z0-9]+)"; + static final String VAR = "([a-zA-Z0-9_\\-]+)"; + static final String TEXT = "([a-zA-Z0-9&;,.<>/#() \\$]+)"; // $ -- hack embedded $var$ + + static final int GN_NOT = 1; + static final int GN_KEY = 2; + static final int GN_YES = 3; + static final int GN_NO = 5; + static final int GN_VAR = 6; + + Matcher ifkey = Pattern.compile("^#if\\[(!)?" + KEY + "\\]").matcher(""); + Matcher elsekey = Pattern.compile("^#else\\[(!)?" + KEY + "\\]").matcher(""); + Matcher endkey = Pattern.compile("^#end\\[(!)?" + KEY + "\\]").matcher(""); + Matcher vardef = Pattern.compile("\\{#if\\[(!)?" + KEY + "\\]\\?" + TEXT + "(:"+ TEXT + ")?\\}|\\$" + VAR + "\\$").matcher(""); + Matcher vardef2 = Pattern.compile("\\$" + VAR + "\\$").matcher(""); + + void append(StringBuffer buf, String ln, + Set keys, Map vars) { + vardef.reset(ln); + while (vardef.find()) { + String repl = ""; + if (vardef.group(GN_VAR) != null) + repl = vars.get(vardef.group(GN_VAR)); + else { + boolean test = keys.contains(vardef.group(GN_KEY)); + if (vardef.group(GN_NOT) != null) + test = !test; + repl = test?vardef.group(GN_YES):vardef.group(GN_NO); + if (repl == null) + repl = ""; + else { // embedded $var$ + while (vardef2.reset(repl).find()) { + repl = vardef2.replaceFirst(vars.get(vardef2.group(1))); + } + } + } + vardef.appendReplacement(buf, repl); + } + vardef.appendTail(buf); + } + + // return true if #end[key], #end or EOF reached + boolean spp(Scanner in, StringBuffer buf, String key, + Set keys, Map vars, + boolean be, boolean skip) { + while (in.hasNextLine()) { + String ln = in.nextLine(); + if (be) { + if (ln.startsWith("#begin")) { + buf.setLength(0); //clean up to this line + continue; + } + if (ln.equals("#end")) { + while (in.hasNextLine()) + in.nextLine(); + return true; //discard the rest to EOF + } + } + if (ifkey.reset(ln).find()) { + String k = ifkey.group(GN_KEY); + boolean test = keys.contains(k); + if (ifkey.group(GN_NOT) != null) + test = !test; + buf.append(LNSEP); + if (!spp(in, buf, k, keys, vars, be, skip || !test)) { + spp(in, buf, k, keys, vars, be, skip || test); + } + continue; + } + if (elsekey.reset(ln).find()) { + if (!key.equals(elsekey.group(GN_KEY))) { + throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); + } + buf.append(LNSEP); + return false; + } + if (endkey.reset(ln).find()) { + if (!key.equals(endkey.group(GN_KEY))) { + throw new Error("Mis-matched #if-else-end at line <" + ln + ">"); + } + buf.append(LNSEP); + return true; + } + if (ln.startsWith("#warn")) { + ln = "// -- This file was mechanically generated: Do not edit! -- //"; + } else if (ln.trim().startsWith("// ##")) { + ln = ""; + } + if (!skip) { + append(buf, ln, keys, vars); + } + buf.append(LNSEP); + } + return true; + } +} diff --git a/jdk/make/tools/winver/bin/winver.exe b/jdk/make/tools/winver/bin/winver.exe deleted file mode 100755 index cba45bef1a4..00000000000 Binary files a/jdk/make/tools/winver/bin/winver.exe and /dev/null differ diff --git a/jdk/make/tools/winver/src/StdAfx.h b/jdk/make/tools/winver/src/StdAfx.h deleted file mode 100644 index 3e9407954bc..00000000000 --- a/jdk/make/tools/winver/src/StdAfx.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. - * 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. - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__C592D6C3_027D_11D5_8DFB_080020C19238__INCLUDED_) -#define AFX_STDAFX_H__C592D6C3_027D_11D5_8DFB_080020C19238__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__C592D6C3_027D_11D5_8DFB_080020C19238__INCLUDED_) diff --git a/jdk/src/share/back/ThreadReferenceImpl.c b/jdk/src/share/back/ThreadReferenceImpl.c index fc7d7434e99..a85422863ba 100644 --- a/jdk/src/share/back/ThreadReferenceImpl.c +++ b/jdk/src/share/back/ThreadReferenceImpl.c @@ -540,7 +540,6 @@ ownedMonitorsWithStackDepth(PacketInputStream *in, PacketOutputStream *out) jvmtiError error = JVMTI_ERROR_NONE; jint count = 0; - jint depth; jvmtiMonitorStackDepthInfo *monitors=NULL; error = JVMTI_FUNC_PTR(gdata->jvmti,GetOwnedMonitorStackDepthInfo) diff --git a/jdk/src/share/back/eventFilter.c b/jdk/src/share/back/eventFilter.c index edddeba808c..955cf8813b4 100644 --- a/jdk/src/share/back/eventFilter.c +++ b/jdk/src/share/back/eventFilter.c @@ -492,14 +492,17 @@ eventFilterRestricted_passesFilter(JNIEnv *env, char *sourceName = 0; jvmtiError error = JVMTI_FUNC_PTR(gdata->jvmti,GetSourceFileName) (gdata->jvmti, clazz, &sourceName); - if (error == JVMTI_ERROR_NONE) { - if (sourceName == 0 || !patternStringMatch(sourceName, desiredNamePattern)) { - /* We have no match */ - jvmtiDeallocate(sourceName); - return JNI_FALSE; - } + if (error == JVMTI_ERROR_NONE && + sourceName != 0 && + patternStringMatch(sourceName, desiredNamePattern)) { + // got a hit - report the event + jvmtiDeallocate(sourceName); + break; } + // We have no match, we have no source file name, + // or we got a JVM TI error. Don't report the event. jvmtiDeallocate(sourceName); + return JNI_FALSE; } break; } diff --git a/jdk/src/share/back/transport.c b/jdk/src/share/back/transport.c index 88e298486d2..f259a93eef3 100644 --- a/jdk/src/share/back/transport.c +++ b/jdk/src/share/back/transport.c @@ -473,7 +473,7 @@ transport_startTransport(jboolean isServer, char *name, char *address, /* * Record listener address in a system property */ - len = strlen(name) + strlen(retAddress) + 2; /* ':' and '\0' */ + len = (int)strlen(name) + (int)strlen(retAddress) + 2; /* ':' and '\0' */ prop_value = (char*)jvmtiAllocate(len); strcpy(prop_value, name); strcat(prop_value, ":"); diff --git a/jdk/src/share/bin/java.h b/jdk/src/share/bin/java.h index 291b6755690..e6a08f3cf00 100644 --- a/jdk/src/share/bin/java.h +++ b/jdk/src/share/bin/java.h @@ -1,5 +1,5 @@ /* - * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/bin/main.c b/jdk/src/share/bin/main.c index 88d9190a555..df90e1101eb 100644 --- a/jdk/src/share/bin/main.c +++ b/jdk/src/share/bin/main.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1995-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 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 ee5ed5a9229..2613a025e40 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java index ae2bcb56a20..4f957b7e78c 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java index 58d819f11ea..7a8a21048ae 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java index ba1c8da7958..9ae2d940443 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java index a640862c50c..8b786da73fb 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java index 7fd7bde45a6..6934aa213d1 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java index 4f6e42c784c..4630bb13cc9 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java index e6117989134..14d974b0314 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java index 31425407792..c17f76de943 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java index 737a36d2eb5..2e6c89c935b 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java index e91dbb9e718..4ad3a409796 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -1222,9 +1222,7 @@ public class MotifLookAndFeel extends BasicLookAndFeel "FileChooser.enterFileNameLabelMnemonic", new Integer (KeyEvent.VK_N), // 'n' "FileChooser.ancestorInputMap", new UIDefaults.LazyInputMap(new Object[] { - "ESCAPE", "cancelSelection", - "ENTER", "approveSelection", - "ctrl ENTER", "approveSelection" + "ESCAPE", "cancelSelection" }), diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 9af41fc39c8..bb7842a0018 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -825,9 +825,7 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "ESCAPE", "cancelSelection", "F2", "editFileName", "F5", "refresh", - "BACK_SPACE", "Go Up", - "ENTER", "approveSelection", - "ctrl ENTER", "approveSelection" + "BACK_SPACE", "Go Up" }), "FileView.directoryIcon", SwingUtilities2.makeIcon(getClass(), diff --git a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java index b968ba9aa1e..99b10ad1e8c 100644 --- a/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java +++ b/jdk/src/share/classes/com/sun/jmx/interceptor/DefaultMBeanServerInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -84,8 +84,13 @@ import com.sun.jmx.mbeanserver.MBeanInstantiator; import com.sun.jmx.mbeanserver.Repository; import com.sun.jmx.mbeanserver.NamedObject; import com.sun.jmx.mbeanserver.Introspector; +import com.sun.jmx.mbeanserver.MBeanInjector; +import com.sun.jmx.mbeanserver.NotifySupport; +import com.sun.jmx.mbeanserver.Repository.RegistrationContext; import com.sun.jmx.mbeanserver.Util; import com.sun.jmx.remote.util.EnvHelp; +import javax.management.DynamicWrapperMBean; +import javax.management.NotificationBroadcasterSupport; /** * This is the default class for MBean manipulation on the agent side. It @@ -433,36 +438,26 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { if (instance instanceof MBeanRegistration) preDeregisterInvoke((MBeanRegistration) instance); - repository.remove(name); - // may throw InstanceNotFoundException + final Object resource = getResource(instance); - /** - * Checks if the unregistered MBean is a ClassLoader - * If so, it removes the MBean from the default loader repository. - */ + // Unregisters the MBean from the repository. + // Returns the resource context that was used. + // The returned context does nothing for regular MBeans. + // For ClassLoader MBeans and JMXNamespace (and JMXDomain) + // MBeans - the context makes it possible to unregister these + // objects from the appropriate framework artifacts, such as + // the CLR or the dispatcher, from within the repository lock. + // In case of success, we also need to call context.done() at the + // end of this method. + // + final ResourceContext context = + unregisterFromRepository(resource, instance, name); - Object resource = getResource(instance); - if (resource instanceof ClassLoader - && resource != server.getClass().getClassLoader()) { - final ModifiableClassLoaderRepository clr = - instantiator.getClassLoaderRepository(); - if (clr != null) clr.removeClassLoader(name); - } - - // --------------------- - // Send deletion event - // --------------------- - if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { - MBEANSERVER_LOGGER.logp(Level.FINER, - DefaultMBeanServerInterceptor.class.getName(), - "unregisterMBean", "Send delete notification of object " + - name.getCanonicalName()); - } - sendNotification(MBeanServerNotification.UNREGISTRATION_NOTIFICATION, - name); if (instance instanceof MBeanRegistration) postDeregisterInvoke((MBeanRegistration) instance); + + context.done(); } public ObjectInstance getObjectInstance(ObjectName name) @@ -939,15 +934,22 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { } ObjectName logicalName = name; + logicalName = preRegister(mbean, server, name); + + // preRegister returned successfully, so from this point on we + // must call postRegister(false) if there is any problem. + boolean registered = false; + boolean registerFailed = false; + ResourceContext context = null; + + try { + mbean = injectResources(mbean, server, logicalName); - if (mbean instanceof MBeanRegistration) { - MBeanRegistration reg = (MBeanRegistration) mbean; - logicalName = preRegisterInvoke(reg, name, server); if (mbean instanceof DynamicMBean2) { try { ((DynamicMBean2) mbean).preRegister2(server, logicalName); + registerFailed = true; // until we succeed } catch (Exception e) { - postRegisterInvoke(reg, false, false); if (e instanceof RuntimeException) throw (RuntimeException) e; if (e instanceof InstanceAlreadyExistsException) @@ -960,86 +962,102 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { logicalName = ObjectName.getInstance(nonDefaultDomain(logicalName)); } - } - checkMBeanPermission(classname, null, logicalName, "registerMBean"); + checkMBeanPermission(classname, null, logicalName, "registerMBean"); - final ObjectInstance result; - if (logicalName!=null) { - result = new ObjectInstance(logicalName, classname); - internal_addObject(mbean, logicalName); - } else { - if (mbean instanceof MBeanRegistration) - postRegisterInvoke((MBeanRegistration) mbean, false, true); - final RuntimeException wrapped = - new IllegalArgumentException("No object name specified"); - throw new RuntimeOperationsException(wrapped, - "Exception occurred trying to register the MBean"); - } - - if (mbean instanceof MBeanRegistration) - postRegisterInvoke((MBeanRegistration) mbean, true, false); - - /** - * Checks if the newly registered MBean is a ClassLoader - * If so, tell the ClassLoaderRepository (CLR) about it. We do - * this even if the object is a PrivateClassLoader. In that - * case, the CLR remembers the loader for use when it is - * explicitly named (e.g. as the loader in createMBean) but - * does not add it to the list that is consulted by - * ClassLoaderRepository.loadClass. - */ - final Object resource = getResource(mbean); - if (resource instanceof ClassLoader) { - final ModifiableClassLoaderRepository clr = - instantiator.getClassLoaderRepository(); - if (clr == null) { + if (logicalName == null) { final RuntimeException wrapped = - new IllegalArgumentException( - "Dynamic addition of class loaders is not supported"); + new IllegalArgumentException("No object name specified"); throw new RuntimeOperationsException(wrapped, - "Exception occurred trying to register the MBean as a class loader"); + "Exception occurred trying to register the MBean"); } - clr.addClassLoader(logicalName, (ClassLoader) resource); + + final Object resource = getResource(mbean); + + // Register the MBean with the repository. + // Returns the resource context that was used. + // The returned context does nothing for regular MBeans. + // For ClassLoader MBeans and JMXNamespace (and JMXDomain) + // MBeans - the context makes it possible to register these + // objects with the appropriate framework artifacts, such as + // the CLR or the dispatcher, from within the repository lock. + // In case of success, we also need to call context.done() at the + // end of this method. + // + context = registerWithRepository(resource, mbean, logicalName); + + registerFailed = false; + registered = true; + } finally { + postRegister(mbean, registered, registerFailed); } - return result; + context.done(); + return new ObjectInstance(logicalName, classname); } - private static ObjectName preRegisterInvoke(MBeanRegistration moi, - ObjectName name, - MBeanServer mbs) - throws InstanceAlreadyExistsException, MBeanRegistrationException { - - final ObjectName newName; - + private static void throwMBeanRegistrationException(Throwable t, String where) + throws MBeanRegistrationException { try { - newName = moi.preRegister(mbs, name); + throw t; } catch (RuntimeException e) { - throw new RuntimeMBeanException(e, - "RuntimeException thrown in preRegister method"); + throw new RuntimeMBeanException( + e, "RuntimeException thrown " + where); } catch (Error er) { - throw new RuntimeErrorException(er, - "Error thrown in preRegister method"); + throw new RuntimeErrorException(er, "Error thrown " + where); } catch (MBeanRegistrationException r) { throw r; } catch (Exception ex) { - throw new MBeanRegistrationException(ex, - "Exception thrown in preRegister method"); + throw new MBeanRegistrationException(ex, "Exception thrown " + where); + } catch (Throwable t1) { + throw new RuntimeException(t); // neither Error nor Exception?? + } + } + + private static ObjectName preRegister( + DynamicMBean mbean, MBeanServer mbs, ObjectName name) + throws InstanceAlreadyExistsException, MBeanRegistrationException { + + ObjectName newName = null; + + try { + if (mbean instanceof MBeanRegistration) + newName = ((MBeanRegistration) mbean).preRegister(mbs, name); + } catch (Throwable t) { + throwMBeanRegistrationException(t, "in preRegister method"); } if (newName != null) return newName; else return name; } - private static void postRegisterInvoke(MBeanRegistration moi, - boolean registrationDone, - boolean registerFailed) { - - if (registerFailed && moi instanceof DynamicMBean2) - ((DynamicMBean2) moi).registerFailed(); + private static DynamicMBean injectResources( + DynamicMBean mbean, MBeanServer mbs, ObjectName name) + throws MBeanRegistrationException { try { - moi.postRegister(registrationDone); + Object resource = getResource(mbean); + MBeanInjector.inject(resource, mbs, name); + if (MBeanInjector.injectsSendNotification(resource)) { + NotificationBroadcasterSupport nbs = + new NotificationBroadcasterSupport(); + MBeanInjector.injectSendNotification(resource, nbs); + mbean = NotifySupport.wrap(mbean, nbs); + } + return mbean; + } catch (Throwable t) { + throwMBeanRegistrationException(t, "injecting @Resources"); + return null; // not reached + } + } + + private static void postRegister( + DynamicMBean mbean, boolean registrationDone, boolean registerFailed) { + + if (registerFailed && mbean instanceof DynamicMBean2) + ((DynamicMBean2) mbean).registerFailed(); + try { + if (mbean instanceof MBeanRegistration) + ((MBeanRegistration) mbean).postRegister(registrationDone); } catch (RuntimeException e) { throw new RuntimeMBeanException(e, "RuntimeException thrown in postRegister method"); @@ -1053,17 +1071,8 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { throws MBeanRegistrationException { try { moi.preDeregister(); - } catch (RuntimeException e) { - throw new RuntimeMBeanException(e, - "RuntimeException thrown in preDeregister method"); - } catch (Error er) { - throw new RuntimeErrorException(er, - "Error thrown in preDeregister method"); - } catch (MBeanRegistrationException t) { - throw t; - } catch (Exception ex) { - throw new MBeanRegistrationException(ex, - "Exception thrown in preDeregister method"); + } catch (Throwable t) { + throwMBeanRegistrationException(t, "in preDeregister method"); } } @@ -1104,12 +1113,19 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { } private static Object getResource(DynamicMBean mbean) { - if (mbean instanceof DynamicMBean2) - return ((DynamicMBean2) mbean).getResource(); + if (mbean instanceof DynamicWrapperMBean) + return ((DynamicWrapperMBean) mbean).getWrappedObject(); else return mbean; } + private static ClassLoader getResourceLoader(DynamicMBean mbean) { + if (mbean instanceof DynamicWrapperMBean) + return ((DynamicWrapperMBean) mbean).getWrappedClassLoader(); + else + return mbean.getClass().getClassLoader(); + } + private ObjectName nonDefaultDomain(ObjectName name) { if (name == null || name.getDomain().length() > 0) return name; @@ -1123,14 +1139,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { if one is supplied where it shouldn't be). */ final String completeName = domain + name; - try { - return new ObjectName(completeName); - } catch (MalformedObjectNameException e) { - final String msg = - "Unexpected default domain problem: " + completeName + ": " + - e; - throw EnvHelp.initCause(new IllegalArgumentException(msg), e); - } + return Util.newObjectName(completeName); } public String getDefaultDomain() { @@ -1211,7 +1220,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { } NotificationListener listenerWrapper = - getListenerWrapper(listener, name, broadcaster, true); + getListenerWrapper(listener, name, instance, true); broadcaster.addNotificationListener(listenerWrapper, filter, handback); } @@ -1335,7 +1344,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { DynamicMBean instance = getMBean(name); checkMBeanPermission(instance, null, name, "removeNotificationListener"); - Object resource = getResource(instance); /* We could simplify the code by assigning broadcaster after assigning listenerWrapper, but that would change the error @@ -1348,7 +1356,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { getNotificationBroadcaster(name, instance, reqClass); NotificationListener listenerWrapper = - getListenerWrapper(listener, name, resource, false); + getListenerWrapper(listener, name, instance, false); if (listenerWrapper == null) throw new ListenerNotFoundException("Unknown listener"); @@ -1366,8 +1374,10 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { private static T getNotificationBroadcaster(ObjectName name, Object instance, Class reqClass) { - if (instance instanceof DynamicMBean2) - instance = ((DynamicMBean2) instance).getResource(); + if (reqClass.isInstance(instance)) + return reqClass.cast(instance); + if (instance instanceof DynamicWrapperMBean) + instance = ((DynamicWrapperMBean) instance).getWrappedObject(); if (reqClass.isInstance(instance)) return reqClass.cast(instance); final RuntimeException exc = @@ -1415,24 +1425,31 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { checkMBeanPermission(instance, null, name, "isInstanceOf"); try { - if (instance instanceof DynamicMBean2) { - Object resource = ((DynamicMBean2) instance).getResource(); - ClassLoader loader = resource.getClass().getClassLoader(); - Class c = Class.forName(className, false, loader); - return c.isInstance(resource); - } + Object resource = getResource(instance); - final String cn = getClassName(instance); - if (cn.equals(className)) + final String resourceClassName = + (resource instanceof DynamicMBean) ? + getClassName((DynamicMBean) resource) : + resource.getClass().getName(); + + if (resourceClassName.equals(className)) return true; - final ClassLoader cl = instance.getClass().getClassLoader(); + final ClassLoader cl = getResourceLoader(instance); final Class classNameClass = Class.forName(className, false, cl); - if (classNameClass.isInstance(instance)) + if (classNameClass.isInstance(resource)) return true; - final Class instanceClass = Class.forName(cn, false, cl); - return classNameClass.isAssignableFrom(instanceClass); + // Ensure that isInstanceOf(NotificationEmitter) is true when + // the MBean is a NotificationEmitter by virtue of a @Resource + // annotation specifying a SendNotification resource. + // This is a hack. + if (instance instanceof NotificationBroadcaster && + classNameClass.isAssignableFrom(NotificationEmitter.class)) + return true; + + final Class resourceClass = Class.forName(resourceClassName, false, cl); + return classNameClass.isAssignableFrom(resourceClass); } catch (Exception x) { /* Could be SecurityException or ClassNotFoundException */ if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) { @@ -1457,7 +1474,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { DynamicMBean instance = getMBean(mbeanName); checkMBeanPermission(instance, null, mbeanName, "getClassLoaderFor"); - return getResource(instance).getClass().getClassLoader(); + return getResourceLoader(instance); } /** @@ -1488,40 +1505,6 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { return (ClassLoader) resource; } - /** - * Adds a MBean in the repository - */ - private void internal_addObject(DynamicMBean object, ObjectName logicalName) - throws InstanceAlreadyExistsException { - - // ------------------------------ - // ------------------------------ - - // Let the repository do the work. - - try { - repository.addMBean(object, logicalName); - } catch (InstanceAlreadyExistsException e) { - if (object instanceof MBeanRegistration) { - postRegisterInvoke((MBeanRegistration) object, false, true); - } - throw e; - } - - // --------------------- - // Send create event - // --------------------- - if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { - MBEANSERVER_LOGGER.logp(Level.FINER, - DefaultMBeanServerInterceptor.class.getName(), - "addObject", "Send create notification of object " + - logicalName.getCanonicalName()); - } - - sendNotification(MBeanServerNotification.REGISTRATION_NOTIFICATION, - logicalName ) ; - } - /** * Sends an MBeanServerNotifications with the specified type for the * MBean with the specified ObjectName @@ -1712,9 +1695,10 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { */ private NotificationListener getListenerWrapper(NotificationListener l, ObjectName name, - Object mbean, + DynamicMBean mbean, boolean create) { - ListenerWrapper wrapper = new ListenerWrapper(l, name, mbean); + Object resource = getResource(mbean); + ListenerWrapper wrapper = new ListenerWrapper(l, name, resource); synchronized (listenerWrappers) { WeakReference ref = listenerWrappers.get(wrapper); if (ref != null) { @@ -1758,6 +1742,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { listener.handleNotification(notification, handback); } + @Override public boolean equals(Object o) { if (!(o instanceof ListenerWrapper)) return false; @@ -1774,6 +1759,7 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { */ } + @Override public int hashCode() { return (System.identityHashCode(listener) ^ System.identityHashCode(mbean)); @@ -1851,4 +1837,213 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { } } + // ------------------------------------------------------------------ + // + // Dealing with registration of special MBeans in the repository. + // + // ------------------------------------------------------------------ + + /** + * A RegistrationContext that makes it possible to perform additional + * post registration actions (or post unregistration actions) outside + * of the repository lock, once postRegister (or postDeregister) has + * been called. + * The method {@code done()} will be called in registerMBean or + * unregisterMBean, at the end. + */ + private static interface ResourceContext extends RegistrationContext { + public void done(); + /** An empty ResourceContext which does nothing **/ + public static final ResourceContext NONE = new ResourceContext() { + public void done() {} + public void registering() {} + public void unregistered() {} + }; + } + + /** + * Adds a MBean in the repository, + * sends MBeanServerNotification.REGISTRATION_NOTIFICATION, + * returns ResourceContext for special resources such as ClassLoaders + * or JMXNamespaces. For regular MBean this method returns + * ResourceContext.NONE. + * @return a ResourceContext for special resources such as ClassLoaders + * or JMXNamespaces. + */ + private ResourceContext registerWithRepository( + final Object resource, + final DynamicMBean object, + final ObjectName logicalName) + throws InstanceAlreadyExistsException, + MBeanRegistrationException { + + // Creates a registration context, if needed. + // + final ResourceContext context = + makeResourceContextFor(resource, logicalName); + + + repository.addMBean(object, logicalName, context); + // May throw InstanceAlreadyExistsException + + // --------------------- + // Send create event + // --------------------- + if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { + MBEANSERVER_LOGGER.logp(Level.FINER, + DefaultMBeanServerInterceptor.class.getName(), + "addObject", "Send create notification of object " + + logicalName.getCanonicalName()); + } + + sendNotification( + MBeanServerNotification.REGISTRATION_NOTIFICATION, + logicalName); + + return context; + } + + /** + * Removes a MBean in the repository, + * sends MBeanServerNotification.UNREGISTRATION_NOTIFICATION, + * returns ResourceContext for special resources such as ClassLoaders + * or JMXNamespaces, or null. For regular MBean this method returns + * ResourceContext.NONE. + * + * @return a ResourceContext for special resources such as ClassLoaders + * or JMXNamespaces. + */ + private ResourceContext unregisterFromRepository( + final Object resource, + final DynamicMBean object, + final ObjectName logicalName) + throws InstanceNotFoundException { + + // Creates a registration context, if needed. + // + final ResourceContext context = + makeResourceContextFor(resource, logicalName); + + + repository.remove(logicalName, context); + + // --------------------- + // Send deletion event + // --------------------- + if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { + MBEANSERVER_LOGGER.logp(Level.FINER, + DefaultMBeanServerInterceptor.class.getName(), + "unregisterMBean", "Send delete notification of object " + + logicalName.getCanonicalName()); + } + + sendNotification(MBeanServerNotification.UNREGISTRATION_NOTIFICATION, + logicalName); + return context; + } + + /** + * Registers a ClassLoader with the CLR. + * This method is called by the ResourceContext from within the + * repository lock. + * @param loader The ClassLoader. + * @param logicalName The ClassLoader MBean ObjectName. + */ + private void addClassLoader(ClassLoader loader, + final ObjectName logicalName) { + /** + * Called when the newly registered MBean is a ClassLoader + * If so, tell the ClassLoaderRepository (CLR) about it. We do + * this even if the loader is a PrivateClassLoader. In that + * case, the CLR remembers the loader for use when it is + * explicitly named (e.g. as the loader in createMBean) but + * does not add it to the list that is consulted by + * ClassLoaderRepository.loadClass. + */ + final ModifiableClassLoaderRepository clr = + instantiator.getClassLoaderRepository(); + if (clr == null) { + final RuntimeException wrapped = + new IllegalArgumentException( + "Dynamic addition of class loaders" + + " is not supported"); + throw new RuntimeOperationsException(wrapped, + "Exception occurred trying to register" + + " the MBean as a class loader"); + } + clr.addClassLoader(logicalName, loader); + } + + /** + * Unregisters a ClassLoader from the CLR. + * This method is called by the ResourceContext from within the + * repository lock. + * @param loader The ClassLoader. + * @param logicalName The ClassLoader MBean ObjectName. + */ + private void removeClassLoader(ClassLoader loader, + final ObjectName logicalName) { + /** + * Removes the MBean from the default loader repository. + */ + if (loader != server.getClass().getClassLoader()) { + final ModifiableClassLoaderRepository clr = + instantiator.getClassLoaderRepository(); + if (clr != null) { + clr.removeClassLoader(logicalName); + } + } + } + + /** + * Creates a ResourceContext for a ClassLoader MBean. + * The resource context makes it possible to add the ClassLoader to + * (ResourceContext.registering) or resp. remove the ClassLoader from + * (ResourceContext.unregistered) the CLR + * when the associated MBean is added to or resp. removed from the + * repository. + * + * @param loader The ClassLoader MBean being registered or + * unregistered. + * @param logicalName The name of the ClassLoader MBean. + * @return a ResourceContext that takes in charge the addition or removal + * of the loader to or from the CLR. + */ + private ResourceContext createClassLoaderContext( + final ClassLoader loader, + final ObjectName logicalName) { + return new ResourceContext() { + + public void registering() { + addClassLoader(loader, logicalName); + } + + public void unregistered() { + removeClassLoader(loader, logicalName); + } + + public void done() { + } + }; + } + + /** + * Creates a ResourceContext for the given resource. + * If the resource does not need a ResourceContext, returns + * ResourceContext.NONE. + * At this time, only JMXNamespaces and ClassLoaders need a + * ResourceContext. + * + * @param resource The resource being registered or unregistered. + * @param logicalName The name of the associated MBean. + * @return + */ + private ResourceContext makeResourceContextFor(Object resource, + ObjectName logicalName) { + if (resource instanceof ClassLoader) { + return createClassLoaderContext((ClassLoader) resource, + logicalName); + } + return ResourceContext.NONE; + } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java index c0032fdce2d..b8377cf4781 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/ConvertingMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -31,13 +31,15 @@ import java.lang.reflect.Type; import javax.management.Descriptor; import javax.management.MBeanException; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingFactory; import javax.management.openmbean.OpenDataException; import javax.management.openmbean.OpenType; final class ConvertingMethod { - static ConvertingMethod from(Method m) { + static ConvertingMethod from(Method m, MXBeanMappingFactory mappingFactory) { try { - return new ConvertingMethod(m); + return new ConvertingMethod(m, mappingFactory); } catch (OpenDataException ode) { final String msg = "Method " + m.getDeclaringClass().getName() + "." + m.getName() + " has parameter or return type that " + @@ -67,13 +69,13 @@ final class ConvertingMethod { } OpenType getOpenReturnType() { - return returnConverter.getOpenType(); + return returnMapping.getOpenType(); } OpenType[] getOpenParameterTypes() { - final OpenType[] types = new OpenType[paramConverters.length]; - for (int i = 0; i < paramConverters.length; i++) - types[i] = paramConverters[i].getOpenType(); + final OpenType[] types = new OpenType[paramMappings.length]; + for (int i = 0; i < paramMappings.length; i++) + types[i] = paramMappings[i].getOpenType(); return types; } @@ -85,9 +87,9 @@ final class ConvertingMethod { * value will be converted to an Open Type, so if it is convertible * at all there is no further check needed. */ - void checkCallFromOpen() throws IllegalArgumentException { + void checkCallFromOpen() { try { - for (OpenConverter paramConverter : paramConverters) + for (MXBeanMapping paramConverter : paramMappings) paramConverter.checkReconstructible(); } catch (InvalidObjectException e) { throw new IllegalArgumentException(e); @@ -102,32 +104,32 @@ final class ConvertingMethod { * open types, so if it is convertible at all there is no further * check needed. */ - void checkCallToOpen() throws IllegalArgumentException { + void checkCallToOpen() { try { - returnConverter.checkReconstructible(); + returnMapping.checkReconstructible(); } catch (InvalidObjectException e) { throw new IllegalArgumentException(e); } } String[] getOpenSignature() { - if (paramConverters.length == 0) + if (paramMappings.length == 0) return noStrings; - String[] sig = new String[paramConverters.length]; - for (int i = 0; i < paramConverters.length; i++) - sig[i] = paramConverters[i].getOpenClass().getName(); + String[] sig = new String[paramMappings.length]; + for (int i = 0; i < paramMappings.length; i++) + sig[i] = paramMappings[i].getOpenClass().getName(); return sig; } final Object toOpenReturnValue(MXBeanLookup lookup, Object ret) throws OpenDataException { - return returnConverter.toOpenValue(lookup, ret); + return returnMapping.toOpenValue(ret); } final Object fromOpenReturnValue(MXBeanLookup lookup, Object ret) throws InvalidObjectException { - return returnConverter.fromOpenValue(lookup, ret); + return returnMapping.fromOpenValue(ret); } final Object[] toOpenParameters(MXBeanLookup lookup, Object[] params) @@ -136,17 +138,17 @@ final class ConvertingMethod { return params; final Object[] oparams = new Object[params.length]; for (int i = 0; i < params.length; i++) - oparams[i] = paramConverters[i].toOpenValue(lookup, params[i]); + oparams[i] = paramMappings[i].toOpenValue(params[i]); return oparams; } - final Object[] fromOpenParameters(MXBeanLookup lookup, Object[] params) + final Object[] fromOpenParameters(Object[] params) throws InvalidObjectException { if (paramConversionIsIdentity || params == null) return params; final Object[] jparams = new Object[params.length]; for (int i = 0; i < params.length; i++) - jparams[i] = paramConverters[i].fromOpenValue(lookup, params[i]); + jparams[i] = paramMappings[i].fromOpenValue(params[i]); return jparams; } @@ -154,23 +156,35 @@ final class ConvertingMethod { Object param, int paramNo) throws OpenDataException { - return paramConverters[paramNo].toOpenValue(lookup, param); + return paramMappings[paramNo].toOpenValue(param); } final Object fromOpenParameter(MXBeanLookup lookup, Object param, int paramNo) throws InvalidObjectException { - return paramConverters[paramNo].fromOpenValue(lookup, param); + return paramMappings[paramNo].fromOpenValue(param); } Object invokeWithOpenReturn(MXBeanLookup lookup, Object obj, Object[] params) throws MBeanException, IllegalAccessException, InvocationTargetException { + MXBeanLookup old = MXBeanLookup.getLookup(); + try { + MXBeanLookup.setLookup(lookup); + return invokeWithOpenReturn(obj, params); + } finally { + MXBeanLookup.setLookup(old); + } + } + + private Object invokeWithOpenReturn(Object obj, Object[] params) + throws MBeanException, IllegalAccessException, + InvocationTargetException { final Object[] javaParams; try { - javaParams = fromOpenParameters(lookup, params); + javaParams = fromOpenParameters(params); } catch (InvalidObjectException e) { // probably can't happen final String msg = methodName() + ": cannot convert parameters " + @@ -179,7 +193,7 @@ final class ConvertingMethod { } final Object javaReturn = method.invoke(obj, javaParams); try { - return returnConverter.toOpenValue(lookup, javaReturn); + return returnMapping.toOpenValue(javaReturn); } catch (OpenDataException e) { // probably can't happen final String msg = methodName() + ": cannot convert return " + @@ -192,15 +206,17 @@ final class ConvertingMethod { return method.getDeclaringClass() + "." + method.getName(); } - private ConvertingMethod(Method m) throws OpenDataException { + private ConvertingMethod(Method m, MXBeanMappingFactory mappingFactory) + throws OpenDataException { this.method = m; - returnConverter = OpenConverter.toConverter(m.getGenericReturnType()); + returnMapping = + mappingFactory.mappingForType(m.getGenericReturnType(), mappingFactory); Type[] params = m.getGenericParameterTypes(); - paramConverters = new OpenConverter[params.length]; + paramMappings = new MXBeanMapping[params.length]; boolean identity = true; for (int i = 0; i < params.length; i++) { - paramConverters[i] = OpenConverter.toConverter(params[i]); - identity &= paramConverters[i].isIdentity(); + paramMappings[i] = mappingFactory.mappingForType(params[i], mappingFactory); + identity &= DefaultMXBeanMappingFactory.isIdentity(paramMappings[i]); } paramConversionIsIdentity = identity; } @@ -208,7 +224,7 @@ final class ConvertingMethod { private static final String[] noStrings = new String[0]; private final Method method; - private final OpenConverter returnConverter; - private final OpenConverter[] paramConverters; + private final MXBeanMapping returnMapping; + private final MXBeanMapping[] paramMappings; private final boolean paramConversionIsIdentity; } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java similarity index 68% rename from jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java rename to jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java index 25ac0a28e10..2d97c97b944 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/OpenConverter.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DefaultMXBeanMappingFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -26,6 +26,8 @@ package com.sun.jmx.mbeanserver; import static com.sun.jmx.mbeanserver.Util.*; +import java.lang.annotation.ElementType; +import javax.management.openmbean.MXBeanMappingClass; import static javax.management.openmbean.SimpleType.*; @@ -66,6 +68,8 @@ import javax.management.openmbean.CompositeDataInvocationHandler; import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.CompositeDataView; import javax.management.openmbean.CompositeType; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingFactory; import javax.management.openmbean.OpenDataException; import javax.management.openmbean.OpenType; import javax.management.openmbean.SimpleType; @@ -74,137 +78,118 @@ import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularType; /** -

    A converter between Java types and the limited set of classes - defined by Open MBeans.

    - -

    A Java type is an instance of java.lang.reflect.Type. For our - purposes, it is either a Class, such as String.class or int.class; - or a ParameterizedType, such as List or Map. On J2SE 1.4 and earlier, it can only be a Class.

    - -

    Each Type is associated with an OpenConverter. The - OpenConverter defines an OpenType corresponding to the Type, plus a - Java class corresponding to the OpenType. For example:

    - -
    -   Type                     Open class     OpenType
    -   ----                     ----------     --------
    -   Integer                  Integer        SimpleType.INTEGER
    -   int                      int            SimpleType.INTEGER
    -   Integer[]                Integer[]      ArrayType(1, SimpleType.INTEGER)
    -   int[]                    Integer[]      ArrayType(SimpleType.INTEGER, true)
    -   String[][]               String[][]     ArrayType(2, SimpleType.STRING)
    -   List             String[]       ArrayType(1, SimpleType.STRING)
    -   ThreadState (an Enum)    String         SimpleType.STRING
    -   Map   TabularData    TabularType(
    -                                             CompositeType(
    -                                               {"key", SimpleType.INTEGER},
    -                                               {"value",
    -                                                 ArrayType(1,
    -                                                  SimpleType.STRING)}),
    -                                             indexNames={"key"})
    -   
    - -

    Apart from simple types, arrays, and collections, Java types are - converted through introspection into CompositeType. The Java type - must have at least one getter (method such as "int getSize()" or - "boolean isBig()"), and we must be able to deduce how to - reconstruct an instance of the Java class from the values of the - getters using one of various heuristics.

    - - @since 1.6 + *

    A converter between Java types and the limited set of classes + * defined by Open MBeans.

    + * + *

    A Java type is an instance of java.lang.reflect.Type. For our + * purposes, it is either a Class, such as String.class or int.class; + * or a ParameterizedType, such as List or Map. On J2SE 1.4 and earlier, it can only be a Class.

    + * + *

    Each Type is associated with an DefaultMXBeanMappingFactory. The + * DefaultMXBeanMappingFactory defines an OpenType corresponding to the Type, plus a + * Java class corresponding to the OpenType. For example:

    + * + *
    + *   Type                     Open class     OpenType
    + *   ----                     ----------     --------
    + *   Integer                Integer        SimpleType.INTEGER
    + *   int                            int            SimpleType.INTEGER
    + *   Integer[]              Integer[]      ArrayType(1, SimpleType.INTEGER)
    + *   int[]                  Integer[]      ArrayType(SimpleType.INTEGER, true)
    + *   String[][]             String[][]     ArrayType(2, SimpleType.STRING)
    + *   List                   String[]       ArrayType(1, SimpleType.STRING)
    + *   ThreadState (an Enum)    String         SimpleType.STRING
    + *   Map   TabularData          TabularType(
    + *                                           CompositeType(
    + *                                             {"key", SimpleType.INTEGER},
    + *                                             {"value",
    + *                                               ArrayType(1,
    + *                                                SimpleType.STRING)}),
    + *                                           indexNames={"key"})
    + *   
    + * + *

    Apart from simple types, arrays, and collections, Java types are + * converted through introspection into CompositeType. The Java type + * must have at least one getter (method such as "int getSize()" or + * "boolean isBig()"), and we must be able to deduce how to + * reconstruct an instance of the Java class from the values of the + * getters using one of various heuristics.

    + * + * @since 1.6 */ -public abstract class OpenConverter { - private OpenConverter(Type targetType, OpenType openType, - Class openClass) { - this.targetType = targetType; - this.openType = openType; - this.openClass = openClass; +public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory { + static abstract class NonNullMXBeanMapping extends MXBeanMapping { + NonNullMXBeanMapping(Type javaType, OpenType openType) { + super(javaType, openType); + } + + @Override + public final Object fromOpenValue(Object openValue) + throws InvalidObjectException { + if (openValue == null) + return null; + else + return fromNonNullOpenValue(openValue); + } + + @Override + public final Object toOpenValue(Object javaValue) throws OpenDataException { + if (javaValue == null) + return null; + else + return toNonNullOpenValue(javaValue); + } + + abstract Object fromNonNullOpenValue(Object openValue) + throws InvalidObjectException; + + abstract Object toNonNullOpenValue(Object javaValue) + throws OpenDataException; + + /** + *

    True if and only if this MXBeanMapping's toOpenValue and + * fromOpenValue methods are the identity function.

    + */ + boolean isIdentity() { + return false; + } } - /**

    Convert an instance of openClass into an instance of targetType. */ - public final Object fromOpenValue(MXBeanLookup lookup, Object value) - throws InvalidObjectException { - if (value == null) - return null; - else - return fromNonNullOpenValue(lookup, value); + static boolean isIdentity(MXBeanMapping mapping) { + return (mapping instanceof NonNullMXBeanMapping && + ((NonNullMXBeanMapping) mapping).isIdentity()); } - abstract Object fromNonNullOpenValue(MXBeanLookup lookup, Object value) - throws InvalidObjectException; + private static final class Mappings + extends WeakHashMap> {} - /**

    Throw an appropriate InvalidObjectException if we will not be able - to convert back from the open data to the original Java object.

    */ - void checkReconstructible() throws InvalidObjectException { - // subclasses override if action necessary - } + private static final Map factoryMappings = + new WeakHashMap(); - /**

    Convert an instance of targetType into an instance of openClass. */ - final Object toOpenValue(MXBeanLookup lookup, Object value) - throws OpenDataException { - if (value == null) - return null; - else - return toNonNullOpenValue(lookup, value); - } + private static final Map permanentMappings = newMap(); - abstract Object toNonNullOpenValue(MXBeanLookup lookup, Object value) - throws OpenDataException; - - /**

    True if and only if this OpenConverter's toOpenValue and fromOpenValue - methods are the identity function.

    */ - boolean isIdentity() { - return false; - } - - /**

    True if and only if isIdentity() and even an array of the underlying type - is transformed as the identity. This is true for Integer and - ObjectName, for instance, but not for int.

    */ - final Type getTargetType() { - return targetType; - } - - final OpenType getOpenType() { - return openType; - } - - /* The Java class corresponding to getOpenType(). This is the class - named by getOpenType().getClassName(), except that it may be a - primitive type or an array of primitive type. */ - final Class getOpenClass() { - return openClass; - } - - private final Type targetType; - private final OpenType openType; - private final Class openClass; - - private static final class ConverterMap - extends WeakHashMap> {} - - private static final ConverterMap converterMap = new ConverterMap(); - - /** Following List simply serves to keep a reference to predefined - OpenConverters so they don't get garbage collected. */ - private static final List permanentConverters = newList(); - - private static synchronized OpenConverter getConverter(Type type) { - WeakReference wr = converterMap.get(type); + private static synchronized MXBeanMapping getMapping( + Type type, MXBeanMappingFactory factory) { + Mappings mappings = factoryMappings.get(factory); + if (mappings == null) { + mappings = new Mappings(); + factoryMappings.put(factory, mappings); + } + WeakReference wr = mappings.get(type); return (wr == null) ? null : wr.get(); } - private static synchronized void putConverter(Type type, - OpenConverter conv) { - WeakReference wr = - new WeakReference(conv); - converterMap.put(type, wr); - } - - private static synchronized void putPermanentConverter(Type type, - OpenConverter conv) { - putConverter(type, conv); - permanentConverters.add(conv); + private static synchronized void putMapping( + Type type, MXBeanMapping mapping, MXBeanMappingFactory factory) { + Mappings mappings = factoryMappings.get(factory); + if (mappings == null) { + mappings = new Mappings(); + factoryMappings.put(factory, mappings); + } + WeakReference wr = + new WeakReference(mapping); + mappings.put(type, wr); } static { @@ -226,28 +211,26 @@ public abstract class OpenConverter { // the classes that these predefined types declare must exist! throw new Error(e); } - final OpenConverter conv = new IdentityConverter(c, t, c); - putPermanentConverter(c, conv); + final MXBeanMapping mapping = new IdentityMapping(c, t); + permanentMappings.put(c, mapping); if (c.getName().startsWith("java.lang.")) { try { final Field typeField = c.getField("TYPE"); - final Class primitiveType = (Class) typeField.get(null); - final OpenConverter primitiveConv = - new IdentityConverter(primitiveType, t, primitiveType); - putPermanentConverter(primitiveType, - primitiveConv); + final Class primitiveType = (Class) typeField.get(null); + final MXBeanMapping primitiveMapping = + new IdentityMapping(primitiveType, t); + permanentMappings.put(primitiveType, primitiveMapping); if (primitiveType != void.class) { final Class primitiveArrayType = Array.newInstance(primitiveType, 0).getClass(); final OpenType primitiveArrayOpenType = ArrayType.getPrimitiveArrayType(primitiveArrayType); - final OpenConverter primitiveArrayConv = - new IdentityConverter(primitiveArrayType, - primitiveArrayOpenType, - primitiveArrayType); - putPermanentConverter(primitiveArrayType, - primitiveArrayConv); + final MXBeanMapping primitiveArrayMapping = + new IdentityMapping(primitiveArrayType, + primitiveArrayOpenType); + permanentMappings.put(primitiveArrayType, + primitiveArrayMapping); } } catch (NoSuchFieldException e) { // OK: must not be a primitive wrapper @@ -260,64 +243,119 @@ public abstract class OpenConverter { } /** Get the converter for the given Java type, creating it if necessary. */ - public static synchronized OpenConverter toConverter(Type objType) + @Override + public synchronized MXBeanMapping mappingForType(Type objType, + MXBeanMappingFactory factory) throws OpenDataException { - if (inProgress.containsKey(objType)) throw new OpenDataException("Recursive data structure"); - OpenConverter conv; + MXBeanMapping mapping; - conv = getConverter(objType); - if (conv != null) - return conv; + mapping = getMapping(objType, null); + if (mapping != null) + return mapping; inProgress.put(objType, objType); try { - conv = makeConverter(objType); + mapping = makeMapping(objType, factory); } finally { inProgress.remove(objType); } - putConverter(objType, conv); - return conv; + putMapping(objType, mapping, factory); + return mapping; } - private static OpenConverter makeConverter(Type objType) - throws OpenDataException { + private MXBeanMapping makeMapping(Type objType, MXBeanMappingFactory factory) + throws OpenDataException { /* It's not yet worth formalizing these tests by having for example an array of factory classes, each of which says whether it recognizes the Type (Chain of Responsibility pattern). */ + MXBeanMapping mapping = permanentMappings.get(objType); + if (mapping != null) + return mapping; + Class erasure = erasure(objType); + MXBeanMappingClass mappingClass = + erasure.getAnnotation(MXBeanMappingClass.class); + if (mappingClass != null) + return makeAnnotationMapping(mappingClass, objType, factory); if (objType instanceof GenericArrayType) { Type componentType = ((GenericArrayType) objType).getGenericComponentType(); - return makeArrayOrCollectionConverter(objType, componentType); + return makeArrayOrCollectionMapping(objType, componentType, factory); } else if (objType instanceof Class) { Class objClass = (Class) objType; if (objClass.isEnum()) { // Huge hack to avoid compiler warnings here. The ElementType // parameter is ignored but allows us to obtain a type variable // T that matches >. - return makeEnumConverter(objClass, ElementType.class); + return makeEnumMapping((Class) objClass, ElementType.class); } else if (objClass.isArray()) { Type componentType = objClass.getComponentType(); - return makeArrayOrCollectionConverter(objClass, componentType); + return makeArrayOrCollectionMapping(objClass, componentType, + factory); } else if (JMX.isMXBeanInterface(objClass)) { - return makeMXBeanConverter(objClass); + return makeMXBeanRefMapping(objClass); } else { - return makeCompositeConverter(objClass); + return makeCompositeMapping(objClass, factory); } } else if (objType instanceof ParameterizedType) { - return makeParameterizedConverter((ParameterizedType) objType); + return makeParameterizedTypeMapping((ParameterizedType) objType, + factory); } else throw new OpenDataException("Cannot map type: " + objType); } - private static > OpenConverter - makeEnumConverter(Class enumClass, Class fake) { - Class enumClassT = Util.cast(enumClass); - return new EnumConverter(enumClassT); + private static MXBeanMapping + makeAnnotationMapping(MXBeanMappingClass mappingClass, + Type objType, + MXBeanMappingFactory factory) + throws OpenDataException { + Class c = mappingClass.value(); + Constructor cons; + try { + cons = c.getConstructor(Type.class); + } catch (NoSuchMethodException e) { + final String msg = + "Annotation @" + MXBeanMappingClass.class.getName() + + " must name a class with a public constructor that has a " + + "single " + Type.class.getName() + " argument"; + OpenDataException ode = new OpenDataException(msg); + ode.initCause(e); + throw ode; + } + try { + return cons.newInstance(objType); + } catch (Exception e) { + final String msg = + "Could not construct a " + c.getName() + " for @" + + MXBeanMappingClass.class.getName(); + OpenDataException ode = new OpenDataException(msg); + ode.initCause(e); + throw ode; + } + } + + private static Class erasure(Type t) { + if (t instanceof Class) + return (Class) t; + if (t instanceof ParameterizedType) + return erasure(((ParameterizedType) t).getRawType()); + /* Other cases: GenericArrayType, TypeVariable, WildcardType. + * Returning the erasure of GenericArrayType is not necessary because + * anyway we will be recursing on the element type, and we'll erase + * then. Returning the erasure of the other two would mean returning + * the type bound (e.g. Foo in or ) + * and since we don't treat this as Foo elsewhere we shouldn't here. + */ + return Object.class; + } + + private static > MXBeanMapping + makeEnumMapping(Class enumClass, Class fake) { + return new EnumMapping(Util.>cast(enumClass)); } /* Make the converter for an array type, or a collection such as @@ -325,14 +363,15 @@ public abstract class OpenConverter { * primitive arrays (e.g. int[]) here because they use the identity * converter and are registered as such in the static initializer. */ - private static OpenConverter - makeArrayOrCollectionConverter(Type collectionType, Type elementType) + private MXBeanMapping + makeArrayOrCollectionMapping(Type collectionType, Type elementType, + MXBeanMappingFactory factory) throws OpenDataException { - final OpenConverter elementConverter = toConverter(elementType); - final OpenType elementOpenType = elementConverter.getOpenType(); + final MXBeanMapping elementMapping = factory.mappingForType(elementType, factory); + final OpenType elementOpenType = elementMapping.getOpenType(); final ArrayType openType = ArrayType.getArrayType(elementOpenType); - final Class elementOpenClass = elementConverter.getOpenClass(); + final Class elementOpenClass = elementMapping.getOpenClass(); final Class openArrayClass; final String openArrayClassName; @@ -347,19 +386,18 @@ public abstract class OpenConverter { } if (collectionType instanceof ParameterizedType) { - return new CollectionConverter(collectionType, - openType, openArrayClass, - elementConverter); + return new CollectionMapping(collectionType, + openType, openArrayClass, + elementMapping); } else { - if (elementConverter.isIdentity()) { - return new IdentityConverter(collectionType, - openType, - openArrayClass); + if (isIdentity(elementMapping)) { + return new IdentityMapping(collectionType, + openType); } else { - return new ArrayConverter(collectionType, + return new ArrayMapping(collectionType, openType, openArrayClass, - elementConverter); + elementMapping); } } } @@ -367,16 +405,17 @@ public abstract class OpenConverter { private static final String[] keyArray = {"key"}; private static final String[] keyValueArray = {"key", "value"}; - private static OpenConverter - makeTabularConverter(Type objType, boolean sortedMap, - Type keyType, Type valueType) + private MXBeanMapping + makeTabularMapping(Type objType, boolean sortedMap, + Type keyType, Type valueType, + MXBeanMappingFactory factory) throws OpenDataException { final String objTypeName = objType.toString(); - final OpenConverter keyConverter = toConverter(keyType); - final OpenConverter valueConverter = toConverter(valueType); - final OpenType keyOpenType = keyConverter.getOpenType(); - final OpenType valueOpenType = valueConverter.getOpenType(); + final MXBeanMapping keyMapping = factory.mappingForType(keyType, factory); + final MXBeanMapping valueMapping = factory.mappingForType(valueType, factory); + final OpenType keyOpenType = keyMapping.getOpenType(); + final OpenType valueOpenType = valueMapping.getOpenType(); final CompositeType rowType = new CompositeType(objTypeName, objTypeName, @@ -385,8 +424,8 @@ public abstract class OpenConverter { new OpenType[] {keyOpenType, valueOpenType}); final TabularType tabularType = new TabularType(objTypeName, objTypeName, rowType, keyArray); - return new TabularConverter(objType, sortedMap, tabularType, - keyConverter, valueConverter); + return new TabularMapping(objType, sortedMap, tabularType, + keyMapping, valueMapping); } /* We know how to translate List, Set, SortedSet, @@ -394,8 +433,10 @@ public abstract class OpenConverter { subtypes of those because we wouldn't know how to deserialize them. We don't accept Queue because it is unlikely people would use that as a parameter or return type in an MBean. */ - private static OpenConverter - makeParameterizedConverter(ParameterizedType objType) throws OpenDataException { + private MXBeanMapping + makeParameterizedTypeMapping(ParameterizedType objType, + MXBeanMappingFactory factory) + throws OpenDataException { final Type rawType = objType.getRawType(); @@ -406,7 +447,7 @@ public abstract class OpenConverter { assert(actuals.length == 1); if (c == SortedSet.class) mustBeComparable(c, actuals[0]); - return makeArrayOrCollectionConverter(objType, actuals[0]); + return makeArrayOrCollectionMapping(objType, actuals[0], factory); } else { boolean sortedMap = (c == SortedMap.class); if (c == Map.class || sortedMap) { @@ -414,20 +455,21 @@ public abstract class OpenConverter { assert(actuals.length == 2); if (sortedMap) mustBeComparable(c, actuals[0]); - return makeTabularConverter(objType, sortedMap, - actuals[0], actuals[1]); + return makeTabularMapping(objType, sortedMap, + actuals[0], actuals[1], factory); } } } throw new OpenDataException("Cannot convert type: " + objType); } - private static OpenConverter makeMXBeanConverter(Type t) + private static MXBeanMapping makeMXBeanRefMapping(Type t) throws OpenDataException { - return new MXBeanConverter(t); + return new MXBeanRefMapping(t); } - private static OpenConverter makeCompositeConverter(Class c) + private MXBeanMapping makeCompositeMapping(Class c, + MXBeanMappingFactory factory) throws OpenDataException { // For historical reasons GcInfo implements CompositeData but we @@ -479,7 +521,7 @@ public abstract class OpenConverter { final Method getter = entry.getValue(); getters[i] = getter; final Type retType = getter.getGenericReturnType(); - openTypes[i] = toConverter(retType).getOpenType(); + openTypes[i] = factory.mappingForType(retType, factory).getOpenType(); i++; } @@ -490,52 +532,55 @@ public abstract class OpenConverter { itemNames, // field descriptions openTypes); - return new CompositeConverter(c, - compositeType, - itemNames, - getters); + return new CompositeMapping(c, + compositeType, + itemNames, + getters, + factory); } /* Converter for classes where the open data is identical to the original data. This is true for any of the SimpleType types, and for an any-dimension array of those. It is also true for - primitive types as of JMX 1.3, since an int[] needs to + primitive types as of JMX 1.3, since an int[] can be directly represented by an ArrayType, and an int needs no mapping because reflection takes care of it. */ - private static final class IdentityConverter extends OpenConverter { - IdentityConverter(Type targetType, OpenType openType, - Class openClass) { - super(targetType, openType, openClass); + private static final class IdentityMapping extends NonNullMXBeanMapping { + IdentityMapping(Type targetType, OpenType openType) { + super(targetType, openType); } boolean isIdentity() { return true; } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) { - return value; + @Override + Object fromNonNullOpenValue(Object openValue) + throws InvalidObjectException { + return openValue; } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object value) { - return value; + @Override + Object toNonNullOpenValue(Object javaValue) throws OpenDataException { + return javaValue; } } - private static final class EnumConverter> - extends OpenConverter { + private static final class EnumMapping> + extends NonNullMXBeanMapping { - EnumConverter(Class enumClass) { - super(enumClass, SimpleType.STRING, String.class); + EnumMapping(Class enumClass) { + super(enumClass, SimpleType.STRING); this.enumClass = enumClass; } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) { + @Override + final Object toNonNullOpenValue(Object value) { return ((Enum) value).name(); } - // return type could be T, but after erasure that would be - // java.lang.Enum, which doesn't exist on J2SE 1.4 - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final T fromNonNullOpenValue(Object value) throws InvalidObjectException { try { return Enum.valueOf(enumClass, (String) value); @@ -548,69 +593,69 @@ public abstract class OpenConverter { private final Class enumClass; } - private static final class ArrayConverter extends OpenConverter { - ArrayConverter(Type targetType, - ArrayType openArrayType, Class openArrayClass, - OpenConverter elementConverter) { - super(targetType, openArrayType, openArrayClass); - this.elementConverter = elementConverter; + private static final class ArrayMapping extends NonNullMXBeanMapping { + ArrayMapping(Type targetType, + ArrayType openArrayType, Class openArrayClass, + MXBeanMapping elementMapping) { + super(targetType, openArrayType); + this.elementMapping = elementMapping; } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object toNonNullOpenValue(Object value) throws OpenDataException { Object[] valueArray = (Object[]) value; final int len = valueArray.length; final Object[] openArray = (Object[]) Array.newInstance(getOpenClass().getComponentType(), len); - for (int i = 0; i < len; i++) { - openArray[i] = - elementConverter.toOpenValue(lookup, valueArray[i]); - } + for (int i = 0; i < len; i++) + openArray[i] = elementMapping.toOpenValue(valueArray[i]); return openArray; } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object openValue) + @Override + final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { final Object[] openArray = (Object[]) openValue; - final Type targetType = getTargetType(); + final Type javaType = getJavaType(); final Object[] valueArray; final Type componentType; - if (targetType instanceof GenericArrayType) { + if (javaType instanceof GenericArrayType) { componentType = - ((GenericArrayType) targetType).getGenericComponentType(); - } else if (targetType instanceof Class && - ((Class) targetType).isArray()) { - componentType = ((Class) targetType).getComponentType(); + ((GenericArrayType) javaType).getGenericComponentType(); + } else if (javaType instanceof Class && + ((Class) javaType).isArray()) { + componentType = ((Class) javaType).getComponentType(); } else { throw new IllegalArgumentException("Not an array: " + - targetType); + javaType); } valueArray = (Object[]) Array.newInstance((Class) componentType, openArray.length); - for (int i = 0; i < openArray.length; i++) { - valueArray[i] = - elementConverter.fromOpenValue(lookup, openArray[i]); - } + for (int i = 0; i < openArray.length; i++) + valueArray[i] = elementMapping.fromOpenValue(openArray[i]); return valueArray; } - void checkReconstructible() throws InvalidObjectException { - elementConverter.checkReconstructible(); + public void checkReconstructible() throws InvalidObjectException { + elementMapping.checkReconstructible(); } - /** OpenConverter for the elements of this array. If this is an - array of arrays, the converter converts the second-level arrays, - not the deepest elements. */ - private final OpenConverter elementConverter; + /** + * DefaultMXBeanMappingFactory for the elements of this array. If this is an + * array of arrays, the converter converts the second-level arrays, + * not the deepest elements. + */ + private final MXBeanMapping elementMapping; } - private static final class CollectionConverter extends OpenConverter { - CollectionConverter(Type targetType, - ArrayType openArrayType, - Class openArrayClass, - OpenConverter elementConverter) { - super(targetType, openArrayType, openArrayClass); - this.elementConverter = elementConverter; + private static final class CollectionMapping extends NonNullMXBeanMapping { + CollectionMapping(Type targetType, + ArrayType openArrayType, + Class openArrayClass, + MXBeanMapping elementMapping) { + super(targetType, openArrayType); + this.elementMapping = elementMapping; /* Determine the concrete class to be used when converting back to this Java type. We convert all Lists to ArrayList @@ -630,7 +675,8 @@ public abstract class OpenConverter { } } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object toNonNullOpenValue(Object value) throws OpenDataException { final Collection valueCollection = (Collection) value; if (valueCollection instanceof SortedSet) { @@ -640,7 +686,7 @@ public abstract class OpenConverter { final String msg = "Cannot convert SortedSet with non-null comparator: " + comparator; - throw new OpenDataException(msg); + throw openDataException(msg, new IllegalArgumentException(msg)); } } final Object[] openArray = (Object[]) @@ -648,21 +694,22 @@ public abstract class OpenConverter { valueCollection.size()); int i = 0; for (Object o : valueCollection) - openArray[i++] = elementConverter.toOpenValue(lookup, o); + openArray[i++] = elementMapping.toOpenValue(o); return openArray; } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object openValue) + @Override + final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { final Object[] openArray = (Object[]) openValue; final Collection valueCollection; try { - valueCollection = Util.cast(collectionClass.newInstance()); + valueCollection = cast(collectionClass.newInstance()); } catch (Exception e) { throw invalidObjectException("Cannot create collection", e); } for (Object o : openArray) { - Object value = elementConverter.fromOpenValue(lookup, o); + Object value = elementMapping.fromOpenValue(o); if (!valueCollection.add(value)) { final String msg = "Could not add " + o + " to " + @@ -674,34 +721,36 @@ public abstract class OpenConverter { return valueCollection; } - void checkReconstructible() throws InvalidObjectException { - elementConverter.checkReconstructible(); + public void checkReconstructible() throws InvalidObjectException { + elementMapping.checkReconstructible(); } private final Class collectionClass; - private final OpenConverter elementConverter; + private final MXBeanMapping elementMapping; } - private static final class MXBeanConverter extends OpenConverter { - MXBeanConverter(Type intf) { - super(intf, SimpleType.OBJECTNAME, ObjectName.class); + private static final class MXBeanRefMapping extends NonNullMXBeanMapping { + MXBeanRefMapping(Type intf) { + super(intf, SimpleType.OBJECTNAME); } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object toNonNullOpenValue(Object javaValue) throws OpenDataException { - lookupNotNull(lookup, OpenDataException.class); - ObjectName name = lookup.mxbeanToObjectName(value); + MXBeanLookup lookup = lookupNotNull(OpenDataException.class); + ObjectName name = lookup.mxbeanToObjectName(javaValue); if (name == null) - throw new OpenDataException("No name for object: " + value); + throw new OpenDataException("No name for object: " + javaValue); return name; } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { - lookupNotNull(lookup, InvalidObjectException.class); - ObjectName name = (ObjectName) value; + MXBeanLookup lookup = lookupNotNull(InvalidObjectException.class); + ObjectName name = (ObjectName) openValue; Object mxbean = - lookup.objectNameToMXBean(name, (Class) getTargetType()); + lookup.objectNameToMXBean(name, (Class) getJavaType()); if (mxbean == null) { final String msg = "No MXBean for name: " + name; @@ -710,9 +759,10 @@ public abstract class OpenConverter { return mxbean; } - private void - lookupNotNull(MXBeanLookup lookup, Class excClass) + private MXBeanLookup + lookupNotNull(Class excClass) throws T { + MXBeanLookup lookup = MXBeanLookup.getLookup(); if (lookup == null) { final String msg = "Cannot convert MXBean interface in this context"; @@ -725,41 +775,40 @@ public abstract class OpenConverter { } throw exc; } + return lookup; } } - private static final class TabularConverter extends OpenConverter { - TabularConverter(Type targetType, - boolean sortedMap, - TabularType tabularType, - OpenConverter keyConverter, - OpenConverter valueConverter) { - super(targetType, tabularType, TabularData.class); + private static final class TabularMapping extends NonNullMXBeanMapping { + TabularMapping(Type targetType, + boolean sortedMap, + TabularType tabularType, + MXBeanMapping keyConverter, + MXBeanMapping valueConverter) { + super(targetType, tabularType); this.sortedMap = sortedMap; - this.keyConverter = keyConverter; - this.valueConverter = valueConverter; + this.keyMapping = keyConverter; + this.valueMapping = valueConverter; } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) - throws OpenDataException { - final Map valueMap = Util.cast(value); + @Override + final Object toNonNullOpenValue(Object value) throws OpenDataException { + final Map valueMap = cast(value); if (valueMap instanceof SortedMap) { Comparator comparator = ((SortedMap) valueMap).comparator(); if (comparator != null) { final String msg = "Cannot convert SortedMap with non-null comparator: " + comparator; - throw new OpenDataException(msg); + throw openDataException(msg, new IllegalArgumentException(msg)); } } final TabularType tabularType = (TabularType) getOpenType(); final TabularData table = new TabularDataSupport(tabularType); final CompositeType rowType = tabularType.getRowType(); for (Map.Entry entry : valueMap.entrySet()) { - final Object openKey = - keyConverter.toOpenValue(lookup, entry.getKey()); - final Object openValue = - valueConverter.toOpenValue(lookup, entry.getValue()); + final Object openKey = keyMapping.toOpenValue(entry.getKey()); + final Object openValue = valueMapping.toOpenValue(entry.getValue()); final CompositeData row; row = new CompositeDataSupport(rowType, keyValueArray, @@ -770,17 +819,18 @@ public abstract class OpenConverter { return table; } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object openValue) + @Override + final Object fromNonNullOpenValue(Object openValue) throws InvalidObjectException { final TabularData table = (TabularData) openValue; - final Collection rows = Util.cast(table.values()); + final Collection rows = cast(table.values()); final Map valueMap = sortedMap ? newSortedMap() : newMap(); for (CompositeData row : rows) { final Object key = - keyConverter.fromOpenValue(lookup, row.get("key")); + keyMapping.fromOpenValue(row.get("key")); final Object value = - valueConverter.fromOpenValue(lookup, row.get("value")); + valueMapping.fromOpenValue(row.get("value")); if (valueMap.put(key, value) != null) { final String msg = "Duplicate entry in TabularData: key=" + key; @@ -790,35 +840,38 @@ public abstract class OpenConverter { return valueMap; } - void checkReconstructible() throws InvalidObjectException { - keyConverter.checkReconstructible(); - valueConverter.checkReconstructible(); + @Override + public void checkReconstructible() throws InvalidObjectException { + keyMapping.checkReconstructible(); + valueMapping.checkReconstructible(); } private final boolean sortedMap; - private final OpenConverter keyConverter; - private final OpenConverter valueConverter; + private final MXBeanMapping keyMapping; + private final MXBeanMapping valueMapping; } - private static final class CompositeConverter extends OpenConverter { - CompositeConverter(Class targetClass, - CompositeType compositeType, - String[] itemNames, - Method[] getters) throws OpenDataException { - super(targetClass, compositeType, CompositeData.class); + private final class CompositeMapping extends NonNullMXBeanMapping { + CompositeMapping(Class targetClass, + CompositeType compositeType, + String[] itemNames, + Method[] getters, + MXBeanMappingFactory factory) throws OpenDataException { + super(targetClass, compositeType); assert(itemNames.length == getters.length); this.itemNames = itemNames; this.getters = getters; - this.getterConverters = new OpenConverter[getters.length]; + this.getterMappings = new MXBeanMapping[getters.length]; for (int i = 0; i < getters.length; i++) { Type retType = getters[i].getGenericReturnType(); - getterConverters[i] = OpenConverter.toConverter(retType); + getterMappings[i] = factory.mappingForType(retType, factory); } } - final Object toNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object toNonNullOpenValue(Object value) throws OpenDataException { CompositeType ct = (CompositeType) getOpenType(); if (value instanceof CompositeDataView) @@ -830,7 +883,7 @@ public abstract class OpenConverter { for (int i = 0; i < getters.length; i++) { try { Object got = getters[i].invoke(value, (Object[]) null); - values[i] = getterConverters[i].toOpenValue(lookup, got); + values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); @@ -848,7 +901,7 @@ public abstract class OpenConverter { if (compositeBuilder != null) return; - Class targetClass = (Class) getTargetType(); + Class targetClass = (Class) getJavaType(); /* In this 2D array, each subarray is a set of builders where there is no point in consulting the ones after the first if the first refuses. */ @@ -861,7 +914,7 @@ public abstract class OpenConverter { }, { new CompositeBuilderCheckGetters(targetClass, itemNames, - getterConverters), + getterMappings), new CompositeBuilderViaSetters(targetClass, itemNames), new CompositeBuilderViaProxy(targetClass, itemNames), }, @@ -898,22 +951,23 @@ public abstract class OpenConverter { compositeBuilder = foundBuilder; } - void checkReconstructible() throws InvalidObjectException { + @Override + public void checkReconstructible() throws InvalidObjectException { makeCompositeBuilder(); } - public final Object fromNonNullOpenValue(MXBeanLookup lookup, Object value) + @Override + final Object fromNonNullOpenValue(Object value) throws InvalidObjectException { makeCompositeBuilder(); - return compositeBuilder.fromCompositeData(lookup, - (CompositeData) value, + return compositeBuilder.fromCompositeData((CompositeData) value, itemNames, - getterConverters); + getterMappings); } private final String[] itemNames; private final Method[] getters; - private final OpenConverter[] getterConverters; + private final MXBeanMapping[] getterMappings; private CompositeBuilder compositeBuilder; } @@ -940,9 +994,9 @@ public abstract class OpenConverter { abstract String applicable(Method[] getters) throws InvalidObjectException; - abstract Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, + abstract Object fromCompositeData(CompositeData cd, String[] itemNames, - OpenConverter[] converters) + MXBeanMapping[] converters) throws InvalidObjectException; private final Class targetClass; @@ -991,9 +1045,9 @@ public abstract class OpenConverter { } } - final Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, - String[] itemNames, - OpenConverter[] converters) + final Object fromCompositeData(CompositeData cd, + String[] itemNames, + MXBeanMapping[] converters) throws InvalidObjectException { try { return fromMethod.invoke(null, cd); @@ -1018,7 +1072,7 @@ public abstract class OpenConverter { an empty string and the other builders will be tried. */ private static class CompositeBuilderCheckGetters extends CompositeBuilder { CompositeBuilderCheckGetters(Class targetClass, String[] itemNames, - OpenConverter[] getterConverters) { + MXBeanMapping[] getterConverters) { super(targetClass, itemNames); this.getterConverters = getterConverters; } @@ -1035,25 +1089,25 @@ public abstract class OpenConverter { return ""; } - final Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, + final Object fromCompositeData(CompositeData cd, String[] itemNames, - OpenConverter[] converters) { + MXBeanMapping[] converters) { throw new Error(); } - private final OpenConverter[] getterConverters; + private final MXBeanMapping[] getterConverters; } /** Builder for when the target class has a setter for every getter. */ private static class CompositeBuilderViaSetters extends CompositeBuilder { - CompositeBuilderViaSetters(Class targetClass, String[] itemNames) { + CompositeBuilderViaSetters(Class targetClass, String[] itemNames) { super(targetClass, itemNames); } String applicable(Method[] getters) { try { - Constructor c = getTargetClass().getConstructor((Class[]) null); + Constructor c = getTargetClass().getConstructor(); } catch (Exception e) { return "does not have a public no-arg constructor"; } @@ -1079,9 +1133,9 @@ public abstract class OpenConverter { return null; } - Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, + Object fromCompositeData(CompositeData cd, String[] itemNames, - OpenConverter[] converters) + MXBeanMapping[] converters) throws InvalidObjectException { Object o; try { @@ -1090,7 +1144,7 @@ public abstract class OpenConverter { if (cd.containsKey(itemNames[i])) { Object openItem = cd.get(itemNames[i]); Object javaItem = - converters[i].fromOpenValue(lookup, openItem); + converters[i].fromOpenValue(openItem); setters[i].invoke(o, javaItem); } } @@ -1118,10 +1172,10 @@ public abstract class OpenConverter { final Class propertyNamesClass = ConstructorProperties.class; Class targetClass = getTargetClass(); - Constructor[] constrs = targetClass.getConstructors(); + Constructor[] constrs = targetClass.getConstructors(); // Applicable if and only if there are any annotated constructors - List> annotatedConstrList = newList(); + List annotatedConstrList = newList(); for (Constructor constr : constrs) { if (Modifier.isPublic(constr.getModifiers()) && constr.getAnnotation(propertyNamesClass) != null) @@ -1152,7 +1206,7 @@ public abstract class OpenConverter { // Also remember the set of properties in that constructor // so we can test unambiguity. Set getterIndexSets = newSet(); - for (Constructor constr : annotatedConstrList) { + for (Constructor constr : annotatedConstrList) { String[] propertyNames = constr.getAnnotation(propertyNamesClass).value(); @@ -1251,9 +1305,9 @@ public abstract class OpenConverter { return null; // success! } - Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, - String[] itemNames, - OpenConverter[] converters) + final Object fromCompositeData(CompositeData cd, + String[] itemNames, + MXBeanMapping[] mappings) throws InvalidObjectException { // The CompositeData might come from an earlier version where // not all the items were present. We look for a constructor @@ -1287,7 +1341,7 @@ public abstract class OpenConverter { if (!max.presentParams.get(i)) continue; Object openItem = cd.get(itemNames[i]); - Object javaItem = converters[i].fromOpenValue(lookup, openItem); + Object javaItem = mappings[i].fromOpenValue(openItem); int index = max.paramIndexes[i]; if (index >= 0) params[index] = javaItem; @@ -1309,10 +1363,10 @@ public abstract class OpenConverter { } private static class Constr { - final Constructor constructor; + final Constructor constructor; final int[] paramIndexes; final BitSet presentParams; - Constr(Constructor constructor, int[] paramIndexes, + Constr(Constructor constructor, int[] paramIndexes, BitSet presentParams) { this.constructor = constructor; this.paramIndexes = paramIndexes; @@ -1365,9 +1419,9 @@ public abstract class OpenConverter { return null; // success! } - final Object fromCompositeData(MXBeanLookup lookup, CompositeData cd, - String[] itemNames, - OpenConverter[] converters) { + final Object fromCompositeData(CompositeData cd, + String[] itemNames, + MXBeanMapping[] converters) { final Class targetClass = getTargetClass(); return Proxy.newProxyInstance(targetClass.getClassLoader(), diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java index 49d49ce4c1f..270f7ad77a6 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/DynamicMBean2.java @@ -25,7 +25,7 @@ package com.sun.jmx.mbeanserver; -import javax.management.DynamicMBean; +import javax.management.DynamicWrapperMBean; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -35,17 +35,7 @@ import javax.management.ObjectName; * * @since 1.6 */ -public interface DynamicMBean2 extends DynamicMBean { - /** - * The resource corresponding to this MBean. This is the object whose - * class name should be reflected by the MBean's - * getMBeanInfo().getClassName() for example. For a "plain" - * DynamicMBean it will be "this". For an MBean that wraps another - * object, like javax.management.StandardMBean, it will be the wrapped - * object. - */ - public Object getResource(); - +public interface DynamicMBean2 extends DynamicWrapperMBean { /** * The name of this MBean's class, as used by permission checks. * This is typically equal to getResource().getClass().getName(). diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java index 2a72f3d222f..1554444f508 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -25,23 +25,38 @@ package com.sun.jmx.mbeanserver; +import com.sun.jmx.remote.util.EnvHelp; +import java.beans.BeanInfo; +import java.beans.PropertyDescriptor; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; +import java.lang.reflect.Array; import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.lang.reflect.Proxy; import java.lang.reflect.UndeclaredThrowableException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.logging.Level; +import javax.management.AttributeNotFoundException; +import javax.management.Description; import javax.management.Descriptor; +import javax.management.DescriptorFields; import javax.management.DescriptorKey; import javax.management.DynamicMBean; import javax.management.ImmutableDescriptor; +import javax.management.MBean; import javax.management.MBeanInfo; +import javax.management.MXBean; import javax.management.NotCompliantMBeanException; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.MXBeanMappingFactory; +import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER; import com.sun.jmx.mbeanserver.Util; import com.sun.jmx.remote.util.EnvHelp; import java.beans.BeanInfo; @@ -50,6 +65,7 @@ import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; import javax.management.AttributeNotFoundException; import javax.management.openmbean.CompositeData; +import javax.management.openmbean.MXBeanMappingFactory; /** * This class contains the methods for performing all the tests needed to verify @@ -133,8 +149,12 @@ public class Introspector { } } - public static void checkCompliance(Class mbeanClass) - throws NotCompliantMBeanException { + public static void checkCompliance(Class mbeanClass) + throws NotCompliantMBeanException { + + // Check that @Resource is used correctly (if it used). + MBeanInjector.validate(mbeanClass); + // Is DynamicMBean? // if (DynamicMBean.class.isAssignableFrom(mbeanClass)) @@ -157,38 +177,60 @@ public class Introspector { } catch (NotCompliantMBeanException e) { mxbeanException = e; } + // Is @MBean or @MXBean class? + // In fact we find @MBean or @MXBean as a hacky variant of + // getStandardMBeanInterface or getMXBeanInterface. If we get here + // then nothing worked. final String msg = "MBean class " + mbeanClass.getName() + " does not implement " + - "DynamicMBean, neither follows the Standard MBean conventions (" + - mbeanException.toString() + ") nor the MXBean conventions (" + - mxbeanException.toString() + ")"; + "DynamicMBean; does not follow the Standard MBean conventions (" + + mbeanException.toString() + "); does not follow the MXBean conventions (" + + mxbeanException.toString() + "); and does not have or inherit the @" + + MBean.class.getSimpleName() + " or @" + MXBean.class.getSimpleName() + + " annotation"; throw new NotCompliantMBeanException(msg); } - public static DynamicMBean makeDynamicMBean(Object mbean) - throws NotCompliantMBeanException { + /** + *

    Make a DynamicMBean out of the existing MBean object. The object + * may already be a DynamicMBean, or it may be a Standard MBean or + * MXBean, possibly defined using {@code @MBean} or {@code @MXBean}.

    + * @param mbean the object to convert to a DynamicMBean. + * @param a type parameter defined for implementation convenience + * (which would have to be removed if this method were part of the public + * API). + * @return the converted DynamicMBean. + * @throws NotCompliantMBeanException if {@code mbean} is not a compliant + * MBean object, including the case where it is null. + */ + public static DynamicMBean makeDynamicMBean(T mbean) + throws NotCompliantMBeanException { + if (mbean == null) + throw new NotCompliantMBeanException("Null MBean object"); if (mbean instanceof DynamicMBean) return (DynamicMBean) mbean; - final Class mbeanClass = mbean.getClass(); - Class c = null; + final Class mbeanClass = mbean.getClass(); + Class c = null; try { - c = getStandardMBeanInterface(mbeanClass); + c = Util.cast(getStandardMBeanInterface(mbeanClass)); } catch (NotCompliantMBeanException e) { // Ignore exception - we need to check whether // mbean is an MXBean first. } if (c != null) - return new StandardMBeanSupport(mbean, Util.>cast(c)); + return new StandardMBeanSupport(mbean, c); try { - c = getMXBeanInterface(mbeanClass); + c = Util.cast(getMXBeanInterface(mbeanClass)); } catch (NotCompliantMBeanException e) { // Ignore exception - we cannot decide whether mbean was supposed // to be an MBean or an MXBean. We will call checkCompliance() // to generate the appropriate exception. } - if (c != null) - return new MXBeanSupport(mbean, Util.>cast(c)); + if (c != null) { + MXBeanMappingFactory factory = MXBeanMappingFactory.forInterface(c); + return new MXBeanSupport(mbean, c, factory); + } checkCompliance(mbeanClass); throw new NotCompliantMBeanException("Not compliant"); // not reached } @@ -217,9 +259,10 @@ public class Introspector { return testCompliance(baseClass, null); } - public static void testComplianceMXBeanInterface(Class interfaceClass) + public static void testComplianceMXBeanInterface(Class interfaceClass, + MXBeanMappingFactory factory) throws NotCompliantMBeanException { - MXBeanIntrospector.getInstance().getAnalyzer(interfaceClass); + MXBeanIntrospector.getInstance(factory).getAnalyzer(interfaceClass); } /** @@ -265,7 +308,7 @@ public class Introspector { * Return null if the MBean is a DynamicMBean, * or if no MBean interface is found. */ - public static Class getMBeanInterface(Class baseClass) { + public static Class getMBeanInterface(Class baseClass) { // Check if the given class implements the MBean interface // or the Dynamic MBean interface if (isDynamic(baseClass)) return null; @@ -286,10 +329,12 @@ public class Introspector { * @throws NotCompliantMBeanException The specified class is * not a JMX compliant Standard MBean. */ - public static Class getStandardMBeanInterface(Class baseClass) - throws NotCompliantMBeanException { - Class current = baseClass; - Class mbeanInterface = null; + public static Class getStandardMBeanInterface(Class baseClass) + throws NotCompliantMBeanException { + if (baseClass.isAnnotationPresent(MBean.class)) + return baseClass; + Class current = baseClass; + Class mbeanInterface = null; while (current != null) { mbeanInterface = findMBeanInterface(current, current.getName()); @@ -316,8 +361,10 @@ public class Introspector { * @throws NotCompliantMBeanException The specified class is * not a JMX compliant MXBean. */ - public static Class getMXBeanInterface(Class baseClass) + public static Class getMXBeanInterface(Class baseClass) throws NotCompliantMBeanException { + if (hasMXBeanAnnotation(baseClass)) + return baseClass; try { return MXBeanSupport.findMXBeanInterface(baseClass); } catch (Exception e) { @@ -325,25 +372,39 @@ public class Introspector { } } + public static Class getStandardOrMXBeanInterface( + Class baseClass, boolean mxbean) + throws NotCompliantMBeanException { + if (mxbean) + return getMXBeanInterface(baseClass); + else + return getStandardMBeanInterface(baseClass); + } + /* * ------------------------------------------ * PRIVATE METHODS * ------------------------------------------ */ + static boolean hasMXBeanAnnotation(Class c) { + MXBean m = c.getAnnotation(MXBean.class); + return (m != null && m.value()); + } /** * Try to find the MBean interface corresponding to the class aName * - i.e. aNameMBean, from within aClass and its superclasses. **/ - private static Class findMBeanInterface(Class aClass, String aName) { - Class current = aClass; + private static Class findMBeanInterface( + Class aClass, String aName) { + Class current = aClass; while (current != null) { - final Class[] interfaces = current.getInterfaces(); + final Class[] interfaces = current.getInterfaces(); final int len = interfaces.length; for (int i=0;i inter = Util.cast(interfaces[i]); + inter = implementsMBean(inter, aName); if (inter != null) return inter; } current = current.getSuperclass(); @@ -351,6 +412,48 @@ public class Introspector { return null; } + public static String descriptionForElement(AnnotatedElement elmt) { + if (elmt == null) + return null; + Description d = elmt.getAnnotation(Description.class); + if (d == null) + return null; + return d.value(); + } + + public static String descriptionForParameter( + Annotation[] parameterAnnotations) { + for (Annotation a : parameterAnnotations) { + if (a instanceof Description) + return ((Description) a).value(); + } + return null; + } + + public static String nameForParameter( + Annotation[] parameterAnnotations) { + for (Annotation a : parameterAnnotations) { + Class ac = a.annotationType(); + // You'd really have to go out of your way to have more than + // one @Name annotation, so we don't check for that. + if (ac.getSimpleName().equals("Name")) { + try { + Method value = ac.getMethod("value"); + if (value.getReturnType() == String.class && + value.getParameterTypes().length == 0) { + return (String) value.invoke(a); + } + } catch (Exception e) { + MBEANSERVER_LOGGER.log( + Level.WARNING, + "Unexpected exception getting @" + ac.getName(), + e); + } + } + } + return null; + } + public static Descriptor descriptorForElement(final AnnotatedElement elmt) { if (elmt == null) return ImmutableDescriptor.EMPTY_DESCRIPTOR; @@ -358,41 +461,18 @@ public class Introspector { return descriptorForAnnotations(annots); } + public static Descriptor descriptorForAnnotation(Annotation annot) { + return descriptorForAnnotations(new Annotation[] {annot}); + } + public static Descriptor descriptorForAnnotations(Annotation[] annots) { if (annots.length == 0) return ImmutableDescriptor.EMPTY_DESCRIPTOR; Map descriptorMap = new HashMap(); for (Annotation a : annots) { - Class c = a.annotationType(); - Method[] elements = c.getMethods(); - for (Method element : elements) { - DescriptorKey key = element.getAnnotation(DescriptorKey.class); - if (key != null) { - String name = key.value(); - Object value; - try { - value = element.invoke(a); - } catch (RuntimeException e) { - // we don't expect this - except for possibly - // security exceptions? - // RuntimeExceptions shouldn't be "UndeclaredThrowable". - // anyway... - // - throw e; - } catch (Exception e) { - // we don't expect this - throw new UndeclaredThrowableException(e); - } - value = annotationToField(value); - Object oldValue = descriptorMap.put(name, value); - if (oldValue != null && !equals(oldValue, value)) { - final String msg = - "Inconsistent values for descriptor field " + name + - " from annotations: " + value + " :: " + oldValue; - throw new IllegalArgumentException(msg); - } - } - } + if (a instanceof DescriptorFields) + addDescriptorFieldsToMap(descriptorMap, (DescriptorFields) a); + addAnnotationFieldsToMap(descriptorMap, a); } if (descriptorMap.isEmpty()) @@ -401,6 +481,62 @@ public class Introspector { return new ImmutableDescriptor(descriptorMap); } + private static void addDescriptorFieldsToMap( + Map descriptorMap, DescriptorFields df) { + for (String field : df.value()) { + int eq = field.indexOf('='); + if (eq < 0) { + throw new IllegalArgumentException( + "@DescriptorFields string must contain '=': " + + field); + } + String name = field.substring(0, eq); + String value = field.substring(eq + 1); + addToMap(descriptorMap, name, value); + } + } + + private static void addAnnotationFieldsToMap( + Map descriptorMap, Annotation a) { + Class c = a.annotationType(); + Method[] elements = c.getMethods(); + for (Method element : elements) { + DescriptorKey key = element.getAnnotation(DescriptorKey.class); + if (key != null) { + String name = key.value(); + Object value; + try { + value = element.invoke(a); + } catch (RuntimeException e) { + // we don't expect this - except for possibly + // security exceptions? + // RuntimeExceptions shouldn't be "UndeclaredThrowable". + // anyway... + throw e; + } catch (Exception e) { + // we don't expect this + throw new UndeclaredThrowableException(e); + } + if (!key.omitIfDefault() || + !equals(value, element.getDefaultValue())) { + value = annotationToField(value); + addToMap(descriptorMap, name, value); + } + } + } + } + + private static void addToMap( + Map descriptorMap, String name, Object value) { + Object oldValue = descriptorMap.put(name, value); + if (oldValue != null && !equals(oldValue, value)) { + final String msg = + "Inconsistent values for descriptor field " + name + + " from annotations: " + value + " :: " + oldValue; + throw new IllegalArgumentException(msg); + } + } + /** * Throws a NotCompliantMBeanException or a SecurityException. * @param notCompliant the class which was under examination @@ -459,8 +595,13 @@ public class Introspector { // The only other possibility is that the value is another // annotation, or that the language has evolved since this code // was written. We don't allow for either of those currently. + // If it is indeed another annotation, then x will be a proxy + // with an unhelpful name like $Proxy2. So we extract the + // proxy's interface to use that in the exception message. + if (Proxy.isProxyClass(c)) + c = c.getInterfaces()[0]; // array "can't be empty" throw new IllegalArgumentException("Illegal type for annotation " + - "element: " + x.getClass().getName()); + "element using @DescriptorKey: " + c.getName()); } // This must be consistent with the check for duplicate field values in @@ -476,15 +617,15 @@ public class Introspector { * @param c The interface to be tested * @param clName The name of the class implementing this interface */ - private static Class implementsMBean(Class c, String clName) { + private static Class implementsMBean(Class c, String clName) { String clMBeanName = clName + "MBean"; if (c.getName().equals(clMBeanName)) { return c; } - Class[] interfaces = c.getInterfaces(); + Class[] interfaces = c.getInterfaces(); for (int i = 0;i < interfaces.length; i++) { if (interfaces[i].getName().equals(clMBeanName)) - return interfaces[i]; + return Util.cast(interfaces[i]); } return null; diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java index 5975f1a391b..e6f7e1f94b0 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanAnalyzer.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -29,13 +29,14 @@ import static com.sun.jmx.mbeanserver.Util.*; import java.lang.reflect.Method; import java.util.Arrays; -import java.util.Collection; import java.util.Comparator; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; - +import javax.management.MBean; +import javax.management.MXBean; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; import javax.management.NotCompliantMBeanException; /** @@ -54,15 +55,15 @@ import javax.management.NotCompliantMBeanException; */ class MBeanAnalyzer { - static interface MBeanVisitor { + static interface MBeanVisitor { public void visitAttribute(String attributeName, M getter, - M setter); + M setter) throws X; public void visitOperation(String operationName, - M operation); + M operation) throws X; } - void visit(MBeanVisitor visitor) { + void visit(MBeanVisitor visitor) throws X { // visit attributes for (Map.Entry> entry : attrMap.entrySet()) { String name = entry.getKey(); @@ -98,21 +99,21 @@ class MBeanAnalyzer { // cached PerInterface object for an MBean interface means that // an analyzer will not be recreated for a second MBean using the // same interface. - static MBeanAnalyzer analyzer(Class mbeanInterface, + static MBeanAnalyzer analyzer(Class mbeanType, MBeanIntrospector introspector) throws NotCompliantMBeanException { - return new MBeanAnalyzer(mbeanInterface, introspector); + return new MBeanAnalyzer(mbeanType, introspector); } - private MBeanAnalyzer(Class mbeanInterface, + private MBeanAnalyzer(Class mbeanType, MBeanIntrospector introspector) throws NotCompliantMBeanException { - introspector.checkCompliance(mbeanInterface); + introspector.checkCompliance(mbeanType); try { - initMaps(mbeanInterface, introspector); + initMaps(mbeanType, introspector); } catch (Exception x) { - throw Introspector.throwException(mbeanInterface,x); + throw Introspector.throwException(mbeanType,x); } } @@ -126,19 +127,28 @@ class MBeanAnalyzer { /* Run through the methods to detect inconsistencies and to enable us to give getter and setter together to visitAttribute. */ for (Method m : methods) { - String name = m.getName(); + final String name = m.getName(); + final int nParams = m.getParameterTypes().length; + final boolean managedOp = m.isAnnotationPresent(ManagedOperation.class); + final boolean managedAttr = m.isAnnotationPresent(ManagedAttribute.class); + if (managedOp && managedAttr) { + throw new NotCompliantMBeanException("Method " + name + + " has both @ManagedOperation and @ManagedAttribute"); + } final M cm = introspector.mFrom(m); String attrName = ""; - if (name.startsWith("get")) - attrName = name.substring(3); - else if (name.startsWith("is") - && m.getReturnType() == boolean.class) - attrName = name.substring(2); + if (!managedOp) { + if (name.startsWith("get")) + attrName = name.substring(3); + else if (name.startsWith("is") + && m.getReturnType() == boolean.class) + attrName = name.substring(2); + } - if (attrName.length() != 0 && m.getParameterTypes().length == 0 - && m.getReturnType() != void.class) { + if (attrName.length() != 0 && nParams == 0 + && m.getReturnType() != void.class && !managedOp) { // It's a getter // Check we don't have both isX and getX AttrMethods am = attrMap.get(attrName); @@ -154,8 +164,8 @@ class MBeanAnalyzer { am.getter = cm; attrMap.put(attrName, am); } else if (name.startsWith("set") && name.length() > 3 - && m.getParameterTypes().length == 1 && - m.getReturnType() == void.class) { + && nParams == 1 && + m.getReturnType() == void.class && !managedOp) { // It's a setter attrName = name.substring(3); AttrMethods am = attrMap.get(attrName); @@ -168,6 +178,9 @@ class MBeanAnalyzer { } am.setter = cm; attrMap.put(attrName, am); + } else if (managedAttr) { + throw new NotCompliantMBeanException("Method " + name + + " has @ManagedAttribute but is not a valid getter or setter"); } else { // It's an operation List cms = opMap.get(name); @@ -228,7 +241,11 @@ class MBeanAnalyzer { but only the overriding one is of interest. We return the methods in the same order they arrived in. This isn't required by the spec but existing code may depend on it and users may be used to seeing - operations or attributes appear in a particular order. */ + operations or attributes appear in a particular order. + + Because of the way this method works, if the same Method appears + more than once in the given List then it will be completely deleted! + So don't do that. */ static List eliminateCovariantMethods(List startMethods) { // We are assuming that you never have very many methods with the @@ -243,7 +260,7 @@ class MBeanAnalyzer { final Method m0 = sorted[i-1]; final Method m1 = sorted[i]; - // Methods that don't have the same name can't override each others + // Methods that don't have the same name can't override each other if (!m0.getName().equals(m1.getName())) continue; // Methods that have the same name and same signature override @@ -251,7 +268,8 @@ class MBeanAnalyzer { // due to the way we have sorted them in MethodOrder. if (Arrays.equals(m0.getParameterTypes(), m1.getParameterTypes())) { - overridden.add(m0); + if (!overridden.add(m0)) + throw new RuntimeException("Internal error: duplicate Method"); } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInjector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInjector.java new file mode 100644 index 00000000000..4831134f6af --- /dev/null +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInjector.java @@ -0,0 +1,291 @@ +/* + * 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 com.sun.jmx.mbeanserver; + +import java.lang.ref.WeakReference; +import java.security.PrivilegedAction; +import java.util.Map; +import java.util.WeakHashMap; +import javax.annotation.Resource; +import javax.management.MBeanServer; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; + +import static com.sun.jmx.mbeanserver.Util.newMap; +import java.lang.reflect.AccessibleObject; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.security.AccessController; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.management.SendNotification; + +public class MBeanInjector { + private static Class[] injectedClasses = { + MBeanServer.class, ObjectName.class, SendNotification.class, + }; + + public static void inject(Object mbean, MBeanServer mbs, ObjectName name) + throws Exception { + ClassInjector injector = injectorForClass(mbean.getClass()); + injector.inject(mbean, MBeanServer.class, mbs); + injector.inject(mbean, ObjectName.class, name); + } + + public static boolean injectsSendNotification(Object mbean) + throws NotCompliantMBeanException { + ClassInjector injector = injectorForClass(mbean.getClass()); + return injector.injects(SendNotification.class); + } + + public static void injectSendNotification(Object mbean, SendNotification sn) + throws Exception { + ClassInjector injector = injectorForClass(mbean.getClass()); + injector.inject(mbean, SendNotification.class, sn); + } + + public static void validate(Class c) throws NotCompliantMBeanException { + injectorForClass(c); + } + + private static class ClassInjector { + private Map, List> fields; + private Map, List> methods; + + ClassInjector(Class c) throws NotCompliantMBeanException { + fields = newMap(); + methods = newMap(); + + Class sup = c.getSuperclass(); + ClassInjector supInjector; + if (sup == null) { + supInjector = null; + } else { + supInjector = injectorForClass(sup); + fields.putAll(supInjector.fields); + methods.putAll(supInjector.methods); + } + + addMembers(c); + eliminateOverriddenMethods(); + + // If we haven't added any new fields or methods to what we + // inherited, then we can share the parent's maps. + if (supInjector != null) { + if (fields.equals(supInjector.fields)) + fields = supInjector.fields; + if (methods.equals(supInjector.methods)) + methods = supInjector.methods; + } + } + + boolean injects(Class c) { + return (fields.get(c) != null || methods.get(c) != null); + } + + void inject(Object instance, Class type, T resource) + throws Exception { + List fs = fields.get(type); + if (fs != null) { + for (Field f : fs) + f.set(instance, resource); + } + List ms = methods.get(type); + if (ms != null) { + for (Method m : ms) { + try { + m.invoke(instance, resource); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof Error) + throw (Error) cause; + else + throw (Exception) cause; + } + } + } + } + + private void eliminateOverriddenMethods() { + /* Covariant overriding is unlikely, but it is possible that the + * parent has a @Resource method that we override with another + * @Resource method. We don't want to invoke both methods, + * because polymorphism means we would actually invoke the same + * method twice. + */ + for (Map.Entry, List> entry : methods.entrySet()) { + List list = entry.getValue(); + list = MBeanAnalyzer.eliminateCovariantMethods(list); + entry.setValue(list); + } + } + + /* + * Find Fields or Methods within the given Class that we can inject + * resource references into. Suppose we want to know if a Field can get + * a reference to an ObjectName. We'll accept fields like this: + * + * @Resource + * private transient ObjectName name; + * + * or like this: + * + * @Resource(type = ObjectName.class) + * private transient Object name; + * + * but not like this: + * + * @Resource + * private transient Object name; + * + * (Plain @Resource is equivalent to @Resource(type = Object.class).) + * + * We don't want to inject into everything that might possibly accept + * an ObjectName reference, because examples like the last one above + * could also accept an MBeanServer reference or any other sort of + * reference. + * + * So we accept a Field if it has a @Resource annotation and either + * (a) its type is ObjectName or a subclass and its @Resource type is + * compatible with ObjectName (e.g. it is Object); or + * (b) its type is compatible with ObjectName and its @Resource type + * is exactly ObjectName. Fields that meet these criteria will not + * meet the same criteria with respect to other types such as MBeanServer. + * + * The same logic applies mutatis mutandis to Methods such as this: + * + * @Resource + * private void setObjectName1(ObjectName name) + * @Resource(type = Object.class) + * private void setObjectName2(Object name) + */ + private void addMembers(final Class c) + throws NotCompliantMBeanException { + AccessibleObject[][] memberArrays = + AccessController.doPrivileged( + new PrivilegedAction() { + public AccessibleObject[][] run() { + return new AccessibleObject[][] { + c.getDeclaredFields(), c.getDeclaredMethods() + }; + } + }); + for (AccessibleObject[] members : memberArrays) { + for (final AccessibleObject member : members) { + Resource res = member.getAnnotation(Resource.class); + if (res == null) + continue; + + final Field field; + final Method method; + final Class memberType; + final int modifiers; + if (member instanceof Field) { + field = (Field) member; + memberType = field.getType(); + modifiers = field.getModifiers(); + method = null; + } else { + field = null; + method = (Method) member; + Class[] paramTypes = method.getParameterTypes(); + if (paramTypes.length != 1) { + throw new NotCompliantMBeanException( + "@Resource method must have exactly 1 " + + "parameter: " + method); + } + if (method.getReturnType() != void.class) { + throw new NotCompliantMBeanException( + "@Resource method must return void: " + + method); + } + memberType = paramTypes[0]; + modifiers = method.getModifiers(); + } + + if (Modifier.isStatic(modifiers)) { + throw new NotCompliantMBeanException( + "@Resource method or field cannot be static: " + + member); + } + + for (Class injectedClass : injectedClasses) { + Class[] types = {memberType, res.type()}; + boolean accept = false; + for (int i = 0; i < 2; i++) { + if (types[i] == injectedClass && + types[1 - i].isAssignableFrom(injectedClass)) { + accept = true; + break; + } + } + if (accept) { + AccessController.doPrivileged(new PrivilegedAction() { + public Void run() { + member.setAccessible(true); + return null; + } + }); + addToMap(fields, injectedClass, field); + addToMap(methods, injectedClass, method); + } + } + } + } + } + + private static void addToMap(Map> map, K key, V value) { + if (value == null) + return; + List list = map.get(key); + if (list == null) + list = Collections.singletonList(value); + else { + if (list.size() == 1) + list = new ArrayList(list); + list.add(value); + } + map.put(key, list); + } + } + + private static synchronized ClassInjector injectorForClass(Class c) + throws NotCompliantMBeanException { + WeakReference wr = injectorMap.get(c); + ClassInjector ci = (wr == null) ? null : wr.get(); + if (ci == null) { + ci = new ClassInjector(c); + injectorMap.put(c, new WeakReference(ci)); + } + return ci; + } + + private static Map, WeakReference> injectorMap = + new WeakHashMap, WeakReference>(); +} diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java index 777383a1220..019793b8d85 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java index ea7dbdade33..725292bca36 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanIntrospector.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -36,25 +36,35 @@ import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.WeakHashMap; +import javax.management.Description; import javax.management.Descriptor; import javax.management.ImmutableDescriptor; +import javax.management.IntrospectionException; import javax.management.InvalidAttributeValueException; +import javax.management.MBean; import javax.management.MBeanAttributeInfo; import javax.management.MBeanConstructorInfo; import javax.management.MBeanException; import javax.management.MBeanInfo; import javax.management.MBeanNotificationInfo; import javax.management.MBeanOperationInfo; +import javax.management.MXBean; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; import javax.management.NotCompliantMBeanException; import javax.management.NotificationBroadcaster; +import javax.management.NotificationInfo; +import javax.management.NotificationInfos; import javax.management.ReflectionException; /** * An introspector for MBeans of a certain type. There is one instance - * of this class for Standard MBeans and one for MXBeans, characterized - * by the two concrete subclasses of this abstract class. + * of this class for Standard MBeans, and one for every MXBeanMappingFactory; + * these two cases correspond to the two concrete subclasses of this abstract + * class. * * @param the representation of methods for this kind of MBean: * Method for Standard MBeans, ConvertingMethod for MXBeans. @@ -119,7 +129,7 @@ abstract class MBeanIntrospector { * MXBean interface is not valid if one of its parameters cannot be * mapped to an Open Type. */ - abstract void checkMethod(M m) throws IllegalArgumentException; + abstract void checkMethod(M m); /** * Invoke the method with the given target and arguments. @@ -149,7 +159,27 @@ abstract class MBeanIntrospector { * may be null. */ abstract MBeanAttributeInfo getMBeanAttributeInfo(String attributeName, - M getter, M setter); + M getter, M setter) throws IntrospectionException; + + final String getAttributeDescription( + String attributeName, String defaultDescription, + Method getter, Method setter) throws IntrospectionException { + String g = Introspector.descriptionForElement(getter); + String s = Introspector.descriptionForElement(setter); + if (g == null) { + if (s == null) + return defaultDescription; + else + return s; + } else if (s == null || g.equals(s)) { + return g; + } else { + throw new IntrospectionException( + "Inconsistent @Description on getter and setter for " + + "attribute " + attributeName); + } + } + /** * Construct an MBeanOperationInfo for the given operation based on * the M it was derived from. @@ -170,9 +200,23 @@ abstract class MBeanIntrospector { */ abstract Descriptor getMBeanDescriptor(Class resourceClass); + /** + * Get any additional Descriptor entries for this introspector instance. + * If there is a non-default MXBeanMappingFactory, it will appear in + * this Descriptor. + * @return Additional Descriptor entries, or an empty Descriptor if none. + */ + Descriptor getSpecificMBeanDescriptor() { + return ImmutableDescriptor.EMPTY_DESCRIPTOR; + } + void checkCompliance(Class mbeanType) throws NotCompliantMBeanException { - if (!mbeanType.isInterface()) { - throw new NotCompliantMBeanException("Not an interface: " + + if (!mbeanType.isInterface() && + !mbeanType.isAnnotationPresent(MBean.class) && + !Introspector.hasMXBeanAnnotation(mbeanType)) { + throw new NotCompliantMBeanException("Not an interface and " + + "does not have @" + MBean.class.getSimpleName() + + " or @" + MXBean.class.getSimpleName() + " annotation: " + mbeanType.getName()); } } @@ -181,7 +225,12 @@ abstract class MBeanIntrospector { * Get the methods to be analyzed to build the MBean interface. */ List getMethods(final Class mbeanType) throws Exception { - return Arrays.asList(mbeanType.getMethods()); + if (mbeanType.isInterface()) + return Arrays.asList(mbeanType.getMethods()); + + final List methods = newList(); + getAnnotatedMethods(mbeanType, methods); + return methods; } final PerInterface getPerInterface(Class mbeanInterface) @@ -216,11 +265,14 @@ abstract class MBeanIntrospector { * the MBeanInfo's Descriptor. */ private MBeanInfo makeInterfaceMBeanInfo(Class mbeanInterface, - MBeanAnalyzer analyzer) { + MBeanAnalyzer analyzer) throws IntrospectionException { final MBeanInfoMaker maker = new MBeanInfoMaker(); analyzer.visit(maker); - final String description = + final String defaultDescription = "Information on the management interface of the MBean"; + String description = Introspector.descriptionForElement(mbeanInterface); + if (description == null) + description = defaultDescription; return maker.makeMBeanInfo(mbeanInterface, description); } @@ -317,11 +369,12 @@ abstract class MBeanIntrospector { } /** A visitor that constructs the per-interface MBeanInfo. */ - private class MBeanInfoMaker implements MBeanAnalyzer.MBeanVisitor { + private class MBeanInfoMaker + implements MBeanAnalyzer.MBeanVisitor { public void visitAttribute(String attributeName, M getter, - M setter) { + M setter) throws IntrospectionException { MBeanAttributeInfo mbai = getMBeanAttributeInfo(attributeName, getter, setter); @@ -346,13 +399,14 @@ abstract class MBeanIntrospector { ops.toArray(new MBeanOperationInfo[0]); final String interfaceClassName = "interfaceClassName=" + mbeanInterface.getName(); - final Descriptor interfDescriptor = + final Descriptor classNameDescriptor = new ImmutableDescriptor(interfaceClassName); final Descriptor mbeanDescriptor = getBasicMBeanDescriptor(); final Descriptor annotatedDescriptor = Introspector.descriptorForElement(mbeanInterface); final Descriptor descriptor = - DescriptorCache.getInstance().union(interfDescriptor, + DescriptorCache.getInstance().union( + classNameDescriptor, mbeanDescriptor, annotatedDescriptor); @@ -388,20 +442,32 @@ abstract class MBeanIntrospector { * Return the MBeanInfo for the given resource, based on the given * per-interface data. */ - final MBeanInfo getMBeanInfo(Object resource, PerInterface perInterface) { + final MBeanInfo getMBeanInfo(Object resource, PerInterface perInterface) + throws NotCompliantMBeanException { MBeanInfo mbi = getClassMBeanInfo(resource.getClass(), perInterface); - MBeanNotificationInfo[] notifs = findNotifications(resource); - if (notifs == null || notifs.length == 0) + MBeanNotificationInfo[] notifs; + try { + notifs = findNotifications(resource); + } catch (RuntimeException e) { + NotCompliantMBeanException x = + new NotCompliantMBeanException(e.getMessage()); + x.initCause(e); + throw x; + } + Descriptor d = getSpecificMBeanDescriptor(); + boolean anyNotifs = (notifs != null && notifs.length > 0); + if (!anyNotifs && ImmutableDescriptor.EMPTY_DESCRIPTOR.equals(d)) return mbi; else { + d = ImmutableDescriptor.union(d, mbi.getDescriptor()); return new MBeanInfo(mbi.getClassName(), mbi.getDescription(), mbi.getAttributes(), mbi.getConstructors(), mbi.getOperations(), notifs, - mbi.getDescriptor()); + d); } } @@ -441,13 +507,43 @@ abstract class MBeanIntrospector { } } + /* + * Add to "methods" every public method that has the @ManagedAttribute + * or @ManagedOperation annotation, in the given class or any of + * its superclasses or superinterfaces. + * + * We always add superclass or superinterface methods first, so that + * the stable sort used by eliminateCovariantMethods will put the + * method from the most-derived class last. This means that we will + * see the version of the @ManagedAttribute (or ...Operation) annotation + * from that method, which might have a different description or whatever. + */ + private static void getAnnotatedMethods(Class c, List methods) + throws Exception { + Class sup = c.getSuperclass(); + if (sup != null) + getAnnotatedMethods(sup, methods); + Class[] intfs = c.getInterfaces(); + for (Class intf : intfs) + getAnnotatedMethods(intf, methods); + for (Method m : c.getMethods()) { + // We are careful not to add m if it is inherited from a parent + // class or interface, because duplicate methods lead to nasty + // behaviour in eliminateCovariantMethods. + if (m.getDeclaringClass() == c && + (m.isAnnotationPresent(ManagedAttribute.class) || + m.isAnnotationPresent(ManagedOperation.class))) + methods.add(m); + } + } + static MBeanNotificationInfo[] findNotifications(Object moi) { if (!(moi instanceof NotificationBroadcaster)) return null; MBeanNotificationInfo[] mbn = ((NotificationBroadcaster) moi).getNotificationInfo(); - if (mbn == null) - return null; + if (mbn == null || mbn.length == 0) + return findNotificationsFromAnnotations(moi.getClass()); MBeanNotificationInfo[] result = new MBeanNotificationInfo[mbn.length]; for (int i = 0; i < mbn.length; i++) { @@ -459,11 +555,81 @@ abstract class MBeanIntrospector { return result; } + private static MBeanNotificationInfo[] findNotificationsFromAnnotations( + Class mbeanClass) { + Class c = getAnnotatedNotificationInfoClass(mbeanClass); + if (c == null) + return null; + NotificationInfo ni = c.getAnnotation(NotificationInfo.class); + NotificationInfos nis = c.getAnnotation(NotificationInfos.class); + List list = newList(); + if (ni != null) + list.add(ni); + if (nis != null) + list.addAll(Arrays.asList(nis.value())); + if (list.isEmpty()) + return null; + List mbnis = newList(); + for (NotificationInfo x : list) { + // The Descriptor includes any fields explicitly specified by + // x.descriptorFields(), plus any fields from the contained + // @Description annotation. + Descriptor d = new ImmutableDescriptor(x.descriptorFields()); + d = ImmutableDescriptor.union( + d, Introspector.descriptorForAnnotation(x.description())); + MBeanNotificationInfo mbni = new MBeanNotificationInfo( + x.types(), x.notificationClass().getName(), + x.description().value(), d); + mbnis.add(mbni); + } + return mbnis.toArray(new MBeanNotificationInfo[mbnis.size()]); + } + + private static final Map, WeakReference>> + annotatedNotificationInfoClasses = newWeakHashMap(); + + private static Class getAnnotatedNotificationInfoClass(Class baseClass) { + synchronized (annotatedNotificationInfoClasses) { + WeakReference> wr = + annotatedNotificationInfoClasses.get(baseClass); + if (wr != null) + return wr.get(); + Class c = null; + if (baseClass.isAnnotationPresent(NotificationInfo.class) || + baseClass.isAnnotationPresent(NotificationInfos.class)) { + c = baseClass; + } else { + Class[] intfs = baseClass.getInterfaces(); + for (Class intf : intfs) { + Class c1 = getAnnotatedNotificationInfoClass(intf); + if (c1 != null) { + if (c != null) { + throw new IllegalArgumentException( + "Class " + baseClass.getName() + " inherits " + + "@NotificationInfo(s) from both " + + c.getName() + " and " + c1.getName()); + } + c = c1; + } + } + } + // Record the result of the search. If no @NotificationInfo(s) + // were found, c is null, and we store a WeakReference(null). + // This prevents us from having to search again and fail again. + annotatedNotificationInfoClasses.put(baseClass, + new WeakReference>(c)); + return c; + } + } + private static MBeanConstructorInfo[] findConstructors(Class c) { Constructor[] cons = c.getConstructors(); MBeanConstructorInfo[] mbc = new MBeanConstructorInfo[cons.length]; for (int i = 0; i < cons.length; i++) { - final String descr = "Public constructor of the MBean"; + String descr = "Public constructor of the MBean"; + Description d = cons[i].getAnnotation(Description.class); + if (d != null) + descr = d.value(); mbc[i] = new MBeanConstructorInfo(descr, cons[i]); } return mbc; diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanSupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanSupport.java index 187ca503d5e..d4f3123fbc5 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -38,6 +38,7 @@ import javax.management.MBeanServer; import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; import javax.management.ReflectionException; +import javax.management.openmbean.MXBeanMappingFactory; /** * Base class for MBeans. There is one instance of this class for @@ -121,24 +122,26 @@ import javax.management.ReflectionException; public abstract class MBeanSupport implements DynamicMBean2, MBeanRegistration { - MBeanSupport(T resource, Class mbeanInterface) + MBeanSupport(T resource, Class mbeanInterfaceType, + MXBeanMappingFactory mappingFactory) throws NotCompliantMBeanException { - if (mbeanInterface == null) + if (mbeanInterfaceType == null) throw new NotCompliantMBeanException("Null MBean interface"); - if (!mbeanInterface.isInstance(resource)) { + if (!mbeanInterfaceType.isInstance(resource)) { final String msg = "Resource class " + resource.getClass().getName() + - " is not an instance of " + mbeanInterface.getName(); + " is not an instance of " + mbeanInterfaceType.getName(); throw new NotCompliantMBeanException(msg); } this.resource = resource; - MBeanIntrospector introspector = getMBeanIntrospector(); - this.perInterface = introspector.getPerInterface(mbeanInterface); + MBeanIntrospector introspector = getMBeanIntrospector(mappingFactory); + this.perInterface = introspector.getPerInterface(mbeanInterfaceType); this.mbeanInfo = introspector.getMBeanInfo(resource, perInterface); } /** Return the appropriate introspector for this type of MBean. */ - abstract MBeanIntrospector getMBeanIntrospector(); + abstract MBeanIntrospector + getMBeanIntrospector(MXBeanMappingFactory mappingFactory); /** * Return a cookie for this MBean. This cookie will be passed to @@ -162,9 +165,8 @@ public abstract class MBeanSupport public final ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { if (resource instanceof MBeanRegistration) - return ((MBeanRegistration) resource).preRegister(server, name); - else - return name; + name = ((MBeanRegistration) resource).preRegister(server, name); + return name; } public final void preRegister2(MBeanServer server, ObjectName name) @@ -261,10 +263,14 @@ public abstract class MBeanSupport return resource.getClass().getName(); } - public final Object getResource() { + public final Object getWrappedObject() { return resource; } + public final ClassLoader getWrappedClassLoader() { + return resource.getClass().getClassLoader(); + } + public final Class getMBeanInterface() { return perInterface.getMBeanInterface(); } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanIntrospector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanIntrospector.java index e93961a4ae9..8ff0a902dff 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanIntrospector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanIntrospector.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -25,18 +25,28 @@ package com.sun.jmx.mbeanserver; +import com.sun.jmx.mbeanserver.MBeanIntrospector.MBeanInfoMap; +import com.sun.jmx.mbeanserver.MBeanIntrospector.PerInterfaceMap; import java.lang.annotation.Annotation; +import java.lang.ref.WeakReference; import java.lang.reflect.GenericArrayType; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; +import java.util.Map; +import java.util.WeakHashMap; +import javax.management.Description; import javax.management.Descriptor; import javax.management.ImmutableDescriptor; +import javax.management.IntrospectionException; +import javax.management.JMX; import javax.management.MBeanAttributeInfo; import javax.management.MBeanException; import javax.management.MBeanOperationInfo; import javax.management.MBeanParameterInfo; +import javax.management.ManagedOperation; import javax.management.NotCompliantMBeanException; +import javax.management.openmbean.MXBeanMappingFactory; import javax.management.openmbean.OpenMBeanAttributeInfoSupport; import javax.management.openmbean.OpenMBeanOperationInfoSupport; import javax.management.openmbean.OpenMBeanParameterInfo; @@ -49,10 +59,36 @@ import javax.management.openmbean.OpenType; * @since 1.6 */ class MXBeanIntrospector extends MBeanIntrospector { - private static final MXBeanIntrospector instance = new MXBeanIntrospector(); + /* We keep one MXBeanIntrospector per MXBeanMappingFactory, since the results + * of the introspection depend on the factory. The MXBeanIntrospector + * has a reference back to the factory, so we wrap it in a WeakReference. + * It will be strongly referenced by any MXBeanSupport instances using it; + * if there are none then it is OK to gc it. + */ + private static final + Map> map = + new WeakHashMap>(); - static MXBeanIntrospector getInstance() { - return instance; + static MXBeanIntrospector getInstance(MXBeanMappingFactory factory) { + if (factory == null) + factory = MXBeanMappingFactory.DEFAULT; + synchronized (map) { + MXBeanIntrospector intro; + WeakReference wr = map.get(factory); + if (wr != null) { + intro = wr.get(); + if (intro != null) + return intro; + } + intro = new MXBeanIntrospector(factory); + wr = new WeakReference(intro); + map.put(factory, wr); + return intro; + } + } + + private MXBeanIntrospector(MXBeanMappingFactory factory) { + this.mappingFactory = factory; } @Override @@ -78,7 +114,7 @@ class MXBeanIntrospector extends MBeanIntrospector { @Override ConvertingMethod mFrom(Method m) { - return ConvertingMethod.from(m); + return ConvertingMethod.from(m, mappingFactory); } @Override @@ -139,13 +175,17 @@ class MXBeanIntrospector extends MBeanIntrospector { @Override MBeanAttributeInfo getMBeanAttributeInfo(String attributeName, - ConvertingMethod getter, ConvertingMethod setter) { + ConvertingMethod getter, ConvertingMethod setter) + throws IntrospectionException { final boolean isReadable = (getter != null); final boolean isWritable = (setter != null); final boolean isIs = isReadable && getName(getter).startsWith("is"); - final String description = attributeName; + final String description = getAttributeDescription( + attributeName, attributeName, + getter == null ? null : getter.getMethod(), + setter == null ? null : setter.getMethod()); final OpenType openType; final Type originalType; @@ -194,13 +234,17 @@ class MXBeanIntrospector extends MBeanIntrospector { MBeanOperationInfo getMBeanOperationInfo(String operationName, ConvertingMethod operation) { final Method method = operation.getMethod(); - final String description = operationName; + String description = operationName; /* Ideally this would be an empty string, but - OMBOperationInfo constructor forbids that. Also, we - could consult an annotation to get a useful - description. */ + OMBOperationInfo constructor forbids that. */ + Description d = method.getAnnotation(Description.class); + if (d != null) + description = d.value(); - final int impact = MBeanOperationInfo.UNKNOWN; + int impact = MBeanOperationInfo.UNKNOWN; + ManagedOperation annot = method.getAnnotation(ManagedOperation.class); + if (annot != null) + impact = annot.impact().getCode(); final OpenType returnType = operation.getOpenReturnType(); final Type originalReturnType = operation.getGenericReturnType(); @@ -212,8 +256,15 @@ class MXBeanIntrospector extends MBeanIntrospector { boolean openParameterTypes = true; Annotation[][] annots = method.getParameterAnnotations(); for (int i = 0; i < paramTypes.length; i++) { - final String paramName = "p" + i; - final String paramDescription = paramName; + String paramName = Introspector.nameForParameter(annots[i]); + if (paramName == null) + paramName = "p" + i; + + String paramDescription = + Introspector.descriptionForParameter(annots[i]); + if (paramDescription == null) + paramDescription = paramName; + final OpenType openType = paramTypes[i]; final Type originalType = originalParamTypes[i]; Descriptor descriptor = @@ -222,14 +273,14 @@ class MXBeanIntrospector extends MBeanIntrospector { Introspector.descriptorForAnnotations(annots[i])); final MBeanParameterInfo pi; if (canUseOpenInfo(originalType)) { - pi = new OpenMBeanParameterInfoSupport("p" + i, + pi = new OpenMBeanParameterInfoSupport(paramName, paramDescription, openType, descriptor); } else { openParameterTypes = false; pi = new MBeanParameterInfo( - "p" + i, + paramName, originalTypeString(originalType), paramDescription, descriptor); @@ -291,6 +342,17 @@ class MXBeanIntrospector extends MBeanIntrospector { return ImmutableDescriptor.EMPTY_DESCRIPTOR; } + @Override + Descriptor getSpecificMBeanDescriptor() { + if (mappingFactory == MXBeanMappingFactory.DEFAULT) + return ImmutableDescriptor.EMPTY_DESCRIPTOR; + else { + return new ImmutableDescriptor( + JMX.MXBEAN_MAPPING_FACTORY_CLASS_FIELD + "=" + + mappingFactory.getClass().getName()); + } + } + private static Descriptor typeDescriptor(OpenType openType, Type originalType) { return new ImmutableDescriptor( @@ -331,8 +393,10 @@ class MXBeanIntrospector extends MBeanIntrospector { return type.toString(); } - private static final PerInterfaceMap + private final PerInterfaceMap perInterfaceMap = new PerInterfaceMap(); - private static final MBeanInfoMap mbeanInfoMap = new MBeanInfoMap(); + private final MBeanInfoMap mbeanInfoMap = new MBeanInfoMap(); + + private final MXBeanMappingFactory mappingFactory; } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java index ef712eaafd8..41b3b989160 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanLookup.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -25,15 +25,21 @@ package com.sun.jmx.mbeanserver; +import com.sun.jmx.remote.util.EnvHelp; +import java.io.InvalidObjectException; import static com.sun.jmx.mbeanserver.Util.*; import java.util.Map; import java.lang.ref.WeakReference; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; +import java.security.AccessController; +import javax.management.InstanceAlreadyExistsException; import javax.management.JMX; import javax.management.MBeanServerConnection; import javax.management.MBeanServerInvocationHandler; +import javax.management.MalformedObjectNameException; import javax.management.ObjectName; +import javax.management.openmbean.OpenDataException; /** * @since 1.6 @@ -80,71 +86,199 @@ import javax.management.ObjectName; * * From the above, it is clear that the logic for getX on an MXBean is * the same as for setX on a proxy, and vice versa. + * + * The above describes the logic for "plain" MXBeanLookup, represented + * by MXBeanLookup.Plain. When namespaces enter the picture, we see + * MXBeanLookup.Prefix. Here, the idea is that the name of the ModuleMXBean + * might be a//m:m=m. In this case, we don't accept a reference to + * an MXBean object, since that would require different namespaces to know + * each others' objects. We only accept proxies. Suppose you have a proxy + * for a//m:m=m, call it moduleProxy, and you call + * moduleProxy.setProduct(productProxy). Then if productProxy is for + * a//p:p=p we should convert this to just p:p=p. If productProxy is for + * a//b//p:p=p we should convert it to b//p:p=p. Conversely, if getProduct + * returns an ObjectName like b//p:p=p then we should convert it into a proxy + * for a//b//p:p=p. */ -public class MXBeanLookup { +public abstract class MXBeanLookup { private MXBeanLookup(MBeanServerConnection mbsc) { this.mbsc = mbsc; } - static MXBeanLookup lookupFor(MBeanServerConnection mbsc) { - synchronized (mbscToLookup) { - WeakReference weakLookup = mbscToLookup.get(mbsc); - MXBeanLookup lookup = (weakLookup == null) ? null : weakLookup.get(); - if (lookup == null) { - lookup = new MXBeanLookup(mbsc); - mbscToLookup.put(mbsc, new WeakReference(lookup)); + static MXBeanLookup lookupFor(MBeanServerConnection mbsc, String prefix) { + if (prefix == null) + return Plain.lookupFor(mbsc); + else + return new Prefix(mbsc, prefix); + } + + abstract T objectNameToMXBean(ObjectName name, Class type) + throws InvalidObjectException; + + abstract ObjectName mxbeanToObjectName(Object mxbean) + throws OpenDataException; + + static class Plain extends MXBeanLookup { + Plain(MBeanServerConnection mbsc) { + super(mbsc); + } + + static Plain lookupFor(MBeanServerConnection mbsc) { + synchronized (mbscToLookup) { + WeakReference weakLookup = mbscToLookup.get(mbsc); + Plain lookup = (weakLookup == null) ? null : weakLookup.get(); + if (lookup == null) { + lookup = new Plain(mbsc); + mbscToLookup.put(mbsc, new WeakReference(lookup)); + } + return lookup; } - return lookup; + } + + @Override + synchronized T objectNameToMXBean(ObjectName name, Class type) { + WeakReference wr = objectNameToProxy.get(name); + if (wr != null) { + Object proxy = wr.get(); + if (type.isInstance(proxy)) + return type.cast(proxy); + } + T proxy = JMX.newMXBeanProxy(mbsc, name, type); + objectNameToProxy.put(name, new WeakReference(proxy)); + return proxy; + } + + @Override + synchronized ObjectName mxbeanToObjectName(Object mxbean) + throws OpenDataException { + String wrong; + if (mxbean instanceof Proxy) { + InvocationHandler ih = Proxy.getInvocationHandler(mxbean); + if (ih instanceof MBeanServerInvocationHandler) { + MBeanServerInvocationHandler mbsih = + (MBeanServerInvocationHandler) ih; + if (mbsih.getMBeanServerConnection().equals(mbsc)) + return mbsih.getObjectName(); + else + wrong = "proxy for a different MBeanServer"; + } else + wrong = "not a JMX proxy"; + } else { + ObjectName name = mxbeanToObjectName.get(mxbean); + if (name != null) + return name; + wrong = "not an MXBean registered in this MBeanServer"; + } + String s = (mxbean == null) ? + "null" : "object of type " + mxbean.getClass().getName(); + throw new OpenDataException( + "Could not convert " + s + " to an ObjectName: " + wrong); + // Message will be strange if mxbean is null but it is not + // supposed to be. + } + + synchronized void addReference(ObjectName name, Object mxbean) + throws InstanceAlreadyExistsException { + ObjectName existing = mxbeanToObjectName.get(mxbean); + if (existing != null) { + String multiname = AccessController.doPrivileged( + new GetPropertyAction("jmx.mxbean.multiname")); + if (!"true".equalsIgnoreCase(multiname)) { + throw new InstanceAlreadyExistsException( + "MXBean already registered with name " + existing); + } + } + mxbeanToObjectName.put(mxbean, name); + } + + synchronized boolean removeReference(ObjectName name, Object mxbean) { + if (name.equals(mxbeanToObjectName.get(mxbean))) { + mxbeanToObjectName.remove(mxbean); + return true; + } else + return false; + /* removeReference can be called when the above condition fails, + * notably if you try to register the same MXBean twice. + */ + } + + private final WeakIdentityHashMap + mxbeanToObjectName = WeakIdentityHashMap.make(); + private final Map> + objectNameToProxy = newMap(); + private static WeakIdentityHashMap> + mbscToLookup = WeakIdentityHashMap.make(); + } + + private static class Prefix extends MXBeanLookup { + private final String prefix; + + Prefix(MBeanServerConnection mbsc, String prefix) { + super(mbsc); + this.prefix = prefix; + } + + @Override + T objectNameToMXBean(ObjectName name, Class type) + throws InvalidObjectException { + String domain = prefix + name.getDomain(); + try { + name = switchDomain(domain, name); + } catch (MalformedObjectNameException e) { + throw EnvHelp.initCause( + new InvalidObjectException(e.getMessage()), e); + } + return JMX.newMXBeanProxy(mbsc, name, type); + } + + @Override + ObjectName mxbeanToObjectName(Object mxbean) + throws OpenDataException { + ObjectName name = proxyToObjectName(mxbean); + String domain = name.getDomain(); + if (!domain.startsWith(prefix)) { + throw new OpenDataException( + "Proxy's name does not start with " + prefix + ": " + name); + } + try { + name = switchDomain(domain.substring(prefix.length()), name); + } catch (MalformedObjectNameException e) { + throw EnvHelp.initCause(new OpenDataException(e.getMessage()), e); + } + return name; } } - synchronized T objectNameToMXBean(ObjectName name, Class type) { - WeakReference wr = objectNameToProxy.get(name); - if (wr != null) { - Object proxy = wr.get(); - if (type.isInstance(proxy)) - return type.cast(proxy); + ObjectName proxyToObjectName(Object proxy) { + InvocationHandler ih = Proxy.getInvocationHandler(proxy); + if (ih instanceof MBeanServerInvocationHandler) { + MBeanServerInvocationHandler mbsih = + (MBeanServerInvocationHandler) ih; + if (mbsih.getMBeanServerConnection().equals(mbsc)) + return mbsih.getObjectName(); } - T proxy = JMX.newMXBeanProxy(mbsc, name, type); - objectNameToProxy.put(name, new WeakReference(proxy)); - return proxy; + return null; } - synchronized ObjectName mxbeanToObjectName(Object mxbean) { - if (mxbean instanceof Proxy) { - InvocationHandler ih = Proxy.getInvocationHandler(mxbean); - if (ih instanceof MBeanServerInvocationHandler) { - MBeanServerInvocationHandler mbsih = - (MBeanServerInvocationHandler) ih; - if (mbsih.getMBeanServerConnection().equals(mbsc)) - return mbsih.getObjectName(); - } - return null; - } else - return mxbeanToObjectName.get(mxbean); + static MXBeanLookup getLookup() { + return currentLookup.get(); } - synchronized void addReference(ObjectName name, Object mxbean) { - mxbeanToObjectName.put(mxbean, name); + static void setLookup(MXBeanLookup lookup) { + currentLookup.set(lookup); } - synchronized boolean removeReference(ObjectName name, Object mxbean) { - if (name.equals(mxbeanToObjectName.get(mxbean))) { - mxbeanToObjectName.remove(mxbean); - return true; - } else - return false; - /* removeReference can be called when the above condition fails, - * notably if you try to register the same MXBean twice. - */ + // Method temporarily added until we have ObjectName.switchDomain in the + // public API. Note that this method DOES NOT PRESERVE the order of + // keys in the ObjectName so it must not be used in the final release. + static ObjectName switchDomain(String domain, ObjectName name) + throws MalformedObjectNameException { + return new ObjectName(domain, name.getKeyPropertyList()); } - private final MBeanServerConnection mbsc; - private final WeakIdentityHashMap - mxbeanToObjectName = WeakIdentityHashMap.make(); - private final Map> - objectNameToProxy = newMap(); - private static WeakIdentityHashMap> - mbscToLookup = WeakIdentityHashMap.make(); + private static final ThreadLocal currentLookup = + new ThreadLocal(); + + final MBeanServerConnection mbsc; } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanProxy.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanProxy.java index 6ecca2ce1d5..1ad7598f126 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanProxy.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -27,14 +27,15 @@ package com.sun.jmx.mbeanserver; import static com.sun.jmx.mbeanserver.Util.*; -import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.util.Map; import javax.management.Attribute; import javax.management.MBeanServerConnection; +import javax.management.MalformedObjectNameException; import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; +import javax.management.openmbean.MXBeanMappingFactory; /**

    Helper class for an {@link InvocationHandler} that forwards methods from an @@ -46,8 +47,7 @@ import javax.management.ObjectName; @since 1.6 */ public class MXBeanProxy { - public MXBeanProxy(Class mxbeanInterface) - throws IllegalArgumentException { + public MXBeanProxy(Class mxbeanInterface, MXBeanMappingFactory factory) { if (mxbeanInterface == null) throw new IllegalArgumentException("Null parameter"); @@ -55,14 +55,15 @@ public class MXBeanProxy { final MBeanAnalyzer analyzer; try { analyzer = - MXBeanIntrospector.getInstance().getAnalyzer(mxbeanInterface); + MXBeanIntrospector.getInstance(factory).getAnalyzer(mxbeanInterface); } catch (NotCompliantMBeanException e) { throw new IllegalArgumentException(e); } analyzer.visit(new Visitor()); } - private class Visitor implements MBeanAnalyzer.MBeanVisitor { + private class Visitor + implements MBeanAnalyzer.MBeanVisitor { public void visitAttribute(String attributeName, ConvertingMethod getter, ConvertingMethod setter) { @@ -160,10 +161,29 @@ public class MXBeanProxy { Handler handler = handlerMap.get(method); ConvertingMethod cm = handler.getConvertingMethod(); - MXBeanLookup lookup = MXBeanLookup.lookupFor(mbsc); - Object[] openArgs = cm.toOpenParameters(lookup, args); - Object result = handler.invoke(mbsc, name, openArgs); - return cm.fromOpenReturnValue(lookup, result); + String prefix = extractPrefix(name); + MXBeanLookup lookup = MXBeanLookup.lookupFor(mbsc, prefix); + MXBeanLookup oldLookup = MXBeanLookup.getLookup(); + try { + MXBeanLookup.setLookup(lookup); + Object[] openArgs = cm.toOpenParameters(lookup, args); + Object result = handler.invoke(mbsc, name, openArgs); + return cm.fromOpenReturnValue(lookup, result); + } finally { + MXBeanLookup.setLookup(oldLookup); + } + } + + private static String extractPrefix(ObjectName name) + throws MalformedObjectNameException { + String domain = name.getDomain(); + int slashslash = domain.lastIndexOf("//"); + if (slashslash > 0 && domain.charAt(slashslash - 1) == '/') + slashslash--; + if (slashslash >= 0) + return domain.substring(0, slashslash + 2); + else + return null; } private final Map handlerMap = newMap(); diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java index 977c74a3230..594a9733481 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -35,6 +35,8 @@ import javax.management.JMX; import javax.management.MBeanServer; import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; +import javax.management.openmbean.MXBeanMappingFactory; +import javax.management.openmbean.MXBeanMappingFactoryClass; /** * Base class for MXBeans. @@ -61,14 +63,16 @@ public class MXBeanSupport extends MBeanSupport { if it does not implement the class {@code mxbeanInterface} or if that class is not a valid MXBean interface. */ - public MXBeanSupport(T resource, Class mxbeanInterface) + public MXBeanSupport(T resource, Class mxbeanInterface, + MXBeanMappingFactory mappingFactory) throws NotCompliantMBeanException { - super(resource, mxbeanInterface); + super(resource, mxbeanInterface, mappingFactory); } @Override - MBeanIntrospector getMBeanIntrospector() { - return MXBeanIntrospector.getInstance(); + MBeanIntrospector + getMBeanIntrospector(MXBeanMappingFactory mappingFactory) { + return MXBeanIntrospector.getInstance(mappingFactory); } @Override @@ -76,8 +80,7 @@ public class MXBeanSupport extends MBeanSupport { return mxbeanLookup; } - static Class findMXBeanInterface(Class resourceClass) - throws IllegalArgumentException { + static Class findMXBeanInterface(Class resourceClass) { if (resourceClass == null) throw new IllegalArgumentException("Null resource class"); final Set> intfs = transitiveInterfaces(resourceClass); @@ -104,7 +107,7 @@ public class MXBeanSupport extends MBeanSupport { throw new IllegalArgumentException(msg); } if (candidates.iterator().hasNext()) { - return candidates.iterator().next(); + return Util.cast(candidates.iterator().next()); } else { final String msg = "Class " + resourceClass.getName() + @@ -116,7 +119,7 @@ public class MXBeanSupport extends MBeanSupport { /* Return all interfaces inherited by this class, directly or * indirectly through the parent class and interfaces. */ - private static Set> transitiveInterfaces(Class c) { + private static Set> transitiveInterfaces(Class c) { Set> set = newSet(); transitiveInterfaces(c, set); return set; @@ -127,7 +130,7 @@ public class MXBeanSupport extends MBeanSupport { if (c.isInterface()) intfs.add(c); transitiveInterfaces(c.getSuperclass(), intfs); - for (Class sup : c.getInterfaces()) + for (Class sup : c.getInterfaces()) transitiveInterfaces(sup, intfs); } @@ -157,13 +160,8 @@ public class MXBeanSupport extends MBeanSupport { // eventually we could have some logic to supply a default name synchronized (lock) { - if (this.objectName != null) { - final String msg = - "MXBean already registered with name " + this.objectName; - throw new InstanceAlreadyExistsException(msg); - } - this.mxbeanLookup = MXBeanLookup.lookupFor(server); - this.mxbeanLookup.addReference(name, getResource()); + this.mxbeanLookup = MXBeanLookup.Plain.lookupFor(server); + this.mxbeanLookup.addReference(name, getWrappedObject()); this.objectName = name; } } @@ -171,12 +169,20 @@ public class MXBeanSupport extends MBeanSupport { @Override public void unregister() { synchronized (lock) { - if (mxbeanLookup.removeReference(objectName, getResource())) - objectName = null; + if (mxbeanLookup != null) { + if (mxbeanLookup.removeReference(objectName, getWrappedObject())) + objectName = null; + } + // XXX: need to revisit the whole register/unregister logic in + // the face of wrapping. The mxbeanLookup!=null test is a hack. + // If you wrap an MXBean in a MyWrapperMBean and register it, + // the lookup table should contain the wrapped object. But that + // implies that MyWrapperMBean calls register, which today it + // can't within the public API. } } + private final Object lock = new Object(); // for mxbeanLookup and objectName - private Object lock = new Object(); // for mxbeanLookup and objectName - private MXBeanLookup mxbeanLookup; + private MXBeanLookup.Plain mxbeanLookup; private ObjectName objectName; } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotificationMBeanSupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotificationMBeanSupport.java index f1e3a13c891..08964f7dc2b 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotificationMBeanSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotificationMBeanSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -30,6 +30,7 @@ import java.util.ArrayList; import java.util.List; import javax.management.NotCompliantMBeanException; import javax.management.Notification; +import javax.management.openmbean.MXBeanMappingFactory; /** *

    A variant of {@code StandardMBeanSupport} where the only @@ -48,7 +49,7 @@ public class NotificationMBeanSupport extends StandardMBeanSupport { } @Override - MBeanIntrospector getMBeanIntrospector() { + MBeanIntrospector getMBeanIntrospector(MXBeanMappingFactory ignored) { return introspector; } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotifySupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotifySupport.java new file mode 100644 index 00000000000..94227370ba2 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/NotifySupport.java @@ -0,0 +1,186 @@ +/* + * 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 com.sun.jmx.mbeanserver; + +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.DynamicWrapperMBean; +import javax.management.InvalidAttributeValueException; +import javax.management.ListenerNotFoundException; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.ObjectName; +import javax.management.ReflectionException; + +/** + * Create wrappers for DynamicMBean that implement NotificationEmitter + * and SendNotification. + */ +public class NotifySupport + implements DynamicMBean2, NotificationEmitter, MBeanRegistration { + + private final DynamicMBean mbean; + private final NotificationBroadcasterSupport nbs; + + public static DynamicMBean wrap( + DynamicMBean mbean, NotificationBroadcasterSupport nbs) { + return new NotifySupport(mbean, nbs); + } + + private NotifySupport(DynamicMBean mbean, NotificationBroadcasterSupport nbs) { + this.mbean = mbean; + this.nbs = nbs; + } + + public static NotificationBroadcasterSupport getNB(DynamicMBean mbean) { + if (mbean instanceof NotifySupport) + return ((NotifySupport) mbean).nbs; + else + return null; + } + + public String getClassName() { + if (mbean instanceof DynamicMBean2) + return ((DynamicMBean2) mbean).getClassName(); + Object w = mbean; + if (w instanceof DynamicWrapperMBean) + w = ((DynamicWrapperMBean) w).getWrappedObject(); + return w.getClass().getName(); + } + + public void preRegister2(MBeanServer mbs, ObjectName name) throws Exception { + if (mbean instanceof DynamicMBean2) + ((DynamicMBean2) mbean).preRegister2(mbs, name); + } + + public void registerFailed() { + if (mbean instanceof DynamicMBean2) + ((DynamicMBean2) mbean).registerFailed(); + } + + public Object getWrappedObject() { + if (mbean instanceof DynamicWrapperMBean) + return ((DynamicWrapperMBean) mbean).getWrappedObject(); + else + return mbean; + } + + public ClassLoader getWrappedClassLoader() { + if (mbean instanceof DynamicWrapperMBean) + return ((DynamicWrapperMBean) mbean).getWrappedClassLoader(); + else + return mbean.getClass().getClassLoader(); + } + + public Object getAttribute(String attribute) throws AttributeNotFoundException, + MBeanException, + ReflectionException { + return mbean.getAttribute(attribute); + } + + public void setAttribute(Attribute attribute) throws AttributeNotFoundException, + InvalidAttributeValueException, + MBeanException, + ReflectionException { + mbean.setAttribute(attribute); + } + + public AttributeList setAttributes(AttributeList attributes) { + return mbean.setAttributes(attributes); + } + + public Object invoke(String actionName, Object[] params, String[] signature) + throws MBeanException, ReflectionException { + return mbean.invoke(actionName, params, signature); + } + + public MBeanInfo getMBeanInfo() { + return mbean.getMBeanInfo(); + } + + public AttributeList getAttributes(String[] attributes) { + return mbean.getAttributes(attributes); + } + + public void removeNotificationListener(NotificationListener listener, + NotificationFilter filter, + Object handback) throws ListenerNotFoundException { + nbs.removeNotificationListener(listener, filter, handback); + } + + public void removeNotificationListener(NotificationListener listener) + throws ListenerNotFoundException { + nbs.removeNotificationListener(listener); + } + + public MBeanNotificationInfo[] getNotificationInfo() { + return nbs.getNotificationInfo(); + } + + public void addNotificationListener(NotificationListener listener, + NotificationFilter filter, + Object handback) { + nbs.addNotificationListener(listener, filter, handback); + } + + public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { + if (mbr() != null) + return mbr().preRegister(server, name); + else + return name; + } + + public void postRegister(Boolean registrationDone) { + if (mbr() != null) + mbr().postRegister(registrationDone); + } + + public void preDeregister() throws Exception { + if (mbr() != null) + mbr().preDeregister(); + } + + public void postDeregister() { + if (mbr() != null) + mbr().postDeregister(); + } + + private MBeanRegistration mbr() { + if (mbean instanceof MBeanRegistration) + return (MBeanRegistration) mbean; + else + return null; + } +} diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/PerInterface.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/PerInterface.java index d20fe5f5239..59fd71cdb98 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/PerInterface.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/PerInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -231,7 +231,7 @@ final class PerInterface { /** * Visitor that sets up the method maps (operations, getters, setters). */ - private class InitMaps implements MBeanAnalyzer.MBeanVisitor { + private class InitMaps implements MBeanAnalyzer.MBeanVisitor { public void visitAttribute(String attributeName, M getter, M setter) { diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java index 075ce819937..f41079912fb 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Repository.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -29,6 +29,7 @@ import com.sun.jmx.defaults.ServiceName; import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -39,7 +40,6 @@ import java.util.Set; import javax.management.DynamicMBean; import javax.management.InstanceAlreadyExistsException; import javax.management.InstanceNotFoundException; -import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import javax.management.QueryExp; import javax.management.RuntimeOperationsException; @@ -52,6 +52,27 @@ import javax.management.RuntimeOperationsException; */ public class Repository { + /** + * An interface that allows the caller to get some control + * over the registration. + * @see #addMBean + * @see #remove + */ + public interface RegistrationContext { + /** + * Called by {@link #addMBean}. + * Can throw a RuntimeOperationsException to cancel the + * registration. + */ + public void registering(); + + /** + * Called by {@link #remove}. + * Any exception thrown by this method will be ignored. + */ + public void unregistered(); + } + // Private fields --------------------------------------------> /** @@ -115,7 +136,6 @@ public class Repository { /** * Builds a new ObjectNamePattern object from an ObjectName pattern * constituents. - * @param domain pattern.getDomain(). * @param propertyListPattern pattern.isPropertyListPattern(). * @param propertyValuePattern pattern.isPropertyValuePattern(). * @param canonicalProps pattern.getCanonicalKeyPropertyListString(). @@ -216,16 +236,6 @@ public class Repository { } } - private void addNewDomMoi(final DynamicMBean object, final String dom, - final ObjectName name) { - final Map moiTb = - new HashMap(); - moiTb.put(name.getCanonicalKeyPropertyListString(), - new NamedObject(name, object)); - domainTb.put(dom, moiTb); - nbElements++; - } - /** Match a string against a shell-style pattern. The only pattern characters recognised are ?, standing for any one character, and *, standing for any string of @@ -306,6 +316,50 @@ public class Repository { } } + private void addNewDomMoi(final DynamicMBean object, + final String dom, + final ObjectName name, + final RegistrationContext context) { + final Map moiTb = + new HashMap(); + final String key = name.getCanonicalKeyPropertyListString(); + addMoiToTb(object,name,key,moiTb,context); + domainTb.put(dom, moiTb); + nbElements++; + } + + private void registering(RegistrationContext context) { + if (context == null) return; + try { + context.registering(); + } catch (RuntimeOperationsException x) { + throw x; + } catch (RuntimeException x) { + throw new RuntimeOperationsException(x); + } + } + + private void unregistering(RegistrationContext context, ObjectName name) { + if (context == null) return; + try { + context.unregistered(); + } catch (Exception x) { + // shouldn't come here... + MBEANSERVER_LOGGER.log(Level.FINE, + "Unexpected exception while unregistering "+name, + x); + } + } + + private void addMoiToTb(final DynamicMBean object, + final ObjectName name, + final String key, + final Map moiTb, + final RegistrationContext context) { + registering(context); + moiTb.put(key,new NamedObject(name, object)); + } + /** * Retrieves the named object contained in repository * from the given objectname. @@ -355,12 +409,12 @@ public class Repository { domainTb = new HashMap>(5); if (domain != null && domain.length() != 0) - this.domain = domain; + this.domain = domain.intern(); // we use == domain later on... else this.domain = ServiceName.DOMAIN; - // Creates an new hastable for the default domain - domainTb.put(this.domain.intern(), new HashMap()); + // Creates a new hashtable for the default domain + domainTb.put(this.domain, new HashMap()); } /** @@ -395,10 +449,21 @@ public class Repository { /** * Stores an MBean associated with its object name in the repository. * - * @param object MBean to be stored in the repository. - * @param name MBean object name. + * @param object MBean to be stored in the repository. + * @param name MBean object name. + * @param context A registration context. If non null, the repository + * will call {@link RegistrationContext#registering() + * context.registering()} from within the repository + * lock, when it has determined that the {@code object} + * can be stored in the repository with that {@code name}. + * If {@link RegistrationContext#registering() + * context.registering()} throws an exception, the + * operation is abandonned, the MBean is not added to the + * repository, and a {@link RuntimeOperationsException} + * is thrown. */ - public void addMBean(final DynamicMBean object, ObjectName name) + public void addMBean(final DynamicMBean object, ObjectName name, + final RegistrationContext context) throws InstanceAlreadyExistsException { if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) { @@ -431,7 +496,7 @@ public class Repository { lock.writeLock().lock(); try { - // Domain cannot be JMImplementation if entry does not exists + // Domain cannot be JMImplementation if entry does not exist if ( !to_default_domain && dom.equals("JMImplementation") && domainTb.containsKey("JMImplementation")) { @@ -440,21 +505,21 @@ public class Repository { "Repository: domain name cannot be JMImplementation")); } - // If domain not already exists, add it to the hash table + // If domain does not already exist, add it to the hash table final Map moiTb = domainTb.get(dom); if (moiTb == null) { - addNewDomMoi(object, dom, name); + addNewDomMoi(object, dom, name, context); return; - } - - // Add instance if not already present - String cstr = name.getCanonicalKeyPropertyListString(); - NamedObject elmt= moiTb.get(cstr); - if (elmt != null) { - throw new InstanceAlreadyExistsException(name.toString()); } else { - nbElements++; - moiTb.put(cstr, new NamedObject(name, object)); + // Add instance if not already present + String cstr = name.getCanonicalKeyPropertyListString(); + NamedObject elmt= moiTb.get(cstr); + if (elmt != null) { + throw new InstanceAlreadyExistsException(name.toString()); + } else { + nbElements++; + addMoiToTb(object,name,cstr,moiTb,context); + } } } finally { @@ -533,7 +598,7 @@ public class Repository { // ":*", ":[key=value],*" : names in defaultDomain // "domain:*", "domain:[key=value],*" : names in the specified domain - // Surely one of the most frequent case ... query on the whole world + // Surely one of the most frequent cases ... query on the whole world ObjectName name; if (pattern == null || pattern.getCanonicalName().length() == 0 || @@ -546,8 +611,7 @@ public class Repository { // If pattern is not a pattern, retrieve this mbean ! if (!name.isPattern()) { - final NamedObject no; - no = retrieveNamedObject(name); + final NamedObject no = retrieveNamedObject(name); if (no != null) result.add(no); return result; } @@ -577,12 +641,22 @@ public class Repository { return result; } + if (!name.isDomainPattern()) { + final Map moiTb = domainTb.get(name.getDomain()); + if (moiTb == null) return Collections.emptySet(); + if (allNames) + result.addAll(moiTb.values()); + else + addAllMatching(moiTb, result, namePattern); + return result; + } + // Pattern matching in the domain name (*, ?) char[] dom2Match = name.getDomain().toCharArray(); - for (String domain : domainTb.keySet()) { - char[] theDom = domain.toCharArray(); + for (String dom : domainTb.keySet()) { + char[] theDom = dom.toCharArray(); if (wildmatch(theDom, dom2Match)) { - final Map moiTb = domainTb.get(domain); + final Map moiTb = domainTb.get(dom); if (allNames) result.addAll(moiTb.values()); else @@ -599,11 +673,21 @@ public class Repository { * Removes an MBean from the repository. * * @param name name of the MBean to remove. + * @param context A registration context. If non null, the repository + * will call {@link RegistrationContext#unregistered() + * context.unregistered()} from within the repository + * lock, just after the mbean associated with + * {@code name} is removed from the repository. + * If {@link RegistrationContext#unregistered() + * context.unregistered()} is not expected to throw any + * exception. If it does, the exception is logged + * and swallowed. * * @exception InstanceNotFoundException The MBean does not exist in * the repository. */ - public void remove(final ObjectName name) + public void remove(final ObjectName name, + final RegistrationContext context) throws InstanceNotFoundException { // Debugging stuff @@ -645,6 +729,9 @@ public class Repository { if (dom == domain) domainTb.put(domain, new HashMap()); } + + unregistering(context,name); + } finally { lock.writeLock().unlock(); } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java index 2237a5192cd..aca58c32f11 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanIntrospector.java @@ -35,6 +35,7 @@ import javax.management.IntrospectionException; import javax.management.MBeanAttributeInfo; import javax.management.MBeanException; import javax.management.MBeanOperationInfo; +import javax.management.ManagedOperation; import javax.management.NotCompliantMBeanException; import javax.management.NotificationBroadcaster; import javax.management.NotificationBroadcasterSupport; @@ -118,22 +119,32 @@ class StandardMBeanIntrospector extends MBeanIntrospector { @Override MBeanAttributeInfo getMBeanAttributeInfo(String attributeName, - Method getter, Method setter) { + Method getter, Method setter) throws IntrospectionException { - final String description = "Attribute exposed for management"; - try { - return new MBeanAttributeInfo(attributeName, description, - getter, setter); - } catch (IntrospectionException e) { - throw new RuntimeException(e); // should not happen - } + String description = getAttributeDescription( + attributeName, "Attribute exposed for management", + getter, setter); + return new MBeanAttributeInfo(attributeName, description, + getter, setter); } @Override MBeanOperationInfo getMBeanOperationInfo(String operationName, Method operation) { - final String description = "Operation exposed for management"; - return new MBeanOperationInfo(description, operation); + final String defaultDescription = "Operation exposed for management"; + String description = Introspector.descriptionForElement(operation); + if (description == null) + description = defaultDescription; + + int impact = MBeanOperationInfo.UNKNOWN; + ManagedOperation annot = operation.getAnnotation(ManagedOperation.class); + if (annot != null) + impact = annot.impact().getCode(); + + MBeanOperationInfo mboi = new MBeanOperationInfo(description, operation); + return new MBeanOperationInfo( + mboi.getName(), mboi.getDescription(), mboi.getSignature(), + mboi.getReturnType(), impact, mboi.getDescriptor()); } @Override diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanSupport.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanSupport.java index fd99162f384..4b9963eee49 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanSupport.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/StandardMBeanSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -25,14 +25,13 @@ package com.sun.jmx.mbeanserver; -import static com.sun.jmx.mbeanserver.Util.*; - import java.lang.reflect.Method; import javax.management.MBeanInfo; import javax.management.MBeanServer; import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; +import javax.management.openmbean.MXBeanMappingFactory; /** * Base class for Standard MBeans. @@ -42,30 +41,28 @@ import javax.management.ObjectName; public class StandardMBeanSupport extends MBeanSupport { /** -

    Construct a Standard MBean that wraps the given resource using the - given Standard MBean interface.

    - - @param resource the underlying resource for the new MBean. - - @param mbeanInterface the interface to be used to determine - the MBean's management interface. - - @param a type parameter that allows the compiler to check - that {@code resource} implements {@code mbeanInterface}, - provided that {@code mbeanInterface} is a class constant like - {@code SomeMBean.class}. - - @throws IllegalArgumentException if {@code resource} is null or - if it does not implement the class {@code mbeanInterface} or if - that class is not a valid Standard MBean interface. - */ - public StandardMBeanSupport(T resource, Class mbeanInterface) + *

    Construct a Standard MBean that wraps the given resource using the + * given Standard MBean interface.

    + * + * @param resource the underlying resource for the new MBean. + * @param mbeanInterfaceType the class or interface to be used to determine + * the MBean's management interface. An interface if this is a + * classic Standard MBean; a class if this is a {@code @ManagedResource}. + * @param a type parameter that allows the compiler to check + * that {@code resource} implements {@code mbeanInterfaceType}, + * provided that {@code mbeanInterfaceType} is a class constant like + * {@code SomeMBean.class}. + * @throws IllegalArgumentException if {@code resource} is null or + * if it does not implement the class {@code mbeanInterfaceType} or if + * that class is not a valid Standard MBean interface. + */ + public StandardMBeanSupport(T resource, Class mbeanInterfaceType) throws NotCompliantMBeanException { - super(resource, mbeanInterface); + super(resource, mbeanInterfaceType, (MXBeanMappingFactory) null); } @Override - MBeanIntrospector getMBeanIntrospector() { + MBeanIntrospector getMBeanIntrospector(MXBeanMappingFactory ignored) { return StandardMBeanIntrospector.getInstance(); } @@ -87,13 +84,14 @@ public class StandardMBeanSupport extends MBeanSupport { @Override public MBeanInfo getMBeanInfo() { MBeanInfo mbi = super.getMBeanInfo(); - Class resourceClass = getResource().getClass(); - if (StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass)) + Class resourceClass = getWrappedObject().getClass(); + if (!getMBeanInterface().isInterface() || + StandardMBeanIntrospector.isDefinitelyImmutableInfo(resourceClass)) return mbi; return new MBeanInfo(mbi.getClassName(), mbi.getDescription(), mbi.getAttributes(), mbi.getConstructors(), mbi.getOperations(), - MBeanIntrospector.findNotifications(getResource()), + MBeanIntrospector.findNotifications(getWrappedObject()), mbi.getDescriptor()); } } diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java index f2dbe60bbdf..af427da2887 100644 --- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java +++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Util.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -26,6 +26,7 @@ package com.sun.jmx.mbeanserver; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -38,6 +39,7 @@ import java.util.Map; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; +import java.util.WeakHashMap; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; @@ -71,6 +73,10 @@ public class Util { return new LinkedHashMap(); } + static WeakHashMap newWeakHashMap() { + return new WeakHashMap(); + } + static Set newSet() { return new HashSet(); } @@ -108,4 +114,32 @@ public class Util { public static T cast(Object x) { return (T) x; } + + /** + * Computes a descriptor hashcode from its names and values. + * @param names the sorted array of descriptor names. + * @param values the array of descriptor values. + * @return a hash code value, as described in {@link #hashCode(Descriptor)} + */ + public static int hashCode(String[] names, Object[] values) { + int hash = 0; + for (int i = 0; i < names.length; i++) { + Object v = values[i]; + int h; + if (v == null) { + h = 0; + } else if (v instanceof Object[]) { + h = Arrays.deepHashCode((Object[]) v); + } else if (v.getClass().isArray()) { + h = Arrays.deepHashCode(new Object[]{v}) - 31; + // hashcode of a list containing just v is + // v.hashCode() + 31, see List.hashCode() + } else { + h = v.hashCode(); + } + hash += names[i].toLowerCase().hashCode() ^ h; + } + return hash; + } + } diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java index 7af1e5f47bc..a37b75395f8 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java index 5cdbf7ea08a..ae84f4b9d2e 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java b/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java index 665557de5a2..47f3e07ab07 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/security/FileLoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java b/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java index 0fc555620f6..631ee3e3b7b 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/security/JMXPluggableAuthenticator.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java index 8bca71dbc62..2e90b11bf4b 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index f736dc500bd..d319e8f39e3 100644 --- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java index 014852ca6d0..99b5361f6aa 100644 --- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index e883373b117..7562f584ada 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -1145,6 +1145,10 @@ public class Krb5LoginModule implements LoginModule { sharedState.put(NAME, username); sharedState.put(PWD, password); } + } else { + // remove temp results for the next try + encKeys = null; + principal = null; } username = null; password = null; diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java index 96a9ef5322b..8e683749ea8 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpecList.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpecList.java index e04c851f186..118fb38cab9 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpecList.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/EventRequestSpecList.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java index 245590ec7fd..4229f5885cd 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ExecutionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java index 97fc6a7f2b0..bd024a9d14c 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/JDIEventSource.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java index 29f05ced6b7..a6dc5017ca4 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/LineBreakpointSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java index 0732ed9c2c1..87fad085521 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/MethodBreakpointSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java index d41901320dd..a5271370b1f 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadGroupIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java index bfe57d14a92..806dbee25c5 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/bdi/ThreadIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java b/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java index ae9711d9f09..40d368c5b0c 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java index bea3a2745e7..0687f902594 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/ClassTreeTool.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java index 7b6aaf54695..42a7619a0a1 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/CommandInterpreter.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java index 5963ef2e0df..3c5f50875f2 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/JDBFileFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java index fc115b9078e..71ecb38ba92 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/LaunchTool.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java index 1d61c8fa068..b8d359a4410 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SearchPath.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java index 7173b5f1014..e1973534f4a 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java index 75cdca6857d..b77fa29abe9 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/SourceModel.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java index 78476f0d98b..7c314191f18 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/StackTraceTool.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java b/jdk/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java index 955c5b6cbc1..84d4f617794 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/gui/ThreadTreeTool.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java index c6d437d29e6..f15a1109544 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/BreakpointSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java index e607d7165d4..f3c64594fb4 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Commands.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java index 9d848a0205b..35fa2935bd7 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/Env.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java index ee80f9df538..760490078a0 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java index 7169e33f6f0..3095525791b 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java index e5741efc706..116a3e779ce 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/EventRequestSpecList.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java index 618f41a622c..21078658d72 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/SourceMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java index ec1dc51c6da..6d8930cd850 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTY.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java index dc2dc118074..09b28d93b77 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadGroupIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java index e823821c04c..01547aced29 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java index 8baff8ebd48..917a4a2eb5b 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/ThreadIterator.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java index 7ab34280f89..bbced329f82 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/VMConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/com/sun/tools/hat/Main.java b/jdk/src/share/classes/com/sun/tools/hat/Main.java index d027904bdd4..a5c293ade3c 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/Main.java +++ b/jdk/src/share/classes/com/sun/tools/hat/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/src/share/classes/com/sun/tools/hat/build.xml b/jdk/src/share/classes/com/sun/tools/hat/build.xml index 401cb77ae02..33e9472474f 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/build.xml +++ b/jdk/src/share/classes/com/sun/tools/hat/build.xml @@ -1,7 +1,7 @@ {@code Descriptor} for the annotated item.

    + */ + @DescriptorKey( + value = "descriptionResourceBundleBaseName", omitIfDefault = true) + String bundleBaseName() default ""; + + /** + *

    A resource key for the description of this element. In + * conjunction with the {@link #bundleBaseName bundleBaseName}, + * this can be used to find a localized version of the description. + * If a non-default value + * is supplied for this element, it will appear in the + * {@code Descriptor} for the annotated item.

    + */ + @DescriptorKey(value = "descriptionResourceKey", omitIfDefault = true) + String key() default ""; +} diff --git a/jdk/src/share/classes/javax/management/Descriptor.java b/jdk/src/share/classes/javax/management/Descriptor.java index 64bb3eccb23..9aa992486a0 100644 --- a/jdk/src/share/classes/javax/management/Descriptor.java +++ b/jdk/src/share/classes/javax/management/Descriptor.java @@ -38,6 +38,7 @@ import java.util.Arrays; import java.util.ResourceBundle; import javax.management.openmbean.CompositeData; +import javax.management.openmbean.MXBeanMappingFactory; import javax.management.openmbean.OpenMBeanAttributeInfoSupport; import javax.management.openmbean.OpenMBeanOperationInfoSupport; import javax.management.openmbean.OpenMBeanParameterInfoSupport; @@ -117,21 +118,19 @@ import javax.management.openmbean.OpenType; * deprecation, for example {@code "1.3 Replaced by the Capacity * attribute"}. * - *
    + * + * * * + * {@code "com.example.myapp.MBeanResources"}. * - * + * + * * * + * this can be used to find a localized version of the description. * * * @@ -216,6 +215,14 @@ import javax.management.openmbean.OpenType; * StandardMBean} class will have this field in its MBeanInfo * Descriptor. * + * + * + * + * + * * * * diff --git a/jdk/src/share/classes/javax/management/DescriptorFields.java b/jdk/src/share/classes/javax/management/DescriptorFields.java new file mode 100644 index 00000000000..95a4b3a6df1 --- /dev/null +++ b/jdk/src/share/classes/javax/management/DescriptorFields.java @@ -0,0 +1,137 @@ +/* + * 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 javax.management; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

    Annotation that adds fields to a {@link Descriptor}. This can be the + * Descriptor for an MBean, or for an attribute, operation, or constructor + * in an MBean, or for a parameter of an operation or constructor.

    + * + *

    Consider this Standard MBean interface, for example:

    + * + *
    + * public interface CacheControlMBean {
    + *     @DescriptorFields("units=bytes")
    + *     public long getCacheSize();
    + * }
    + * 
    + * + *

    When a Standard MBean is made using this interface, the usual rules + * mean that it will have an attribute called {@code CacheSize} of type + * {@code long}. The {@code DescriptorFields} annotation will ensure + * that the {@link MBeanAttributeInfo} for this attribute will have a + * {@code Descriptor} that has a field called {@code units} with + * corresponding value {@code bytes}.

    + * + *

    Similarly, if the interface looks like this:

    + * + *
    + * public interface CacheControlMBean {
    + *     @DescriptorFields({"units=bytes", "since=1.5"})
    + *     public long getCacheSize();
    + * }
    + * 
    + * + *

    then the resulting {@code Descriptor} will contain the following + * fields:

    + * + *
    - - OpenJDK - + OpenJDK
    make.exe Develmake: The GNU version of the 'make' utilitymake: The GNU version of the 'make' utility
    + NOTE: See the GNU make section
    m4.execpio: A program to manage archives of files
    awk.exegawk.exe Utils awk: Pattern-directed scanning and processing language
    zip.exeUtilsArchive zip: Package and compress (archive) files
    unzip.exeUtilsArchive unzip: Extract compressed files in a ZIP archive
    free.exeUtilsProcps free: Display amount of free and used memory in the system
    descriptionResource
    BundleBaseName
    StringAny
    descriptionResource
    BundleBaseName
    StringAnyThe base name for the {@link ResourceBundle} in which the key given in * the {@code descriptionResourceKey} field can be found, for example - * {@code "com.example.myapp.MBeanResources"}. The meaning of this - * field is defined by this specification but the field is not set or - * used by the JMX API itself.
    descriptionResourceKeyStringAny
    descriptionResourceKeyStringAnyA resource key for the description of this element. In * conjunction with the {@code descriptionResourceBundleBaseName}, - * this can be used to find a localized version of the description. - * The meaning of this field is defined by this specification but the - * field is not set or used by the JMX API itself.
    enabledStringMBeanAttributeInfo
    MBeanNotificationInfo
    MBeanOperationInfo
    mxbeanMappingFactoryClass + * StringMBeanInfoThe name of the {@link MXBeanMappingFactory} class that was used for this + * MXBean, if it was not the {@linkplain MXBeanMappingFactory#DEFAULT default} + * one.
    openType{@link OpenType}MBeanAttributeInfo
    MBeanOperationInfo
    MBeanParameterInfo
    + * + * + * + *
    NameValue
    units"bytes"
    since"1.5"
    + * + *

    The {@code @DescriptorFields} annotation can be applied to:

    + * + * + * + *

    Other uses of the annotation will either fail to compile or be + * ignored.

    + * + *

    Interface annotations are checked only on the exact interface + * that defines the management interface of a Standard MBean or an + * MXBean, not on its parent interfaces. Method annotations are + * checked only in the most specific interface in which the method + * appears; in other words, if a child interface overrides a method + * from a parent interface, only {@code @DescriptorFields} annotations in + * the method in the child interface are considered. + * + *

    The Descriptor fields contributed in this way must be consistent + * with each other and with any fields contributed by {@link + * DescriptorKey @DescriptorKey} annotations. That is, two + * different annotations, or two members of the same annotation, must + * not define a different value for the same Descriptor field. Fields + * from annotations on a getter method must also be consistent with + * fields from annotations on the corresponding setter method.

    + * + *

    The Descriptor resulting from these annotations will be merged + * with any Descriptor fields provided by the implementation, such as + * the {@code + * immutableInfo} field for an MBean. The fields from the annotations + * must be consistent with these fields provided by the implementation.

    + * + *

    {@literal @DescriptorFields and @DescriptorKey}

    + * + *

    The {@link DescriptorKey @DescriptorKey} annotation provides + * another way to use annotations to define Descriptor fields. + * @DescriptorKey requires more work but is also more + * robust, because there is less risk of mistakes such as misspelling + * the name of the field or giving an invalid value. + * @DescriptorFields is more convenient but includes + * those risks. @DescriptorFields is more + * appropriate for occasional use, but for a Descriptor field that you + * add in many places, you should consider a purpose-built annotation + * using @DescriptorKey. + * + * @since 1.7 + */ +@Documented +@Inherited // for @MBean and @MXBean classes +@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, + ElementType.PARAMETER, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface DescriptorFields { + /** + *

    The descriptor fields. Each element of the string looks like + * {@code "name=value"}.

    + */ + public String[] value(); +} diff --git a/jdk/src/share/classes/javax/management/DescriptorKey.java b/jdk/src/share/classes/javax/management/DescriptorKey.java index ad12612db18..9f919490512 100644 --- a/jdk/src/share/classes/javax/management/DescriptorKey.java +++ b/jdk/src/share/classes/javax/management/DescriptorKey.java @@ -33,6 +33,11 @@ import java.lang.annotation.*; * an MBean, or for an attribute, operation, or constructor in an * MBean, or for a parameter of an operation or constructor.

    * + *

    (The {@link DescriptorFields @DescriptorFields} annotation + * provides another way to add fields to a {@code Descriptor}. See + * the documentation for that annotation for a comparison of the + * two possibilities.)

    + * *

    Consider this annotation for example:

    * *
    @@ -57,7 +62,7 @@ import java.lang.annotation.*;
      * 

    When a Standard MBean is made from the {@code CacheControlMBean}, * the usual rules mean that it will have an attribute called * {@code CacheSize} of type {@code long}. The {@code @Units} - * attribute, given the above definition, will ensure that the + * annotation, given the above definition, will ensure that the * {@link MBeanAttributeInfo} for this attribute will have a * {@code Descriptor} that has a field called {@code units} with * corresponding value {@code bytes}.

    @@ -125,12 +130,13 @@ import java.lang.annotation.*; * the method in the child interface are considered. * *

    The Descriptor fields contributed in this way by different - * annotations on the same program element must be consistent. That - * is, two different annotations, or two members of the same - * annotation, must not define a different value for the same - * Descriptor field. Fields from annotations on a getter method must - * also be consistent with fields from annotations on the - * corresponding setter method.

    + * annotations on the same program element must be consistent with + * each other and with any fields contributed by a {@link + * DescriptorFields @DescriptorFields} annotation. That is, two + * different annotations, or two members of the same annotation, must + * not define a different value for the same Descriptor field. Fields + * from annotations on a getter method must also be consistent with + * fields from annotations on the corresponding setter method.

    * *

    The Descriptor resulting from these annotations will be merged * with any Descriptor fields provided by the implementation, such as @@ -169,4 +175,36 @@ import java.lang.annotation.*; @Target(ElementType.METHOD) public @interface DescriptorKey { String value(); + + /** + *

    Do not include this field in the Descriptor if the annotation + * element has its default value. For example, suppose {@code @Units} is + * defined like this:

    + * + *
    +     * @Documented
    +     * @Target(ElementType.METHOD)
    +     * @Retention(RetentionPolicy.RUNTIME)
    +     * public @interface Units {
    +     *     @DescriptorKey("units")
    +     *     String value();
    +     *
    +     *     @DescriptorKey(value = "descriptionResourceKey",
    +     *                    omitIfDefault = true)
    +     *     String resourceKey() default "";
    +     *
    +     *     @DescriptorKey(value = "descriptionResourceBundleBaseName",
    +     *                    omitIfDefault = true)
    +     *     String resourceBundleBaseName() default "";
    +     * }
    +     * 
    + * + *

    Then consider a usage such as {@code @Units("bytes")} or + * {@code @Units(value = "bytes", resourceKey = "")}, where the + * {@code resourceKey} and {@code resourceBundleBaseNames} elements + * have their default values. In this case the Descriptor resulting + * from these annotations will not include a {@code descriptionResourceKey} + * or {@code descriptionResourceBundleBaseName} field.

    + */ + boolean omitIfDefault() default false; } diff --git a/jdk/src/share/classes/javax/management/DynamicWrapperMBean.java b/jdk/src/share/classes/javax/management/DynamicWrapperMBean.java new file mode 100644 index 00000000000..4a67a96795a --- /dev/null +++ b/jdk/src/share/classes/javax/management/DynamicWrapperMBean.java @@ -0,0 +1,62 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 javax.management; + +/** + *

    An MBean can implement this interface to affect how the MBeanServer's + * {@link MBeanServer#getClassLoaderFor getClassLoaderFor} and + * {@link MBeanServer#isInstanceOf isInstanceOf} methods behave. + * If these methods should refer to a wrapped object rather than the + * MBean object itself, then the {@link #getWrappedObject} method should + * return that wrapped object.

    + * + * @see MBeanServer#getClassLoaderFor + * @see MBeanServer#isInstanceOf + */ +public interface DynamicWrapperMBean extends DynamicMBean { + /** + *

    The resource corresponding to this MBean. This is the object whose + * class name should be reflected by the MBean's + * {@link MBeanServer#getMBeanInfo getMBeanInfo()}.{@link MBeanInfo#getClassName getClassName()} for example. For a "plain" + * DynamicMBean it will be "this". For an MBean that wraps another + * object, in the manner of {@link javax.management.StandardMBean}, it will be the + * wrapped object.

    + * + * @return The resource corresponding to this MBean. + */ + public Object getWrappedObject(); + + /** + *

    The {@code ClassLoader} for this MBean, which can be used to + * retrieve resources associated with the MBean for example. Usually, + * it will be + * {@link #getWrappedObject()}.{@code getClass().getClassLoader()}. + * + * @return The {@code ClassLoader} for this MBean. + */ + public ClassLoader getWrappedClassLoader(); +} diff --git a/jdk/src/share/classes/javax/management/ImmutableDescriptor.java b/jdk/src/share/classes/javax/management/ImmutableDescriptor.java index 686ca4ecc60..cdfe459d0e7 100644 --- a/jdk/src/share/classes/javax/management/ImmutableDescriptor.java +++ b/jdk/src/share/classes/javax/management/ImmutableDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 @@ -25,6 +25,7 @@ package javax.management; +import com.sun.jmx.mbeanserver.Util; import java.io.InvalidObjectException; import java.lang.reflect.Array; import java.util.Arrays; @@ -362,6 +363,7 @@ public class ImmutableDescriptor implements Descriptor { */ // Note: this Javadoc is copied from javax.management.Descriptor // due to 6369229. + @Override public boolean equals(Object o) { if (o == this) return true; @@ -410,29 +412,15 @@ public class ImmutableDescriptor implements Descriptor { */ // Note: this Javadoc is copied from javax.management.Descriptor // due to 6369229. + @Override public int hashCode() { if (hashCode == -1) { - int hash = 0; - for (int i = 0; i < names.length; i++) { - Object v = values[i]; - int h; - if (v == null) - h = 0; - else if (v instanceof Object[]) - h = Arrays.deepHashCode((Object[]) v); - else if (v.getClass().isArray()) { - h = Arrays.deepHashCode(new Object[] {v}) - 31; - // hashcode of a list containing just v is - // v.hashCode() + 31, see List.hashCode() - } else - h = v.hashCode(); - hash += names[i].toLowerCase().hashCode() ^ h; - } - hashCode = hash; + hashCode = Util.hashCode(names, values); } return hashCode; } + @Override public String toString() { StringBuilder sb = new StringBuilder("{"); for (int i = 0; i < names.length; i++) { @@ -479,6 +467,7 @@ public class ImmutableDescriptor implements Descriptor { * If the descriptor construction fails for any reason, this exception will * be thrown. */ + @Override public Descriptor clone() { return this; } diff --git a/jdk/src/share/classes/javax/management/Impact.java b/jdk/src/share/classes/javax/management/Impact.java new file mode 100644 index 00000000000..9416df6fac8 --- /dev/null +++ b/jdk/src/share/classes/javax/management/Impact.java @@ -0,0 +1,105 @@ +/* + * 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 javax.management; + +/** + *

    Defines the impact of an MBean operation, in particular whether it + * has an effect on the MBean or simply returns information. This enum + * is used in the {@link ManagedOperation @ManagedOperation} annotation. + * Its {@link #getCode()} method can be used to get an {@code int} suitable + * for use as the {@code impact} parameter in an {@link MBeanOperationInfo} + * constructor.

    + */ +public enum Impact { + /** + * The operation is read-like: it returns information but does not change + * any state. + * @see MBeanOperationInfo#INFO + */ + INFO(MBeanOperationInfo.INFO), + + /** + * The operation is write-like: it has an effect but does not return + * any information from the MBean. + * @see MBeanOperationInfo#ACTION + */ + ACTION(MBeanOperationInfo.ACTION), + + /** + * The operation is both read-like and write-like: it has an effect, + * and it also returns information from the MBean. + * @see MBeanOperationInfo#ACTION_INFO + */ + ACTION_INFO(MBeanOperationInfo.ACTION_INFO), + + /** + * The impact of the operation is unknown or cannot be expressed + * using one of the other values. + * @see MBeanOperationInfo#UNKNOWN + */ + UNKNOWN(MBeanOperationInfo.UNKNOWN); + + private final int code; + + /** + * An instance of this enumeration, with the corresponding {@code int} + * code used by the {@link MBeanOperationInfo} constructors. + * + * @param code the code used by the {@code MBeanOperationInfo} constructors. + */ + Impact(int code) { + this.code = code; + } + + /** + * The equivalent {@code int} code used by the {@link MBeanOperationInfo} + * constructors. + * @return the {@code int} code. + */ + public int getCode() { + return code; + } + + /** + * Return the {@code Impact} value corresponding to the given {@code int} + * code. The {@code code} is the value that would be used in an + * {@code MBeanOperationInfo} constructor. + * + * @param code the {@code int} code. + * + * @return an {@code Impact} value {@code x} such that + * {@code code == x.}{@link #getCode()}, or {@code Impact.UNKNOWN} + * if there is no such value. + */ + public static Impact forCode(int code) { + switch (code) { + case MBeanOperationInfo.ACTION: return ACTION; + case MBeanOperationInfo.INFO: return INFO; + case MBeanOperationInfo.ACTION_INFO: return ACTION_INFO; + default: return UNKNOWN; + } + } +} diff --git a/jdk/src/share/classes/javax/management/InQueryExp.java b/jdk/src/share/classes/javax/management/InQueryExp.java index 103ba3b8633..c24e04569de 100644 --- a/jdk/src/share/classes/javax/management/InQueryExp.java +++ b/jdk/src/share/classes/javax/management/InQueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/JMX.java b/jdk/src/share/classes/javax/management/JMX.java index d2bc522afa1..87c7dd227ce 100644 --- a/jdk/src/share/classes/javax/management/JMX.java +++ b/jdk/src/share/classes/javax/management/JMX.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -26,8 +26,18 @@ package javax.management; import com.sun.jmx.mbeanserver.Introspector; +import com.sun.jmx.mbeanserver.MBeanInjector; +import com.sun.jmx.remote.util.ClassLogger; +import java.beans.BeanInfo; +import java.beans.PropertyDescriptor; +import java.io.Serializable; import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.util.Map; +import java.util.TreeMap; +import javax.management.openmbean.MXBeanMappingFactory; /** * Static methods from the JMX API. There are no instances of this class. @@ -39,6 +49,8 @@ public class JMX { * this class. */ static final JMX proof = new JMX(); + private static final ClassLogger logger = + new ClassLogger("javax.management.misc", "JMX"); private JMX() {} @@ -84,6 +96,14 @@ public class JMX { */ public static final String MXBEAN_FIELD = "mxbean"; + /** + * The name of the + * {@code + * mxbeanMappingFactoryClass} field. + */ + public static final String MXBEAN_MAPPING_FACTORY_CLASS_FIELD = + "mxbeanMappingFactoryClass"; + /** * The name of the {@code * openType} field. @@ -96,6 +116,265 @@ public class JMX { */ public static final String ORIGINAL_TYPE_FIELD = "originalType"; + /** + *

    Options to apply to an MBean proxy or to an instance of {@link + * StandardMBean}.

    + * + *

    For example, to specify a custom {@link MXBeanMappingFactory} + * for a {@code StandardMBean}, you might write this:

    + * + *
    +     * MXBeanMappingFactory factory = new MyMXBeanMappingFactory();
    +     * JMX.MBeanOptions opts = new JMX.MBeanOptions();
    +     * opts.setMXBeanMappingFactory(factory);
    +     * StandardMBean mbean = new StandardMBean(impl, intf, opts);
    +     * 
    + * + * @see javax.management.JMX.ProxyOptions + * @see javax.management.StandardMBean.Options + */ + public static class MBeanOptions implements Serializable, Cloneable { + private static final long serialVersionUID = -6380842449318177843L; + + static final MBeanOptions MXBEAN = new MBeanOptions(); + static { + MXBEAN.setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + } + + private MXBeanMappingFactory mappingFactory; + + /** + *

    Construct an {@code MBeanOptions} object where all options have + * their default values.

    + */ + public MBeanOptions() {} + + @Override + public MBeanOptions clone() { + try { + return (MBeanOptions) super.clone(); + } catch (CloneNotSupportedException e) { + throw new AssertionError(e); + } + } + + /** + *

    True if this is an MXBean proxy or a StandardMBean instance + * that is an MXBean. The default value is false.

    + * + *

    This method is equivalent to {@link #getMXBeanMappingFactory() + * this.getMXBeanMappingFactory()}{@code != null}.

    + * + * @return true if this is an MXBean proxy or a StandardMBean instance + * that is an MXBean. + */ + public boolean isMXBean() { + return (this.mappingFactory != null); + } + + /** + *

    The mappings between Java types and Open Types to be used in + * an MXBean proxy or a StandardMBean instance that is an MXBean, + * or null if this instance is not for an MXBean. + * The default value is null.

    + * + * @return the mappings to be used in this proxy or StandardMBean, + * or null if this instance is not for an MXBean. + */ + public MXBeanMappingFactory getMXBeanMappingFactory() { + return mappingFactory; + } + + /** + *

    Set the {@link #getMXBeanMappingFactory() MXBeanMappingFactory} to + * the given value. The value should be null if this instance is not + * for an MXBean. If this instance is for an MXBean, the value should + * usually be either a custom mapping factory, or + * {@link MXBeanMappingFactory#forInterface + * MXBeanMappingFactory.forInterface}{@code (mxbeanInterface)} + * which signifies + * that the {@linkplain MXBeanMappingFactory#DEFAULT default} mapping + * factory should be used unless an {@code @}{@link + * javax.management.openmbean.MXBeanMappingFactoryClass + * MXBeanMappingFactoryClass} annotation on {@code mxbeanInterface} + * specifies otherwise.

    + * + *

    Examples:

    + *
    +         * MBeanOptions opts = new MBeanOptions();
    +         * opts.setMXBeanMappingFactory(myMappingFactory);
    +         * MyMXBean proxy = JMX.newMBeanProxy(
    +         *         mbeanServerConnection, objectName, MyMXBean.class, opts);
    +         *
    +         * // ...or...
    +         *
    +         * MBeanOptions opts = new MBeanOptions();
    +         * MXBeanMappingFactory defaultFactoryForMyMXBean =
    +         *         MXBeanMappingFactory.forInterface(MyMXBean.class);
    +         * opts.setMXBeanMappingFactory(defaultFactoryForMyMXBean);
    +         * MyMXBean proxy = JMX.newMBeanProxy(
    +         *         mbeanServerConnection, objectName, MyMXBean.class, opts);
    +         * 
    + * + * @param f the new value. If null, this instance is not for an + * MXBean. + */ + public void setMXBeanMappingFactory(MXBeanMappingFactory f) { + this.mappingFactory = f; + } + + /* To maximise object sharing, classes in this package can replace + * a private MBeanOptions with no MXBeanMappingFactory with one + * of these shared instances. But they must be EXTREMELY careful + * never to give out the shared instances to user code, which could + * modify them. + */ + private static final MBeanOptions[] CANONICALS = { + new MBeanOptions(), MXBEAN, + }; + // Overridden in local subclasses: + MBeanOptions[] canonicals() { + return CANONICALS; + } + + // This is only used by the logic for canonical instances. + // Overridden in local subclasses: + boolean same(MBeanOptions opt) { + return (opt.mappingFactory == mappingFactory); + } + + final MBeanOptions canonical() { + for (MBeanOptions opt : canonicals()) { + if (opt.getClass() == this.getClass() && same(opt)) + return opt; + } + return this; + } + + final MBeanOptions uncanonical() { + for (MBeanOptions opt : canonicals()) { + if (this == opt) + return clone(); + } + return this; + } + + private Map toMap() { + Map map = new TreeMap(); + try { + BeanInfo bi = java.beans.Introspector.getBeanInfo(getClass()); + PropertyDescriptor[] pds = bi.getPropertyDescriptors(); + for (PropertyDescriptor pd : pds) { + String name = pd.getName(); + if (name.equals("class")) + continue; + Method get = pd.getReadMethod(); + if (get != null) + map.put(name, get.invoke(this)); + } + } catch (Exception e) { + Throwable t = e; + if (t instanceof InvocationTargetException) + t = t.getCause(); + map.put("Exception", t); + } + return map; + } + + @Override + public String toString() { + return getClass().getSimpleName() + toMap(); + // For example "MBeanOptions{MXBean=true, }". + } + + /** + *

    Indicates whether some other object is "equal to" this one. The + * result is true if and only if the other object is also an instance + * of MBeanOptions or a subclass, and has the same properties with + * the same values.

    + * @return {@inheritDoc} + */ + @Override + public boolean equals(Object obj) { + if (obj == this) + return true; + if (obj == null || obj.getClass() != this.getClass()) + return false; + return toMap().equals(((MBeanOptions) obj).toMap()); + } + + @Override + public int hashCode() { + return toMap().hashCode(); + } + } + + /** + *

    Options to apply to an MBean proxy.

    + * + * @see #newMBeanProxy + */ + public static class ProxyOptions extends MBeanOptions { + private static final long serialVersionUID = 7238804866098386559L; + + private boolean notificationEmitter; + + /** + *

    Construct a {@code ProxyOptions} object where all options have + * their default values.

    + */ + public ProxyOptions() {} + + @Override + public ProxyOptions clone() { + return (ProxyOptions) super.clone(); + } + + /** + *

    Defines whether the returned proxy should + * implement {@link NotificationEmitter}. The default value is false.

    + * + * @return true if this proxy will be a NotificationEmitter. + * + * @see JMX#newMBeanProxy(MBeanServerConnection, ObjectName, Class, + * MBeanOptions) + */ + public boolean isNotificationEmitter() { + return this.notificationEmitter; + } + + /** + *

    Set the {@link #isNotificationEmitter NotificationEmitter} option to + * the given value.

    + * @param emitter the new value. + */ + public void setNotificationEmitter(boolean emitter) { + this.notificationEmitter = emitter; + } + + // Canonical objects for each of (MXBean,!MXBean) x (Emitter,!Emitter) + private static final ProxyOptions[] CANONICALS = { + new ProxyOptions(), new ProxyOptions(), + new ProxyOptions(), new ProxyOptions(), + }; + static { + CANONICALS[1].setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + CANONICALS[2].setNotificationEmitter(true); + CANONICALS[3].setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + CANONICALS[3].setNotificationEmitter(true); + } + @Override + MBeanOptions[] canonicals() { + return CANONICALS; + } + + @Override + boolean same(MBeanOptions opt) { + return (super.same(opt) && opt instanceof ProxyOptions && + ((ProxyOptions) opt).notificationEmitter == notificationEmitter); + } + } + /** *

    Make a proxy for a Standard MBean in a local or remote * MBean Server.

    @@ -172,7 +451,7 @@ public class JMX { * *

    This method behaves the same as {@link * #newMBeanProxy(MBeanServerConnection, ObjectName, Class)}, but - * additionally, if {@code notificationBroadcaster} is {@code + * additionally, if {@code notificationEmitter} is {@code * true}, then the MBean is assumed to be a {@link * NotificationBroadcaster} or {@link NotificationEmitter} and the * returned proxy will implement {@link NotificationEmitter} as @@ -189,25 +468,21 @@ public class JMX { * {@code connection} to forward to. * @param interfaceClass the management interface that the MBean * exports, which will also be implemented by the returned proxy. - * @param notificationBroadcaster make the returned proxy + * @param notificationEmitter make the returned proxy * implement {@link NotificationEmitter} by forwarding its methods * via {@code connection}. - * * @param allows the compiler to know that if the {@code * interfaceClass} parameter is {@code MyMBean.class}, for * example, then the return type is {@code MyMBean}. - * * @return the new proxy instance. */ public static T newMBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, - boolean notificationBroadcaster) { - return MBeanServerInvocationHandler.newProxyInstance( - connection, - objectName, - interfaceClass, - notificationBroadcaster); + boolean notificationEmitter) { + ProxyOptions opts = new ProxyOptions(); + opts.setNotificationEmitter(notificationEmitter); + return newMBeanProxy(connection, objectName, interfaceClass, opts); } /** @@ -314,7 +589,7 @@ public class JMX { * *

    This method behaves the same as {@link * #newMXBeanProxy(MBeanServerConnection, ObjectName, Class)}, but - * additionally, if {@code notificationBroadcaster} is {@code + * additionally, if {@code notificationEmitter} is {@code * true}, then the MXBean is assumed to be a {@link * NotificationBroadcaster} or {@link NotificationEmitter} and the * returned proxy will implement {@link NotificationEmitter} as @@ -331,31 +606,105 @@ public class JMX { * {@code connection} to forward to. * @param interfaceClass the MXBean interface, * which will also be implemented by the returned proxy. - * @param notificationBroadcaster make the returned proxy + * @param notificationEmitter make the returned proxy * implement {@link NotificationEmitter} by forwarding its methods * via {@code connection}. - * * @param allows the compiler to know that if the {@code * interfaceClass} parameter is {@code MyMXBean.class}, for * example, then the return type is {@code MyMXBean}. - * * @return the new proxy instance. */ public static T newMXBeanProxy(MBeanServerConnection connection, ObjectName objectName, Class interfaceClass, - boolean notificationBroadcaster) { - // Check interface for MXBean compliance - // + boolean notificationEmitter) { + ProxyOptions opts = new ProxyOptions(); + MXBeanMappingFactory f = MXBeanMappingFactory.forInterface(interfaceClass); + opts.setMXBeanMappingFactory(f); + opts.setNotificationEmitter(notificationEmitter); + return newMBeanProxy(connection, objectName, interfaceClass, opts); + } + + /** + *

    Make a proxy for a Standard MBean or MXBean in a local or remote MBean + * Server that may also support the methods of {@link + * NotificationEmitter} and (for an MXBean) that may define custom MXBean + * type mappings.

    + * + *

    This method behaves the same as + * {@link #newMBeanProxy(MBeanServerConnection, ObjectName, Class)} or + * {@link #newMXBeanProxy(MBeanServerConnection, ObjectName, Class)}, + * according as {@code opts.isMXBean()} is respectively false or true; but + * with the following changes based on {@code opts}.

    + * + *
      + *
    • If {@code opts.isNotificationEmitter()} is {@code + * true}, then the MBean is assumed to be a {@link + * NotificationBroadcaster} or {@link NotificationEmitter} and the + * returned proxy will implement {@link NotificationEmitter} as + * well as {@code interfaceClass}. A call to {@link + * NotificationBroadcaster#addNotificationListener} on the proxy + * will result in a call to {@link + * MBeanServerConnection#addNotificationListener(ObjectName, + * NotificationListener, NotificationFilter, Object)}, and + * likewise for the other methods of {@link + * NotificationBroadcaster} and {@link NotificationEmitter}.
    • + * + *
    • If {@code opts.getMXBeanMappingFactory()} is not null, + * then the mappings it defines will be applied to convert between + * arbitrary Java types and Open Types.
    • + *
    + * + * @param connection the MBean server to forward to. + * @param objectName the name of the MBean within + * {@code connection} to forward to. + * @param interfaceClass the Standard MBean or MXBean interface, + * which will also be implemented by the returned proxy. + * @param opts the options to apply for this proxy. Can be null, + * in which case default options are applied. + * @param allows the compiler to know that if the {@code + * interfaceClass} parameter is {@code MyMXBean.class}, for + * example, then the return type is {@code MyMXBean}. + * @return the new proxy instance. + * + * @throws IllegalArgumentException if {@code interfaceClass} is not a + * valid MXBean interface. + */ + public static T newMBeanProxy(MBeanServerConnection connection, + ObjectName objectName, + Class interfaceClass, + MBeanOptions opts) { try { - Introspector.testComplianceMXBeanInterface(interfaceClass); + return newMBeanProxy2(connection, objectName, interfaceClass, opts); } catch (NotCompliantMBeanException e) { throw new IllegalArgumentException(e); } + } + + private static T newMBeanProxy2(MBeanServerConnection connection, + ObjectName objectName, + Class interfaceClass, + MBeanOptions opts) + throws NotCompliantMBeanException { + + if (opts == null) + opts = new MBeanOptions(); + + boolean notificationEmitter = opts instanceof ProxyOptions && + ((ProxyOptions) opts).isNotificationEmitter(); + + MXBeanMappingFactory mappingFactory = opts.getMXBeanMappingFactory(); + + if (mappingFactory != null) { + // Check interface for MXBean compliance + Introspector.testComplianceMXBeanInterface(interfaceClass, + mappingFactory); + } + InvocationHandler handler = new MBeanServerInvocationHandler( - connection, objectName, true); + connection, objectName, opts); final Class[] interfaces; - if (notificationBroadcaster) { + if (notificationEmitter) { interfaces = new Class[] {interfaceClass, NotificationEmitter.class}; } else @@ -392,4 +741,28 @@ public class JMX { // exactly the string "MXBean" since that would mean there // was no package name, which is pretty unlikely in practice. } + + /** + *

    Test if an MBean can emit notifications. An MBean can emit + * notifications if either it implements {@link NotificationBroadcaster} + * (perhaps through its child interface {@link NotificationEmitter}), or + * it uses resource + * injection to obtain an instance of {@link SendNotification} + * through which it can send notifications.

    + * + * @param mbean an MBean object. + * @return true if the given object is a valid MBean that can emit + * notifications; false if the object is a valid MBean but that + * cannot emit notifications. + * @throws NotCompliantMBeanException if the given object is not + * a valid MBean. + */ + public static boolean isNotificationSource(Object mbean) + throws NotCompliantMBeanException { + if (mbean instanceof NotificationBroadcaster) + return true; + Object resource = (mbean instanceof DynamicWrapperMBean) ? + ((DynamicWrapperMBean) mbean).getWrappedObject() : mbean; + return (MBeanInjector.injectsSendNotification(resource)); + } } diff --git a/jdk/src/share/classes/javax/management/MBean.java b/jdk/src/share/classes/javax/management/MBean.java new file mode 100644 index 00000000000..6837740334c --- /dev/null +++ b/jdk/src/share/classes/javax/management/MBean.java @@ -0,0 +1,68 @@ +/* + * 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 javax.management; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

    Indicates that the annotated class is a Standard MBean. A Standard + * MBean class can be defined as in this example:

    + * + *
    + * {@code @MBean}
    + * public class Configuration {
    + *     {@link ManagedAttribute @ManagedAttribute}
    + *     public int getCacheSize() {...}
    + *     {@code @ManagedAttribute}
    + *     public void setCacheSize(int size);
    + *
    + *     {@code @ManagedAttribute}
    + *     public long getLastChangedTime();
    + *
    + *     {@link ManagedOperation @ManagedOperation}
    + *     public void save();
    + * }
    + * 
    + * + *

    The class must be public. Public methods within the class can be + * annotated with {@code @ManagedOperation} to indicate that they are + * MBean operations. Public getter and setter methods within the class + * can be annotated with {@code @ManagedAttribute} to indicate that they define + * MBean attributes.

    + * + *

    If the MBean is to be an MXBean rather than a Standard MBean, then + * the {@link MXBean @MXBean} annotation must be used instead of + * {@code @MBean}.

    + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Inherited +public @interface MBean { +} diff --git a/jdk/src/share/classes/javax/management/MBeanOperationInfo.java b/jdk/src/share/classes/javax/management/MBeanOperationInfo.java index 9bda3ed5319..5863e96ef39 100644 --- a/jdk/src/share/classes/javax/management/MBeanOperationInfo.java +++ b/jdk/src/share/classes/javax/management/MBeanOperationInfo.java @@ -46,25 +46,30 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable { new MBeanOperationInfo[0]; /** - * Indicates that the operation is read-like, - * it basically returns information. + * Indicates that the operation is read-like: + * it returns information but does not change any state. + * @see Impact#INFO */ public static final int INFO = 0; /** - * Indicates that the operation is a write-like, - * and would modify the MBean in some way, typically by writing some value - * or changing a configuration. + * Indicates that the operation is write-like: it has an effect but does + * not return any information from the MBean. + * @see Impact#ACTION */ public static final int ACTION = 1; /** - * Indicates that the operation is both read-like and write-like. + * Indicates that the operation is both read-like and write-like: + * it has an effect, and it also returns information from the MBean. + * @see Impact#ACTION_INFO */ public static final int ACTION_INFO = 2; /** - * Indicates that the operation has an "unknown" nature. + * Indicates that the impact of the operation is unknown or cannot be + * expressed using one of the other values. + * @see Impact#UNKNOWN */ public static final int UNKNOWN = 3; @@ -120,8 +125,9 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable { * describing the parameters(arguments) of the method. This may be * null with the same effect as a zero-length array. * @param type The type of the method's return value. - * @param impact The impact of the method, one of INFO, - * ACTION, ACTION_INFO, UNKNOWN. + * @param impact The impact of the method, one of + * {@link #INFO}, {@link #ACTION}, {@link #ACTION_INFO}, + * {@link #UNKNOWN}. */ public MBeanOperationInfo(String name, String description, @@ -140,8 +146,9 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable { * describing the parameters(arguments) of the method. This may be * null with the same effect as a zero-length array. * @param type The type of the method's return value. - * @param impact The impact of the method, one of INFO, - * ACTION, ACTION_INFO, UNKNOWN. + * @param impact The impact of the method, one of + * {@link #INFO}, {@link #ACTION}, {@link #ACTION_INFO}, + * {@link #UNKNOWN}. * @param descriptor The descriptor for the operation. This may be null * which is equivalent to an empty descriptor. * @@ -319,9 +326,14 @@ public class MBeanOperationInfo extends MBeanFeatureInfo implements Cloneable { for (int i = 0; i < classes.length; i++) { Descriptor d = Introspector.descriptorForAnnotations(annots[i]); - final String pn = "p" + (i + 1); - params[i] = - new MBeanParameterInfo(pn, classes[i].getName(), "", d); + String description = Introspector.descriptionForParameter(annots[i]); + if (description == null) + description = ""; + String name = Introspector.nameForParameter(annots[i]); + if (name == null) + name = "p" + (i + 1); + params[i] = new MBeanParameterInfo( + name, classes[i].getName(), description, d); } return params; diff --git a/jdk/src/share/classes/javax/management/MBeanRegistration.java b/jdk/src/share/classes/javax/management/MBeanRegistration.java index fbdedc183b7..1ba1c0d827f 100644 --- a/jdk/src/share/classes/javax/management/MBeanRegistration.java +++ b/jdk/src/share/classes/javax/management/MBeanRegistration.java @@ -27,9 +27,101 @@ package javax.management; /** - * Can be implemented by an MBean in order to + *

    Can be implemented by an MBean in order to * carry out operations before and after being registered or unregistered from - * the MBean server. + * the MBean Server. An MBean can also implement this interface in order + * to get a reference to the MBean Server and/or its name within that + * MBean Server.

    + * + *

    Resource injection

    + * + *

    As an alternative to implementing {@code MBeanRegistration}, if all that + * is needed is the MBean Server or ObjectName then an MBean can use + * resource injection.

    + * + *

    If a field in the MBean object has type {@link ObjectName} and has + * the {@link javax.annotation.Resource @Resource} annotation, + * then the {@code ObjectName} under which the MBean is registered is + * assigned to that field during registration. Likewise, if a field has type + * {@link MBeanServer} and the @Resource annotation, then it will + * be set to the {@code MBeanServer} in which the MBean is registered.

    + * + *

    For example:

    + * + *
    + * public Configuration implements ConfigurationMBean {
    + *     @Resource
    + *     private volatile MBeanServer mbeanServer;
    + *     @Resource
    + *     private volatile ObjectName objectName;
    + *     ...
    + *     void unregisterSelf() throws Exception {
    + *         mbeanServer.unregisterMBean(objectName);
    + *     }
    + * }
    + * 
    + * + *

    Resource injection can also be used on fields of type + * {@link SendNotification} to simplify notification sending. Such a field + * will get a reference to an object of type {@code SendNotification} when + * the MBean is registered, and it can use this reference to send notifications. + * For example:

    + * + *
    + * public Configuration implements ConfigurationMBean {
    + *     @Resource
    + *     private volatile SendNotification sender;
    + *     ...
    + *     private void updated() {
    + *         Notification n = new Notification(...);
    + *         sender.sendNotification(n);
    + *     }
    + * }
    + * 
    + * + *

    A field to be injected must not be static. It is recommended that + * such fields be declared {@code volatile}.

    + * + *

    It is also possible to use the @Resource annotation on + * methods. Such a method must have a {@code void} return type and a single + * argument of the appropriate type, for example {@code ObjectName}.

    + * + *

    Any number of fields and methods may have the @Resource + * annotation. All fields and methods with type {@code ObjectName} + * (for example) will receive the same {@code ObjectName} value.

    + * + *

    Resource injection is available for all types of MBeans, not just + * Standard MBeans.

    + * + *

    If an MBean implements the {@link DynamicWrapperMBean} interface then + * resource injection happens on the object returned by that interface's + * {@link DynamicWrapperMBean#getWrappedObject() getWrappedObject()} method + * rather than on the MBean object itself. + * + *

    Resource injection happens after the {@link #preRegister preRegister} + * method is called (if any), and before the MBean is actually registered + * in the MBean Server. If a @Resource method throws + * an exception, the effect is the same as if {@code preRegister} had + * thrown the exception. In particular it will prevent the MBean from being + * registered.

    + * + *

    Resource injection can be used on a field or method where the type + * is a parent of the injected type, if the injected type is explicitly + * specified in the @Resource annotation. For example:

    + * + *
    + *     @Resource(type = MBeanServer.class)
    + *     private volatile MBeanServerConnection mbsc;
    + * 
    + * + *

    Formally, suppose R is the type in the @Resource + * annotation and T is the type of the method parameter or field. + * Then one of R and T must be a subtype of the other + * (or they must be the same type). Injection happens if this subtype + * is {@code MBeanServer}, {@code ObjectName}, or {@code SendNotification}. + * Otherwise the @Resource annotation is ignored.

    + * + *

    Resource injection in MBeans is new in version 2.0 of the JMX API.

    * * @since 1.5 */ @@ -38,12 +130,12 @@ public interface MBeanRegistration { /** * Allows the MBean to perform any operations it needs before - * being registered in the MBean server. If the name of the MBean + * being registered in the MBean Server. If the name of the MBean * is not specified, the MBean can provide a name for its * registration. If any exception is raised, the MBean will not be - * registered in the MBean server. + * registered in the MBean Server. * - * @param server The MBean server in which the MBean will be registered. + * @param server The MBean Server in which the MBean will be registered. * * @param name The object name of the MBean. This name is null if * the name parameter to one of the createMBean or @@ -57,7 +149,7 @@ public interface MBeanRegistration { * the returned value. * * @exception java.lang.Exception This exception will be caught by - * the MBean server and re-thrown as an {@link + * the MBean Server and re-thrown as an {@link * MBeanRegistrationException}. */ public ObjectName preRegister(MBeanServer server, diff --git a/jdk/src/share/classes/javax/management/MBeanServer.java b/jdk/src/share/classes/javax/management/MBeanServer.java index 728f71340ba..f0d4d16c46f 100644 --- a/jdk/src/share/classes/javax/management/MBeanServer.java +++ b/jdk/src/share/classes/javax/management/MBeanServer.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -61,7 +61,7 @@ import javax.management.loading.ClassLoaderRepository; * ObjectName is:
    * JMImplementation:type=MBeanServerDelegate.

    * - *

    An object obtained from the {@link + *

    An object obtained from the {@link * MBeanServerFactory#createMBeanServer(String) createMBeanServer} or * {@link MBeanServerFactory#newMBeanServer(String) newMBeanServer} * methods of the {@link MBeanServerFactory} class applies security @@ -661,13 +661,16 @@ public interface MBeanServer extends MBeanServerConnection { ReflectionException; /** - *

    Return the {@link java.lang.ClassLoader} that was used for - * loading the class of the named MBean.

    + *

    Return the {@link java.lang.ClassLoader} that was used for loading + * the class of the named MBean. If the MBean implements the {@link + * DynamicWrapperMBean} interface, then the returned value is the + * result of the {@link DynamicWrapperMBean#getWrappedClassLoader()} + * method.

    * * @param mbeanName The ObjectName of the MBean. * * @return The ClassLoader used for that MBean. If l - * is the MBean's actual ClassLoader, and r is the + * is the value specified by the rules above, and r is the * returned value, then either: * *
      diff --git a/jdk/src/share/classes/javax/management/MBeanServerConnection.java b/jdk/src/share/classes/javax/management/MBeanServerConnection.java index 852ab83d890..4047373c261 100644 --- a/jdk/src/share/classes/javax/management/MBeanServerConnection.java +++ b/jdk/src/share/classes/javax/management/MBeanServerConnection.java @@ -839,6 +839,12 @@ public interface MBeanServerConnection { * *

      Otherwise, the result is false.

      * + *

      If the MBean implements the {@link DynamicWrapperMBean} + * interface, then in the above rules X is the result of the MBean's {@link + * DynamicWrapperMBean#getWrappedObject() getWrappedObject()} method and L + * is the result of its {@link DynamicWrapperMBean#getWrappedClassLoader() + * getWrappedClassLoader()} method. + * * @param name The ObjectName of the MBean. * @param className The name of the class. * diff --git a/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java b/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java index fb5d4bd25e0..f111e577bf1 100644 --- a/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java +++ b/jdk/src/share/classes/javax/management/MBeanServerInvocationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 @@ -33,6 +33,9 @@ import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Arrays; import java.util.WeakHashMap; +import javax.management.openmbean.MXBeanMappingFactory; + +import static javax.management.JMX.MBeanOptions; /** *

      {@link InvocationHandler} that forwards methods in an MBean's @@ -111,7 +114,7 @@ public class MBeanServerInvocationHandler implements InvocationHandler { public MBeanServerInvocationHandler(MBeanServerConnection connection, ObjectName objectName) { - this(connection, objectName, false); + this(connection, objectName, null); } /** @@ -138,6 +141,14 @@ public class MBeanServerInvocationHandler implements InvocationHandler { public MBeanServerInvocationHandler(MBeanServerConnection connection, ObjectName objectName, boolean isMXBean) { + this(connection, objectName, isMXBean ? MBeanOptions.MXBEAN : null); + } + + public MBeanServerInvocationHandler(MBeanServerConnection connection, + ObjectName objectName, + MBeanOptions options) { + if (options == null) + options = new MBeanOptions(); if (connection == null) { throw new IllegalArgumentException("Null connection"); } @@ -146,7 +157,7 @@ public class MBeanServerInvocationHandler implements InvocationHandler { } this.connection = connection; this.objectName = objectName; - this.isMXBean = isMXBean; + this.options = options.canonical(); } /** @@ -182,7 +193,16 @@ public class MBeanServerInvocationHandler implements InvocationHandler { * @since 1.6 */ public boolean isMXBean() { - return isMXBean; + return options.isMXBean(); + } + + /** + *

      Return the {@link MBeanOptions} used for this proxy.

      + * + * @return the MBeanOptions. + */ + public MBeanOptions getMBeanOptions() { + return options.uncanonical(); } /** @@ -260,7 +280,7 @@ public class MBeanServerInvocationHandler implements InvocationHandler { return doLocally(proxy, method, args); try { - if (isMXBean) { + if (isMXBean()) { MXBeanProxy p = findMXBeanProxy(methodClass); return p.invoke(connection, objectName, method, args); } else { @@ -326,21 +346,34 @@ public class MBeanServerInvocationHandler implements InvocationHandler { */ } - private static MXBeanProxy findMXBeanProxy(Class mxbeanInterface) { + private MXBeanProxy findMXBeanProxy(Class mxbeanInterface) { + MXBeanMappingFactory mappingFactory = options.getMXBeanMappingFactory(); synchronized (mxbeanProxies) { - WeakReference proxyRef = - mxbeanProxies.get(mxbeanInterface); - MXBeanProxy p = (proxyRef == null) ? null : proxyRef.get(); - if (p == null) { - p = new MXBeanProxy(mxbeanInterface); - mxbeanProxies.put(mxbeanInterface, - new WeakReference(p)); + ClassToProxy classToProxy = mxbeanProxies.get(mappingFactory); + if (classToProxy == null) { + classToProxy = new ClassToProxy(); + mxbeanProxies.put(mappingFactory, classToProxy); } + WeakReference wr = classToProxy.get(mxbeanInterface); + MXBeanProxy p; + if (wr != null) { + p = wr.get(); + if (p != null) + return p; + } + p = new MXBeanProxy(mxbeanInterface, mappingFactory); + classToProxy.put(mxbeanInterface, new WeakReference(p)); return p; } } - private static final WeakHashMap, WeakReference> - mxbeanProxies = new WeakHashMap, WeakReference>(); + private static final WeakHashMap + mxbeanProxies = newWeakHashMap(); + private static class ClassToProxy + extends WeakHashMap, WeakReference> {} + + private static WeakHashMap newWeakHashMap() { + return new WeakHashMap(); + } private Object invokeBroadcasterMethod(Object proxy, Method method, Object[] args) throws Exception { @@ -453,7 +486,7 @@ public class MBeanServerInvocationHandler implements InvocationHandler { objectName.equals(handler.objectName) && proxy.getClass().equals(args[0].getClass()); } else if (methodName.equals("toString")) { - return (isMXBean ? "MX" : "M") + "BeanProxy(" + + return (isMXBean() ? "MX" : "M") + "BeanProxy(" + connection + "[" + objectName + "])"; } else if (methodName.equals("hashCode")) { return objectName.hashCode()+connection.hashCode(); @@ -484,5 +517,5 @@ public class MBeanServerInvocationHandler implements InvocationHandler { private final MBeanServerConnection connection; private final ObjectName objectName; - private final boolean isMXBean; + private final MBeanOptions options; } diff --git a/jdk/src/share/classes/javax/management/MXBean.java b/jdk/src/share/classes/javax/management/MXBean.java index 166ea57a3d4..a577fd94ff5 100644 --- a/jdk/src/share/classes/javax/management/MXBean.java +++ b/jdk/src/share/classes/javax/management/MXBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -27,6 +27,7 @@ package javax.management; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @@ -44,6 +45,10 @@ import javax.management.openmbean.CompositeDataInvocationHandler; import javax.management.openmbean.CompositeDataSupport; import javax.management.openmbean.CompositeDataView; import javax.management.openmbean.CompositeType; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingClass; +import javax.management.openmbean.MXBeanMappingFactory; +import javax.management.openmbean.MXBeanMappingFactoryClass; import javax.management.openmbean.OpenDataException; import javax.management.openmbean.OpenMBeanInfo; import javax.management.openmbean.OpenType; @@ -53,11 +58,13 @@ import javax.management.openmbean.TabularDataSupport; import javax.management.openmbean.TabularType; /** -

      Annotation to mark an interface explicitly as being an MXBean - interface, or as not being an MXBean interface. By default, an +

      Annotation to mark a class or interface explicitly as being an MXBean, + or as not being an MXBean. By default, an interface is an MXBean interface if its name ends with {@code - MXBean}, as in {@code SomethingMXBean}. The following interfaces - are MXBean interfaces:

      + MXBean}, as in {@code SomethingMXBean}. A class is never an MXBean by + default.

      + +

      The following interfaces are MXBean interfaces:

           public interface WhatsitMXBean {}
      @@ -78,7 +85,12 @@ import javax.management.openmbean.TabularType;
           public interface MisleadingMXBean {}
           
      -

      MXBean specification

      +

      A class can be annotated with {@code @MXBean} to indicate that it + is an MXBean. In this case, its methods should have @{@link + ManagedAttribute} or @{@link ManagedOperation} + annotations, as described for @{@link MBean}.

      + +

      MXBean specification

      The MXBean concept provides a simple way to code an MBean that only references a predefined set of types, the ones defined @@ -314,7 +326,7 @@ public class MemoryPool -

      Definition of an MXBean

      +

      Definition of an MXBean

      An MXBean is a kind of MBean. An MXBean object can be registered directly in the MBean Server, or it can be used as an @@ -367,7 +379,7 @@ public class MemoryPool above rules will produce an exception.

      -

      Naming conventions

      +

      Naming conventions

      The same naming conventions are applied to the methods in an MXBean as in a Standard MBean:

      @@ -413,7 +425,7 @@ public class MemoryPool read-only or write-only respectively.

      -

      Type mapping rules

      +

      Type mapping rules

      An MXBean is a kind of Open MBean, as defined by the {@link javax.management.openmbean} package. This means that the types of @@ -475,7 +487,11 @@ public class MemoryPool from type opendata(J) to type J, a null value is mapped to a null value.

      -

      The following table summarizes the type mapping rules.

      +

      In addition to the default type mapping rules, you can specify + custom type mappings, as described below.

      + +

      The following table summarizes the default type mapping rules.

      @@ -658,7 +674,7 @@ TabularType tabularType = TabularData} that serializes as {@code TabularDataSupport}.

      -

      Mappings for MXBean interfaces

      +

      Mappings for MXBean interfaces

      An MXBean interface, or a type referenced within an MXBean interface, can reference another MXBean interface, J. @@ -747,7 +763,7 @@ public interface ModuleMXBean { general, notably because it does not work well for MBeans that are {@link NotificationBroadcaster}s.

      -

      Mappings for other types

      +

      Mappings for other types

      Given a Java class or interface J that does not match the other rules in the table above, the MXBean framework will attempt to map @@ -1035,6 +1051,76 @@ public interface Node { } +

      Alternatively, you can define a custom mapping for your recursive + type; see the next section.

      + +

      Custom MXBean type mappings

      + +

      You can augment or replace the default type mappings described + above with custom mappings. An example appears in the + documentation for {@link MXBeanMapping}.

      + +

      If an MXBean uses custom mappings, then an MXBean proxy for + that MXBean must use the same mappings for correct behavior. + This requires more careful synchronization between client and + server than is necessary with the default mappings. For example + it typically requires the client to have the same implementation + of any {@link MXBeanMapping} subclasses as the server. For this + reason, custom mappings should be avoided if possible.

      + +

      Every MXBean has an associated {@link MXBeanMappingFactory}. + Call this f. Then every type that appears + in that MXBean has an associated {@link MXBeanMapping} + determined by f. If the type is + J, say, then the mapping is {@link + MXBeanMappingFactory#mappingForType + f.mappingForType}(J, + f).

      + +

      The {@code MXBeanMappingFactory} f for an + MXBean is determined as follows.

      + +
        +
      • If an {@link JMX.MBeanOptions} argument is supplied to + the {@link StandardMBean} constructor that makes an MXBean, + or to the {@link JMX#newMXBeanProxy JMX.newMXBeanProxy} + method, and the {@code MBeanOptions} object defines a non-null + {@code MXBeanMappingFactory}, then that is the value of + f.

      • + +
      • Otherwise, if the MXBean interface has an {@link + MXBeanMappingFactoryClass} annotation, then that annotation + must identify a subclass of {@code MXBeanMappingFactory} + with a no-argument constructor. Then + f is the result of calling this + constructor. If the class does not have a no-argument + constructor, or if calling the constructor produces an + exception, then the MXBean is invalid and an attempt to + register it in the MBean Server will produce a {@link + NotCompliantMBeanException}.

        + +

        This annotation is not inherited from any parent + interfaces. If an MXBean interface has this annotation, + then usually any MXBean subinterfaces must repeat the same + annotation for correct behavior.

      • + +
      • Otherwise, if the package in which the MXBean interface + appears has an {@code MXBeanMappingFactoryClass} annotation, + then f is determined as if that + annotation appeared on the MXBean interface.

      • + +
      • Otherwise, f is the default mapping + factory, {@link MXBeanMappingFactory#DEFAULT}.

      • +
      + +

      The default mapping factory recognizes the {@link + MXBeanMappingClass} annotation on a class or interface. If + J is a class or interface that has such an + annotation, then the {@code MXBeanMapping} for + J produced by the default mapping factory + will be determined by the value of the annotation as described + in its {@linkplain MXBeanMappingClass documentation}.

      +

      MBeanInfo contents for an MXBean

      An MXBean is a type of Open MBean. However, for compatibility @@ -1091,7 +1177,7 @@ public interface Node { {@code mxbean} whose value is the string "{@code true}".

      -

      Type Names

      +

      Type Names

      Sometimes the unmapped type T of a method parameter or return value in an MXBean must be represented as a string. If @@ -1163,12 +1249,29 @@ public interface Node { appropriate), or C is true of e.{@link Throwable#getCause() getCause()}".

      + @see MXBeanMapping + @since 1.6 */ +/* + * This annotation is @Inherited because if an MXBean is defined as a + * class using annotations, then its subclasses are also MXBeans. + * For example: + * @MXBean + * public class Super { + * @ManagedAttribute + * public String getName() {...} + * } + * public class Sub extends Super {} + * Here Sub is an MXBean. + * + * The @Inherited annotation has no effect when applied to an interface. + */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) +@Inherited public @interface MXBean { /** True if the annotated interface is an MXBean interface. diff --git a/jdk/src/share/classes/javax/management/ManagedAttribute.java b/jdk/src/share/classes/javax/management/ManagedAttribute.java new file mode 100644 index 00000000000..a8a7299d6f9 --- /dev/null +++ b/jdk/src/share/classes/javax/management/ManagedAttribute.java @@ -0,0 +1,64 @@ +/* + * 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 javax.management; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

      Indicates that a method in an MBean class defines an MBean attribute. + * This annotation must be applied to a public method of a public class + * that is itself annotated with an {@link MBean @MBean} or + * {@link MXBean @MXBean} annotation, or inherits such an annotation from + * a superclass.

      + * + *

      The annotated method must be a getter or setter. In other words, + * it must look like one of the following...

      + * + *
      + * T getFoo()
      + * void setFoo(T param)
      + * 
      + * + *

      ...where {@code T} is any type and {@code Foo} is the + * name of the attribute. For any attribute {@code Foo}, if only + * a {@code get}{@code Foo} method has a {@code ManagedAttribute} + * annotation, then {@code Foo} is a read-only attribute. If only + * a {@code set}{@code Foo} method has a {@code ManagedAttribute} + * annotation, then {@code Foo} is a write-only attribute. If + * both {@code get}{@code Foo} and {@code set}{@code Foo} + * methods have the annotation, then {@code Foo} is a read-write + * attribute. In this last case, the type {@code T} must be the + * same in both methods.

      + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@Documented +public @interface ManagedAttribute { +} diff --git a/jdk/src/share/classes/javax/management/ManagedOperation.java b/jdk/src/share/classes/javax/management/ManagedOperation.java new file mode 100644 index 00000000000..fa01ac2bff6 --- /dev/null +++ b/jdk/src/share/classes/javax/management/ManagedOperation.java @@ -0,0 +1,67 @@ +/* + * 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 javax.management; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

      Indicates that a method in an MBean class defines an MBean operation. + * This annotation can be applied to:

      + * + *
        + *
      • A public method of a public class + * that is itself annotated with an {@link MBean @MBean} or + * {@link MXBean @MXBean} annotation, or inherits such an annotation from + * a superclass.
      • + *
      • A method of an MBean or MXBean interface. + *
      + * + *

      Every method in an MBean or MXBean interface defines an MBean + * operation even without this annotation, but the annotation allows + * you to specify the impact of the operation:

      + * + *
      + * public interface ConfigurationMBean {
      + *     {@code @ManagedOperation}(impact = {@link Impact#ACTION Impact.ACTION})
      + *     public void save();
      + *     ...
      + * }
      + * 
      + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@Documented +public @interface ManagedOperation { + /** + *

      The impact of this operation, as shown by + * {@link MBeanOperationInfo#getImpact()}. + */ + Impact impact() default Impact.UNKNOWN; +} diff --git a/jdk/src/share/classes/javax/management/MatchQueryExp.java b/jdk/src/share/classes/javax/management/MatchQueryExp.java index 779fac1989f..61ae29bac2b 100644 --- a/jdk/src/share/classes/javax/management/MatchQueryExp.java +++ b/jdk/src/share/classes/javax/management/MatchQueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -109,36 +109,7 @@ class MatchQueryExp extends QueryEval implements QueryExp { * Returns the string representing the object */ public String toString() { - return exp + " like " + new StringValueExp(likeTranslate(pattern)); - } - - private static String likeTranslate(String s) { - StringBuilder sb = new StringBuilder(); - int c; - for (int i = 0; i < s.length(); i += Character.charCount(c)) { - c = s.codePointAt(i); - switch (c) { - case '\\': - i += Character.charCount(c); - sb.append('\\'); - if (i < s.length()) { - c = s.codePointAt(i); - sb.appendCodePoint(c); - } - break; - case '*': - sb.append('%'); break; - case '?': - sb.append('_'); break; - case '%': - sb.append("\\%"); break; - case '_': - sb.append("\\_"); break; - default: - sb.appendCodePoint(c); break; - } - } - return sb.toString(); + return exp + " like " + new StringValueExp(pattern); } /* diff --git a/jdk/src/share/classes/javax/management/NotQueryExp.java b/jdk/src/share/classes/javax/management/NotQueryExp.java index 25bdd5d60d1..bb39fbc95f7 100644 --- a/jdk/src/share/classes/javax/management/NotQueryExp.java +++ b/jdk/src/share/classes/javax/management/NotQueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -91,6 +91,7 @@ class NotQueryExp extends QueryEval implements QueryExp { return "not (" + exp + ")"; } + @Override String toQueryString() { return "not (" + Query.toString(exp) + ")"; } diff --git a/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java b/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java index 65064ab900e..a358a7012a2 100644 --- a/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java +++ b/jdk/src/share/classes/javax/management/NotificationBroadcasterSupport.java @@ -58,7 +58,8 @@ import com.sun.jmx.remote.util.ClassLogger; * * @since 1.5 */ -public class NotificationBroadcasterSupport implements NotificationEmitter { +public class NotificationBroadcasterSupport + implements NotificationEmitter, SendNotification { /** * Constructs a NotificationBroadcasterSupport where each listener is invoked by the * thread sending the notification. This constructor is equivalent to diff --git a/jdk/src/share/classes/javax/management/NotificationInfo.java b/jdk/src/share/classes/javax/management/NotificationInfo.java new file mode 100644 index 00000000000..a899346c06b --- /dev/null +++ b/jdk/src/share/classes/javax/management/NotificationInfo.java @@ -0,0 +1,117 @@ +/* + * 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 javax.management; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

      Specifies the kinds of notification an MBean can emit. In both the + * following examples, the MBean emits notifications of type + * {@code "com.example.notifs.create"} and of type + * {@code "com.example.notifs.destroy"}:

      + * + *
      + * // Example one: a Standard MBean
      + * {@code @NotificationInfo}(types={"com.example.notifs.create",
      + *                          "com.example.notifs.destroy"})
      + * public interface CacheMBean {...}
      + *
      + * public class Cache implements CacheMBean {...}
      + * 
      + * + *
      + * // Example two: an annotated MBean
      + * {@link MBean @MBean}
      + * {@code @NotificationInfo}(types={"com.example.notifs.create",
      + *                          "com.example.notifs.destroy"})
      + * public class Cache {...}
      + * 
      + * + *

      Each {@code @NotificationInfo} produces an {@link + * MBeanNotificationInfo} inside the {@link MBeanInfo} of each MBean + * to which the annotation applies.

      + * + *

      If you need to specify different notification classes, or different + * descriptions for different notification types, then you can group + * several {@code @NotificationInfo} annotations into a containing + * {@link NotificationInfos @NotificationInfos} annotation. + * + *

      The {@code NotificationInfo} and {@code NotificationInfos} + * annotations can be applied to the MBean implementation class, or to + * any parent class or interface. These annotations on a class take + * precedence over annotations on any superclass or superinterface. + * If an MBean does not have these annotations on its class or any + * superclass, then superinterfaces are examined. It is an error for + * more than one superinterface to have these annotations, unless one + * of them is a child of all the others.

      + */ +@Documented +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface NotificationInfo { + /** + *

      The {@linkplain Notification#getType() notification types} + * that this MBean can emit.

      + */ + String[] types(); + + /** + *

      The class that emitted notifications will have. It is recommended + * that this be {@link Notification}, or one of its standard subclasses + * in the JMX API.

      + */ + Class notificationClass() default Notification.class; + + /** + *

      The description of this notification. For example: + * + *

      +     * {@code @NotificationInfo}(
      +     *         types={"com.example.notifs.create"},
      +     *         description={@code @Description}("object created"))
      +     * 
      + */ + Description description() default @Description(""); + + /** + *

      Additional descriptor fields for the derived {@code + * MBeanNotificationInfo}. They are specified in the same way as + * for the {@link DescriptorFields @DescriptorFields} annotation, + * for example:

      + *
      +     * {@code @NotificationInfo}(
      +     *         types={"com.example.notifs.create"},
      +     *         descriptorFields={"severity=6"})
      +     * 
      + */ + String[] descriptorFields() default {}; +} diff --git a/jdk/src/share/classes/javax/management/NotificationInfos.java b/jdk/src/share/classes/javax/management/NotificationInfos.java new file mode 100644 index 00000000000..9d7c497a78d --- /dev/null +++ b/jdk/src/share/classes/javax/management/NotificationInfos.java @@ -0,0 +1,72 @@ +/* + * 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 javax.management; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import javax.management.remote.JMXConnectionNotification; + +/** + *

      Specifies the kinds of notification an MBean can emit, when this + * cannot be represented by a single {@link NotificationInfo + * @NotificationInfo} annotation.

      + * + *

      For example, this annotation specifies that an MBean can emit + * {@link AttributeChangeNotification} and {@link + * JMXConnectionNotification}:

      + * + *
      + * {@code @NotificationInfos}(
      + *     {@code @NotificationInfo}(
      + *         types = {{@link AttributeChangeNotification#ATTRIBUTE_CHANGE}},
      + *         notificationClass = AttributeChangeNotification.class),
      + *     {@code @NotificationInfo}(
      + *         types = {{@link JMXConnectionNotification#OPENED},
      + *                  {@link JMXConnectionNotification#CLOSED}},
      + *         notificationClass = JMXConnectionNotification.class)
      + * )
      + * 
      + * + *

      If an MBean has both {@code NotificationInfo} and {@code + * NotificationInfos} on the same class or interface, the effect is + * the same as if the {@code NotificationInfo} were moved inside the + * {@code NotificationInfos}.

      + */ +@Documented +@Inherited +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface NotificationInfos { + /** + *

      The {@link NotificationInfo} annotations.

      + */ + NotificationInfo[] value(); +} diff --git a/jdk/src/share/classes/javax/management/NumericValueExp.java b/jdk/src/share/classes/javax/management/NumericValueExp.java index a4e6d340b5d..5f373725168 100644 --- a/jdk/src/share/classes/javax/management/NumericValueExp.java +++ b/jdk/src/share/classes/javax/management/NumericValueExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/ObjectName.java b/jdk/src/share/classes/javax/management/ObjectName.java index 2844f70e695..b45e9406e2b 100644 --- a/jdk/src/share/classes/javax/management/ObjectName.java +++ b/jdk/src/share/classes/javax/management/ObjectName.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -1781,7 +1781,7 @@ public class ObjectName implements Comparable, QueryExp { } String toQueryString() { - return "LIKE " + Query.value(toString()); + return "like " + Query.value(toString()); } /** diff --git a/jdk/src/share/classes/javax/management/OrQueryExp.java b/jdk/src/share/classes/javax/management/OrQueryExp.java index f2123b8afcf..4eca43f8a97 100644 --- a/jdk/src/share/classes/javax/management/OrQueryExp.java +++ b/jdk/src/share/classes/javax/management/OrQueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/QualifiedAttributeValueExp.java b/jdk/src/share/classes/javax/management/QualifiedAttributeValueExp.java index 3934d27084f..9ed8e6dccc5 100644 --- a/jdk/src/share/classes/javax/management/QualifiedAttributeValueExp.java +++ b/jdk/src/share/classes/javax/management/QualifiedAttributeValueExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/Query.java b/jdk/src/share/classes/javax/management/Query.java index fbfae6c2015..e3a140e7d97 100644 --- a/jdk/src/share/classes/javax/management/Query.java +++ b/jdk/src/share/classes/javax/management/Query.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -108,13 +108,13 @@ package javax.management; *
      Selects MBeans that have a {@code Status} attribute whose value * is one of those three strings. * - *
      {@code Message like 'OK: %'} + *
      {@code Message like 'OK: *'} *
      Selects MBeans that have a {@code Message} attribute whose value * is a string beginning with {@code "OK: "}. Notice that the - * wildcard characters are SQL's ones. In the query language, + * wildcard characters are not the ones that SQL uses. In SQL, * {@code %} means "any sequence of characters" and {@code _} - * means "any single character". In the rest of the JMX API, these - * correspond to {@code *} and {@code %} respectively. + * means "any single character". Here, as in the rest of the JMX API, + * those are represented by {@code *} and {@code ?} respectively. * *
      {@code instanceof 'javax.management.NotificationBroadcaster'} *
      Selects MBeans that are instances of @@ -319,11 +319,11 @@ package javax.management; * *
      value LIKE stringLiteral * {@link Query#match Query.match}(q(value), - * translateWildcards(q(stringLiteral))) + * q(stringLiteral)) * *
      value NOT LIKE stringLiteral * {@link Query#not Query.not}({@link Query#match Query.match}(q(value), - * translateWildcards(q(stringLiteral)))) + * q(stringLiteral))) * *
      value1 + value2 * {@link Query#plus Query.plus}(q(value1), q(value2)) @@ -360,13 +360,6 @@ package javax.management; * -->floatingPointLiteral)) *
      * - *

      Here, translateWildcards is a function - * that translates from the SQL notation for wildcards, using {@code %} and - * {@code _}, to the JMX API notation, using {@code *} and {@code ?}. If the - * LIKE string already contains {@code *} or {@code ?}, these characters - * have their literal meanings, and will be quoted in the call to - * {@link Query#match Query.match}.

      - * * @since 1.5 */ public class Query extends Object { diff --git a/jdk/src/share/classes/javax/management/QueryEval.java b/jdk/src/share/classes/javax/management/QueryEval.java index 68e1a1e4893..ee781ab0c33 100644 --- a/jdk/src/share/classes/javax/management/QueryEval.java +++ b/jdk/src/share/classes/javax/management/QueryEval.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/QueryExp.java b/jdk/src/share/classes/javax/management/QueryExp.java index 217db104249..d44a5d9167f 100644 --- a/jdk/src/share/classes/javax/management/QueryExp.java +++ b/jdk/src/share/classes/javax/management/QueryExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/QueryNotificationFilter.java b/jdk/src/share/classes/javax/management/QueryNotificationFilter.java index c6c10393902..42451088f2e 100644 --- a/jdk/src/share/classes/javax/management/QueryNotificationFilter.java +++ b/jdk/src/share/classes/javax/management/QueryNotificationFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -43,12 +43,6 @@ import java.util.Set; * on both the client and the server in the remote case, so using this class * instead is recommended where possible.

      * - * - * *

      This class uses the {@linkplain Query Query API} to specify the * filtering logic. For example, to select only notifications where the * {@linkplain Notification#getType() type} is {@code "com.example.mytype"}, diff --git a/jdk/src/share/classes/javax/management/QueryParser.java b/jdk/src/share/classes/javax/management/QueryParser.java index 5e24e3bfbd3..babf05c7a20 100644 --- a/jdk/src/share/classes/javax/management/QueryParser.java +++ b/jdk/src/share/classes/javax/management/QueryParser.java @@ -490,8 +490,7 @@ class QueryParser { } AttributeValueExp alhs = (AttributeValueExp) lhs; StringValueExp sve = stringvalue(); - String s = sve.getValue(); - q = Query.match(alhs, patternValueExp(s)); + q = Query.match(alhs, sve); break; } @@ -624,40 +623,4 @@ class QueryParser { throw new IllegalArgumentException("Expected string: " + t); return Query.value(t.string); } - - // Convert the SQL pattern syntax, using % and _, to the Query.match - // syntax, using * and ?. The tricky part is recognizing \% and - // \_ as literal values, and also not replacing them inside []. - // But Query.match does not recognize \ inside [], which makes our - // job a tad easier. - private StringValueExp patternValueExp(String s) { - int c; - for (int i = 0; i < s.length(); i += Character.charCount(c)) { - c = s.codePointAt(i); - switch (c) { - case '\\': - i++; // i += Character.charCount(c), but we know it's 1! - if (i >= s.length()) - throw new IllegalArgumentException("\\ at end of pattern"); - break; - case '[': - i = s.indexOf(']', i); - if (i < 0) - throw new IllegalArgumentException("[ without ]"); - break; - case '%': - s = s.substring(0, i) + "*" + s.substring(i + 1); - break; - case '_': - s = s.substring(0, i) + "?" + s.substring(i + 1); - break; - case '*': - case '?': - s = s.substring(0, i) + '\\' + (char) c + s.substring(i + 1); - i++; - break; - } - } - return Query.value(s); - } } diff --git a/jdk/src/share/classes/javax/management/SendNotification.java b/jdk/src/share/classes/javax/management/SendNotification.java new file mode 100644 index 00000000000..e2875d4f121 --- /dev/null +++ b/jdk/src/share/classes/javax/management/SendNotification.java @@ -0,0 +1,38 @@ +/* + * 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 javax.management; + +/** + * Interface implemented by objects that can be asked to send a notification. + */ +public interface SendNotification { + /** + * Sends a notification. + * + * @param notification The notification to send. + */ + public void sendNotification(Notification notification); +} diff --git a/jdk/src/share/classes/javax/management/StandardEmitterMBean.java b/jdk/src/share/classes/javax/management/StandardEmitterMBean.java index 6f2a9b57f82..c3faec374eb 100644 --- a/jdk/src/share/classes/javax/management/StandardEmitterMBean.java +++ b/jdk/src/share/classes/javax/management/StandardEmitterMBean.java @@ -25,6 +25,9 @@ package javax.management; +import com.sun.jmx.mbeanserver.MBeanInjector; +import static javax.management.JMX.MBeanOptions; + /** *

      An MBean whose management interface is determined by reflection * on a Java interface, and that emits notifications.

      @@ -62,7 +65,7 @@ package javax.management; * @since 1.6 */ public class StandardEmitterMBean extends StandardMBean - implements NotificationEmitter { + implements NotificationEmitter, SendNotification { private final NotificationEmitter emitter; private final MBeanNotificationInfo[] notificationInfo; @@ -76,9 +79,10 @@ public class StandardEmitterMBean extends StandardMBean * for {@code implementation} and {@code emitter} to be the same object.

      * *

      If {@code emitter} is an instance of {@code - * NotificationBroadcasterSupport} then the MBean's {@link #sendNotification + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification * sendNotification} method will call {@code emitter.}{@link - * NotificationBroadcasterSupport#sendNotification sendNotification}.

      + * SendNotification#sendNotification sendNotification}.

      * *

      The array returned by {@link #getNotificationInfo()} on the * new MBean is a copy of the array returned by @@ -90,20 +94,18 @@ public class StandardEmitterMBean extends StandardMBean * * @param implementation the implementation of the MBean interface. * @param mbeanInterface a Standard MBean interface. - * @param emitter the object that will handle notifications. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. * * @throws IllegalArgumentException if the {@code mbeanInterface} * does not follow JMX design patterns for Management Interfaces, or * if the given {@code implementation} does not implement the - * specified interface, or if {@code emitter} is null. + * specified interface. */ public StandardEmitterMBean(T implementation, Class mbeanInterface, NotificationEmitter emitter) { - super(implementation, mbeanInterface, false); - if (emitter == null) - throw new IllegalArgumentException("Null emitter"); - this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + this(implementation, mbeanInterface, false, emitter); } /** @@ -118,9 +120,10 @@ public class StandardEmitterMBean extends StandardMBean * same object.

      * *

      If {@code emitter} is an instance of {@code - * NotificationBroadcasterSupport} then the MBean's {@link #sendNotification + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification * sendNotification} method will call {@code emitter.}{@link - * NotificationBroadcasterSupport#sendNotification sendNotification}.

      + * SendNotification#sendNotification sendNotification}.

      * *

      The array returned by {@link #getNotificationInfo()} on the * new MBean is a copy of the array returned by @@ -134,21 +137,69 @@ public class StandardEmitterMBean extends StandardMBean * @param mbeanInterface a Standard MBean interface. * @param isMXBean If true, the {@code mbeanInterface} parameter * names an MXBean interface and the resultant MBean is an MXBean. - * @param emitter the object that will handle notifications. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. * * @throws IllegalArgumentException if the {@code mbeanInterface} * does not follow JMX design patterns for Management Interfaces, or * if the given {@code implementation} does not implement the - * specified interface, or if {@code emitter} is null. + * specified interface. */ public StandardEmitterMBean(T implementation, Class mbeanInterface, boolean isMXBean, NotificationEmitter emitter) { - super(implementation, mbeanInterface, isMXBean); + this(implementation, mbeanInterface, + isMXBean ? MBeanOptions.MXBEAN : null, emitter); + } + + /** + *

      Make an MBean whose management interface is specified by {@code + * mbeanInterface}, with the given implementation and options, and where + * notifications are handled by the given {@code NotificationEmitter}. + * Options select whether to make a Standard MBean or an MXBean, and + * whether the result of {@link #getWrappedObject()} is the {@code + * StandardEmitterMBean} object or the given implementation. The resultant + * MBean implements the {@code NotificationEmitter} interface by forwarding + * its methods to {@code emitter}. It is legal and useful for {@code + * implementation} and {@code emitter} to be the same object.

      + * + *

      If {@code emitter} is an instance of {@code + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification + * sendNotification} method will call {@code emitter.}{@link + * SendNotification#sendNotification sendNotification}.

      + * + *

      The array returned by {@link #getNotificationInfo()} on the + * new MBean is a copy of the array returned by + * {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo + * getNotificationInfo()} at the time of construction. If the array + * returned by {@code emitter.getNotificationInfo()} later changes, + * that will have no effect on this object's + * {@code getNotificationInfo()}.

      + * + * @param implementation the implementation of the MBean interface. + * @param mbeanInterface a Standard MBean interface. + * @param options MBeanOptions that control the operation of the resulting + * MBean. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. + * + * @throws IllegalArgumentException if the {@code mbeanInterface} + * does not follow JMX design patterns for Management Interfaces, or + * if the given {@code implementation} does not implement the + * specified interface. + */ + public StandardEmitterMBean(T implementation, Class mbeanInterface, + MBeanOptions options, + NotificationEmitter emitter) { + super(implementation, mbeanInterface, options); if (emitter == null) - throw new IllegalArgumentException("Null emitter"); + emitter = defaultEmitter(); this.emitter = emitter; this.notificationInfo = emitter.getNotificationInfo(); + injectEmitter(); } /** @@ -159,9 +210,10 @@ public class StandardEmitterMBean extends StandardMBean * by forwarding its methods to {@code emitter}.

      * *

      If {@code emitter} is an instance of {@code - * NotificationBroadcasterSupport} then the MBean's {@link #sendNotification + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification * sendNotification} method will call {@code emitter.}{@link - * NotificationBroadcasterSupport#sendNotification sendNotification}.

      + * SendNotification#sendNotification sendNotification}.

      * *

      The array returned by {@link #getNotificationInfo()} on the * new MBean is a copy of the array returned by @@ -175,20 +227,17 @@ public class StandardEmitterMBean extends StandardMBean * the given {@code mbeanInterface}.

      * * @param mbeanInterface a StandardMBean interface. - * @param emitter the object that will handle notifications. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. * * @throws IllegalArgumentException if the {@code mbeanInterface} * does not follow JMX design patterns for Management Interfaces, or - * if {@code this} does not implement the specified interface, or - * if {@code emitter} is null. + * if {@code this} does not implement the specified interface. */ protected StandardEmitterMBean(Class mbeanInterface, NotificationEmitter emitter) { - super(mbeanInterface, false); - if (emitter == null) - throw new IllegalArgumentException("Null emitter"); - this.emitter = emitter; - this.notificationInfo = emitter.getNotificationInfo(); + this(mbeanInterface, false, emitter); } /** @@ -200,9 +249,10 @@ public class StandardEmitterMBean extends StandardMBean * forwarding its methods to {@code emitter}.

      * *

      If {@code emitter} is an instance of {@code - * NotificationBroadcasterSupport} then the MBean's {@link #sendNotification + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification * sendNotification} method will call {@code emitter.}{@link - * NotificationBroadcasterSupport#sendNotification sendNotification}.

      + * SendNotification#sendNotification sendNotification}.

      * *

      The array returned by {@link #getNotificationInfo()} on the * new MBean is a copy of the array returned by @@ -218,20 +268,86 @@ public class StandardEmitterMBean extends StandardMBean * @param mbeanInterface a StandardMBean interface. * @param isMXBean If true, the {@code mbeanInterface} parameter * names an MXBean interface and the resultant MBean is an MXBean. - * @param emitter the object that will handle notifications. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. * * @throws IllegalArgumentException if the {@code mbeanInterface} * does not follow JMX design patterns for Management Interfaces, or - * if {@code this} does not implement the specified interface, or - * if {@code emitter} is null. + * if {@code this} does not implement the specified interface. */ protected StandardEmitterMBean(Class mbeanInterface, boolean isMXBean, NotificationEmitter emitter) { - super(mbeanInterface, isMXBean); + this(mbeanInterface, isMXBean ? MBeanOptions.MXBEAN : null, emitter); + } + + /** + *

      Make an MBean whose management interface is specified by {@code + * mbeanInterface}, with the given options, and where notifications are + * handled by the given {@code NotificationEmitter}. This constructor can + * be used to make either Standard MBeans or MXBeans. The resultant MBean + * implements the {@code NotificationEmitter} interface by forwarding its + * methods to {@code emitter}.

      + * + *

      If {@code emitter} is an instance of {@code + * SendNotification} (for example, a {@link NotificationBroadcasterSupport}), + * then the MBean's {@link #sendNotification + * sendNotification} method will call {@code emitter.}{@link + * SendNotification#sendNotification sendNotification}.

      + * + *

      The array returned by {@link #getNotificationInfo()} on the + * new MBean is a copy of the array returned by + * {@code emitter.}{@link NotificationBroadcaster#getNotificationInfo + * getNotificationInfo()} at the time of construction. If the array + * returned by {@code emitter.getNotificationInfo()} later changes, + * that will have no effect on this object's + * {@code getNotificationInfo()}.

      + * + *

      This constructor must be called from a subclass that implements + * the given {@code mbeanInterface}.

      + * + * @param mbeanInterface a StandardMBean interface. + * @param options MBeanOptions that control the operation of the resulting + * MBean. + * @param emitter the object that will handle notifications. If null, + * a new {@code NotificationEmitter} will be constructed that also + * implements {@link SendNotification}. + * + * @throws IllegalArgumentException if the {@code mbeanInterface} + * does not follow JMX design patterns for Management Interfaces, or + * if {@code this} does not implement the specified interface. + */ + protected StandardEmitterMBean(Class mbeanInterface, MBeanOptions options, + NotificationEmitter emitter) { + super(mbeanInterface, options); if (emitter == null) - throw new IllegalArgumentException("Null emitter"); + emitter = defaultEmitter(); this.emitter = emitter; this.notificationInfo = emitter.getNotificationInfo(); + injectEmitter(); + } + + private NotificationEmitter defaultEmitter() { + MBeanNotificationInfo[] mbnis = getNotificationInfo(); + // Will be null unless getNotificationInfo() is overridden, + // since the notificationInfo field has not been set at this point. + if (mbnis == null) + mbnis = getMBeanInfo().getNotifications(); + return new NotificationBroadcasterSupport(mbnis); + } + + private void injectEmitter() { + if (emitter instanceof SendNotification) { + try { + Object resource = getImplementation(); + SendNotification send = (SendNotification) emitter; + MBeanInjector.injectSendNotification(resource, send); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalArgumentException(e); + } + } } public void removeNotificationListener(NotificationListener listener) @@ -259,10 +375,10 @@ public class StandardEmitterMBean extends StandardMBean /** *

      Sends a notification.

      * - *

      If the {@code emitter} parameter to the constructor was an - * instance of {@code NotificationBroadcasterSupport} then this - * method will call {@code emitter.}{@link - * NotificationBroadcasterSupport#sendNotification + *

      If the {@code emitter} parameter to the constructor was + * an instance of {@link SendNotification}, such as {@link + * NotificationBroadcasterSupport}, then this method will call {@code + * emitter.}{@link SendNotification#sendNotification * sendNotification}.

      * * @param n the notification to send. @@ -271,13 +387,12 @@ public class StandardEmitterMBean extends StandardMBean * constructor was not a {@code NotificationBroadcasterSupport}. */ public void sendNotification(Notification n) { - if (emitter instanceof NotificationBroadcasterSupport) - ((NotificationBroadcasterSupport) emitter).sendNotification(n); + if (emitter instanceof SendNotification) + ((SendNotification) emitter).sendNotification(n); else { final String msg = "Cannot sendNotification when emitter is not an " + - "instance of NotificationBroadcasterSupport: " + - emitter.getClass().getName(); + "instance of SendNotification: " + emitter.getClass().getName(); throw new ClassCastException(msg); } } @@ -292,6 +407,7 @@ public class StandardEmitterMBean extends StandardMBean * @param info The default MBeanInfo derived by reflection. * @return the MBeanNotificationInfo[] for the new MBeanInfo. */ + @Override MBeanNotificationInfo[] getNotifications(MBeanInfo info) { return getNotificationInfo(); } diff --git a/jdk/src/share/classes/javax/management/StandardMBean.java b/jdk/src/share/classes/javax/management/StandardMBean.java index fa722cb8d34..a779e8282bb 100644 --- a/jdk/src/share/classes/javax/management/StandardMBean.java +++ b/jdk/src/share/classes/javax/management/StandardMBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 @@ -25,22 +25,20 @@ package javax.management; -import static com.sun.jmx.defaults.JmxProperties.MISC_LOGGER; import com.sun.jmx.mbeanserver.DescriptorCache; import com.sun.jmx.mbeanserver.Introspector; +import com.sun.jmx.mbeanserver.MBeanInjector; import com.sun.jmx.mbeanserver.MBeanSupport; import com.sun.jmx.mbeanserver.MXBeanSupport; import com.sun.jmx.mbeanserver.StandardMBeanSupport; import com.sun.jmx.mbeanserver.Util; - -import java.io.PrintWriter; -import java.io.StringWriter; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashMap; import java.util.Map; import java.util.WeakHashMap; import java.util.logging.Level; +import javax.management.openmbean.MXBeanMappingFactory; import javax.management.openmbean.OpenMBeanAttributeInfo; import javax.management.openmbean.OpenMBeanAttributeInfoSupport; import javax.management.openmbean.OpenMBeanConstructorInfo; @@ -50,6 +48,9 @@ import javax.management.openmbean.OpenMBeanOperationInfoSupport; import javax.management.openmbean.OpenMBeanParameterInfo; import javax.management.openmbean.OpenMBeanParameterInfoSupport; +import static com.sun.jmx.defaults.JmxProperties.MISC_LOGGER; +import static javax.management.JMX.MBeanOptions; + /** *

      An MBean whose management interface is determined by reflection * on a Java interface.

      @@ -125,7 +126,78 @@ import javax.management.openmbean.OpenMBeanParameterInfoSupport; * * @since 1.5 */ -public class StandardMBean implements DynamicMBean, MBeanRegistration { +public class StandardMBean implements DynamicWrapperMBean, MBeanRegistration { + + /** + *

      Options controlling the behavior of {@code StandardMBean} instances.

      + */ + public static class Options extends JMX.MBeanOptions { + private static final long serialVersionUID = 5107355471177517164L; + + private boolean wrappedVisible; + + /** + *

      Construct an {@code Options} object where all options have + * their default values.

      + */ + public Options() {} + + @Override + public Options clone() { + return (Options) super.clone(); + } + + /** + *

      Defines whether the {@link StandardMBean#getWrappedObject() + * getWrappedObject} method returns the wrapped object.

      + * + *

      If this option is true, then {@code getWrappedObject()} will return + * the same object as {@link StandardMBean#getImplementation() + * getImplementation}. Otherwise, it will return the + * StandardMBean instance itself. The setting of this option + * affects the behavior of {@link MBeanServer#getClassLoaderFor + * MBeanServer.getClassLoaderFor} and {@link MBeanServer#isInstanceOf + * MBeanServer.isInstanceOf}. The default value is false for + * compatibility reasons, but true is a better value for most new code.

      + * + * @return true if this StandardMBean's {@link + * StandardMBean#getWrappedObject getWrappedObject} returns the wrapped + * object. + */ + public boolean isWrappedObjectVisible() { + return this.wrappedVisible; + } + + /** + *

      Set the {@link #isWrappedObjectVisible WrappedObjectVisible} option + * to the given value.

      + * @param visible the new value. + */ + public void setWrappedObjectVisible(boolean visible) { + this.wrappedVisible = visible; + } + + // Canonical objects for each of (MXBean,!MXBean) x (WVisible,!WVisible) + private static final Options[] CANONICALS = { + new Options(), new Options(), new Options(), new Options(), + }; + static { + CANONICALS[1].setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + CANONICALS[2].setWrappedObjectVisible(true); + CANONICALS[3].setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + CANONICALS[3].setWrappedObjectVisible(true); + } + @Override + MBeanOptions[] canonicals() { + return CANONICALS; + } + + @Override + boolean same(MBeanOptions opts) { + return (super.same(opts) && opts instanceof Options && + ((Options) opts).wrappedVisible == wrappedVisible); + } + } private final static DescriptorCache descriptors = DescriptorCache.getInstance(JMX.proof); @@ -140,6 +212,11 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { **/ private volatile MBeanInfo cachedMBeanInfo; + /** + * The MBeanOptions for this StandardMBean. + **/ + private MBeanOptions options; + /** * Make a DynamicMBean out of implementation, using the * specified mbeanInterface class. @@ -155,12 +232,14 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { * implementation is allowed. If null implementation is allowed, * and a null implementation is passed, then the implementation * is assumed to be this. + * @param options MBeanOptions to apply to this instance. * @exception IllegalArgumentException if the given * implementation is null, and null is not allowed. **/ + @SuppressWarnings("unchecked") // cast to T private void construct(T implementation, Class mbeanInterface, boolean nullImplementationAllowed, - boolean isMXBean) + MBeanOptions options) throws NotCompliantMBeanException { if (implementation == null) { // Have to use (T)this rather than mbeanInterface.cast(this) @@ -169,20 +248,23 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { implementation = Util.cast(this); else throw new IllegalArgumentException("implementation is null"); } - if (isMXBean) { - if (mbeanInterface == null) { - mbeanInterface = Util.cast(Introspector.getMXBeanInterface( - implementation.getClass())); - } - this.mbean = new MXBeanSupport(implementation, mbeanInterface); + if (options == null) + options = new MBeanOptions(); + MXBeanMappingFactory mappingFactory = options.getMXBeanMappingFactory(); + boolean mx = (mappingFactory != null); + if (mbeanInterface == null) { + mbeanInterface = Util.cast(Introspector.getStandardOrMXBeanInterface( + implementation.getClass(), mx)); + } + if (mx) { + this.mbean = + new MXBeanSupport(implementation, mbeanInterface, + mappingFactory); } else { - if (mbeanInterface == null) { - mbeanInterface = Util.cast(Introspector.getStandardMBeanInterface( - implementation.getClass())); - } this.mbean = new StandardMBeanSupport(implementation, mbeanInterface); } + this.options = options.canonical(); } /** @@ -211,14 +293,14 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { **/ public StandardMBean(T implementation, Class mbeanInterface) throws NotCompliantMBeanException { - construct(implementation, mbeanInterface, false, false); + construct(implementation, mbeanInterface, false, null); } /** *

      Make a DynamicMBean out of this, using the specified * mbeanInterface class.

      * - *

      Call {@link #StandardMBean(java.lang.Object, java.lang.Class) + *

      Calls {@link #StandardMBean(java.lang.Object, java.lang.Class) * this(this,mbeanInterface)}. * This constructor is reserved to subclasses.

      * @@ -231,13 +313,14 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { **/ protected StandardMBean(Class mbeanInterface) throws NotCompliantMBeanException { - construct(null, mbeanInterface, true, false); + construct(null, mbeanInterface, true, null); } /** *

      Make a DynamicMBean out of the object * implementation, using the specified - * mbeanInterface class. This constructor can be used + * mbeanInterface class, and choosing whether the + * resultant MBean is an MXBean. This constructor can be used * to make either Standard MBeans or MXBeans. Unlike the * constructor {@link #StandardMBean(Object, Class)}, it * does not throw NotCompliantMBeanException.

      @@ -267,7 +350,17 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { public StandardMBean(T implementation, Class mbeanInterface, boolean isMXBean) { try { - construct(implementation, mbeanInterface, false, isMXBean); + MBeanOptions opts = new MBeanOptions(); + if (mbeanInterface == null) { + mbeanInterface = Util.cast(Introspector.getStandardOrMXBeanInterface( + implementation.getClass(), isMXBean)); + } + if (isMXBean) { + MXBeanMappingFactory f = MXBeanMappingFactory.forInterface( + mbeanInterface); + opts.setMXBeanMappingFactory(f); + } + construct(implementation, mbeanInterface, false, opts); } catch (NotCompliantMBeanException e) { throw new IllegalArgumentException(e); } @@ -275,12 +368,13 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { /** *

      Make a DynamicMBean out of this, using the specified - * mbeanInterface class. This constructor can be used + * mbeanInterface class, and choosing whether the resulting + * MBean is an MXBean. This constructor can be used * to make either Standard MBeans or MXBeans. Unlike the * constructor {@link #StandardMBean(Object, Class)}, it * does not throw NotCompliantMBeanException.

      * - *

      Call {@link #StandardMBean(java.lang.Object, java.lang.Class, boolean) + *

      Calls {@link #StandardMBean(java.lang.Object, java.lang.Class, boolean) * this(this, mbeanInterface, isMXBean)}. * This constructor is reserved to subclasses.

      * @@ -297,7 +391,77 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { **/ protected StandardMBean(Class mbeanInterface, boolean isMXBean) { try { - construct(null, mbeanInterface, true, isMXBean); + MBeanOptions opts = new MBeanOptions(); + if (mbeanInterface == null) { + mbeanInterface = Introspector.getStandardOrMXBeanInterface( + getClass(), isMXBean); + } + if (isMXBean) { + MXBeanMappingFactory f = MXBeanMappingFactory.forInterface( + mbeanInterface); + opts.setMXBeanMappingFactory(f); + } + construct(null, mbeanInterface, true, opts); + } catch (NotCompliantMBeanException e) { + throw new IllegalArgumentException(e); + } + } + + /** + *

      Make a DynamicMBean out of the object + * implementation, using the specified + * mbeanInterface class and the specified options.

      + * + * @param implementation The implementation of this MBean. + * @param mbeanInterface The Management Interface exported by this + * MBean's implementation. If null, then this + * object will use standard JMX design pattern to determine + * the management interface associated with the given + * implementation. + * @param options MBeanOptions that control the operation of the resulting + * MBean. + * @param Allows the compiler to check + * that {@code implementation} does indeed implement the class + * described by {@code mbeanInterface}. The compiler can only + * check this if {@code mbeanInterface} is a class literal such + * as {@code MyMBean.class}. + * + * @exception IllegalArgumentException if the given + * implementation is null, or if the mbeanInterface + * does not follow JMX design patterns for Management Interfaces, or + * if the given implementation does not implement the + * specified interface. + **/ + public StandardMBean(T implementation, + Class mbeanInterface, + MBeanOptions options) { + try { + construct(implementation, mbeanInterface, false, options); + } catch (NotCompliantMBeanException e) { + throw new IllegalArgumentException(e); + } + } + + /** + *

      Make a DynamicMBean out of this, using the specified + * mbeanInterface class and the specified options.

      + * + *

      Calls {@link #StandardMBean(Object, Class, JMX.MBeanOptions) + * this(this,mbeanInterface,options)}. + * This constructor is reserved to subclasses.

      + * + * @param mbeanInterface The Management Interface exported by this + * MBean. + * @param options MBeanOptions that control the operation of the resulting + * MBean. + * + * @exception IllegalArgumentException if the mbeanInterface + * does not follow JMX design patterns for Management Interfaces, or + * if this does not implement the specified interface. + **/ + protected StandardMBean(Class mbeanInterface, MBeanOptions options) { + try { + construct(null, mbeanInterface, true, options); } catch (NotCompliantMBeanException e) { throw new IllegalArgumentException(e); } @@ -326,13 +490,19 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { if (implementation == null) throw new IllegalArgumentException("implementation is null"); + setImplementation2(implementation); + } - if (isMXBean()) { + private void setImplementation2(T implementation) + throws NotCompliantMBeanException { + Class intf = Util.cast(getMBeanInterface()); + + if (this.mbean.isMXBean()) { this.mbean = new MXBeanSupport(implementation, - Util.>cast(getMBeanInterface())); + intf, + options.getMXBeanMappingFactory()); } else { - this.mbean = new StandardMBeanSupport(implementation, - Util.>cast(getMBeanInterface())); + this.mbean = new StandardMBeanSupport(implementation, intf); } } @@ -343,7 +513,67 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { * @see #setImplementation **/ public Object getImplementation() { - return mbean.getResource(); + return mbean.getWrappedObject(); + } + + /** + *

      Get the wrapped implementation object or return this object.

      + * + *

      For compatibility reasons, this method only returns the wrapped + * implementation object if the {@link Options#isWrappedObjectVisible + * WrappedObjectVisible} option was specified when this StandardMBean + * was created. Otherwise it returns {@code this}.

      + * + *

      If you want the MBeanServer's {@link MBeanServer#getClassLoaderFor + * getClassLoaderFor} and {@link MBeanServer#isInstanceOf + * isInstanceOf} methods to refer to the wrapped implementation and + * not this StandardMBean object, then you must set the + * {@code WrappedObjectVisible} option, for example using:

      + * + *
      +     * StandardMBean.Options opts = new StandardMBean.Options();
      +     * opts.setWrappedObjectVisible(true);
      +     * StandardMBean mbean = new StandardMBean(impl, MyMBean.class, opts);
      +     * 
      + * + * @return The wrapped implementation object, or this StandardMBean + * instance. + */ + public Object getWrappedObject() { + if (options instanceof Options && + ((Options) options).isWrappedObjectVisible()) + return getImplementation(); + else + return this; + } + + /** + *

      Get the ClassLoader of the wrapped implementation object or of this + * object.

      + * + *

      For compatibility reasons, this method only returns the ClassLoader + * of the wrapped implementation object if the {@link + * Options#isWrappedObjectVisible WrappedObjectVisible} option was + * specified when this StandardMBean was created. Otherwise it returns + * {@code this.getClass().getClassLoader()}.

      + * + *

      If you want the MBeanServer's {@link MBeanServer#getClassLoaderFor + * getClassLoaderFor} and {@link MBeanServer#isInstanceOf + * isInstanceOf} methods to refer to the wrapped implementation and + * not this StandardMBean object, then you must set the + * {@code WrappedObjectVisible} option, for example using:

      + * + *
      +     * StandardMBean.Options opts = new StandardMBean.Options();
      +     * opts.setWrappedObjectVisible(true);
      +     * StandardMBean mbean = new StandardMBean(impl, MyMBean.class, opts);
      +     * 
      + * + * @return The ClassLoader of the wrapped Cimplementation object, or of + * this StandardMBean instance. + */ + public ClassLoader getWrappedClassLoader() { + return getWrappedObject().getClass().getClassLoader(); } /** @@ -359,7 +589,20 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { * @return The class of the implementation of this Standard MBean (or MXBean). **/ public Class getImplementationClass() { - return mbean.getResource().getClass(); + return mbean.getWrappedObject().getClass(); + } + + /** + * Return the MBeanOptions that were specified or implied for this StandardMBean + * instance. If an MBeanOptions object was supplied when this StandardMBean + * instance was constructed, and if that object has not been modified in the + * meantime, then the returned object will be equal to that object, although + * it might not be the same object. + * @return The MBeanOptions that were specified or implied for this StandardMBean + * instance. + */ + public MBeanOptions getOptions() { + return options.uncanonical(); } // ------------------------------------------------------------------ @@ -448,7 +691,7 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { MBeanSupport msupport = mbean; final MBeanInfo bi = msupport.getMBeanInfo(); - final Object impl = msupport.getResource(); + final Object impl = msupport.getWrappedObject(); final boolean immutableInfo = immutableInfo(this.getClass()); @@ -726,7 +969,7 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { * @return the MBeanNotificationInfo[] for the new MBeanInfo. **/ MBeanNotificationInfo[] getNotifications(MBeanInfo info) { - return null; + return info.getNotifications(); } /** @@ -1073,6 +1316,7 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { mbean.register(server, name); + MBeanInjector.inject(mbean.getWrappedObject(), server, name); return name; } @@ -1234,5 +1478,4 @@ public class StandardMBean implements DynamicMBean, MBeanRegistration { return true; } } - } diff --git a/jdk/src/share/classes/javax/management/StringValueExp.java b/jdk/src/share/classes/javax/management/StringValueExp.java index 40a9b2364d8..9f2ed4a3b45 100644 --- a/jdk/src/share/classes/javax/management/StringValueExp.java +++ b/jdk/src/share/classes/javax/management/StringValueExp.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/loading/MLet.java b/jdk/src/share/classes/javax/management/loading/MLet.java index cb180e8211c..ba27646df6a 100644 --- a/jdk/src/share/classes/javax/management/loading/MLet.java +++ b/jdk/src/share/classes/javax/management/loading/MLet.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/loading/MLetParser.java b/jdk/src/share/classes/javax/management/loading/MLetParser.java index a3040b4add6..88aa4794ab1 100644 --- a/jdk/src/share/classes/javax/management/loading/MLetParser.java +++ b/jdk/src/share/classes/javax/management/loading/MLetParser.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java b/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java index bd9eb23a0b8..66b8fec8b9a 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java +++ b/jdk/src/share/classes/javax/management/modelmbean/DescriptorSupport.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 @@ -33,6 +33,7 @@ package javax.management.modelmbean; import static com.sun.jmx.defaults.JmxProperties.MODELMBEAN_LOGGER; import static com.sun.jmx.mbeanserver.Util.cast; import com.sun.jmx.mbeanserver.GetPropertyAction; +import com.sun.jmx.mbeanserver.Util; import java.io.IOException; import java.io.ObjectInputStream; @@ -774,6 +775,7 @@ public class DescriptorSupport * fails for any reason, this exception will be thrown. */ + @Override public synchronized Object clone() throws RuntimeOperationsException { if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) { MODELMBEAN_LOGGER.logp(Level.FINEST, @@ -814,13 +816,16 @@ public class DescriptorSupport * otherwise. * */ - // XXXX TODO: This is not very efficient! // Note: this Javadoc is copied from javax.management.Descriptor // due to 6369229. + @Override public synchronized boolean equals(Object o) { if (o == this) return true; - + if (! (o instanceof Descriptor)) + return false; + if (o instanceof ImmutableDescriptor) + return o.equals(this); return new ImmutableDescriptor(descriptorMap).equals(o); } @@ -844,11 +849,16 @@ public class DescriptorSupport * @return A hash code value for this object. * */ - // XXXX TODO: This is not very efficient! // Note: this Javadoc is copied from javax.management.Descriptor // due to 6369229. + @Override public synchronized int hashCode() { - return new ImmutableDescriptor(descriptorMap).hashCode(); + final int size = descriptorMap.size(); + // descriptorMap is sorted with a comparator that ignores cases. + // + return Util.hashCode( + descriptorMap.keySet().toArray(new String[size]), + descriptorMap.values().toArray(new Object[size])); } /** @@ -1278,6 +1288,7 @@ public class DescriptorSupport * field Names or field Values. If the descriptor string fails * for any reason, this exception will be thrown. */ + @Override public synchronized String toString() { if (MODELMBEAN_LOGGER.isLoggable(Level.FINEST)) { MODELMBEAN_LOGGER.logp(Level.FINEST, diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java index c921de7b66b..cc2ec0b7a41 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanAttributeInfo.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java index 1a1591de0d7..a6e7ceab737 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanConstructorInfo.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java index 5dff6557a23..6e4a3ed6368 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanInfoSupport.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java index b603edb8298..52f1317db81 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanNotificationInfo.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java index 9b75b8c0404..2ed99224067 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java +++ b/jdk/src/share/classes/javax/management/modelmbean/ModelMBeanOperationInfo.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java index 6a72302ea20..3c09c3ff2cc 100644 --- a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java +++ b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java @@ -1,5 +1,5 @@ /* - * Portions Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Portions Copyright 2000-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 @@ -23,7 +23,7 @@ * have any questions. */ /* - * @author IBM Corp. + * @(#)author IBM Corp. * * Copyright IBM Corp. 1999-2000. All rights reserved. */ @@ -55,6 +55,7 @@ import javax.management.AttributeChangeNotificationFilter; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; import javax.management.Descriptor; +import javax.management.DynamicWrapperMBean; import javax.management.InstanceNotFoundException; import javax.management.InvalidAttributeValueException; import javax.management.ListenerNotFoundException; @@ -115,7 +116,7 @@ import sun.reflect.misc.ReflectUtil; */ public class RequiredModelMBean - implements ModelMBean, MBeanRegistration, NotificationEmitter { + implements ModelMBean, MBeanRegistration, NotificationEmitter, DynamicWrapperMBean { /*************************************/ /* attributes */ @@ -133,6 +134,9 @@ public class RequiredModelMBean * and operations will be executed */ private Object managedResource = null; + /* true if getWrappedObject returns the wrapped resource */ + private boolean visible; + /* records the registering in MBeanServer */ private boolean registered = false; private transient MBeanServer server = null; @@ -318,9 +322,13 @@ public class RequiredModelMBean * * @param mr Object that is the managed resource * @param mr_type The type of reference for the managed resource. - *
      Can be: "ObjectReference", "Handle", "IOR", "EJBHandle", - * or "RMIReference". - *
      In this implementation only "ObjectReference" is supported. + *
      Can be: "ObjectReference", "VisibleObjectReference", + * "Handle", "IOR", "EJBHandle", or "RMIReference". + *
      In this implementation only "ObjectReference" and + * "VisibleObjectReference" are supported. The two + * types are equivalent except for the behavior of the + * {@link #getWrappedObject()} and {@link #getWrappedClassLoader()} + * methods. * * @exception MBeanException The initializer of the object has * thrown an exception. @@ -340,10 +348,11 @@ public class RequiredModelMBean "setManagedResource(Object,String)","Entry"); } + visible = "visibleObjectReference".equalsIgnoreCase(mr_type); + // check that the mr_type is supported by this JMXAgent // only "objectReference" is supported - if ((mr_type == null) || - (! mr_type.equalsIgnoreCase("objectReference"))) { + if (!"objectReference".equalsIgnoreCase(mr_type) && !visible) { if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) { MODELMBEAN_LOGGER.logp(Level.FINER, RequiredModelMBean.class.getName(), @@ -368,6 +377,51 @@ public class RequiredModelMBean } } + /** + *

      Get the managed resource for this Model MBean. For compatibility + * reasons, the managed resource is only returned if the resource type + * specified to {@link #setManagedResource setManagedResource} was {@code + * "visibleObjectReference"}. Otherwise, {@code this} is returned.

      + * + * @return The value that was specified to {@link #setManagedResource + * setManagedResource}, if the resource type is {@code + * "visibleObjectReference"}. Otherwise, {@code this}. + */ + public Object getWrappedObject() { + if (visible) + return managedResource; + else + return this; + } + + /** + *

      Get the ClassLoader of the managed resource for this Model MBean. For + * compatibility reasons, the ClassLoader of the managed resource is only + * returned if the resource type specified to {@link #setManagedResource + * setManagedResource} was {@code "visibleObjectReference"}. Otherwise, + * {@code this.getClass().getClassLoader()} is returned.

      + * + * @return The ClassLoader of the value that was specified to + * {@link #setManagedResource setManagedResource}, if the resource + * type is {@code "visibleObjectReference"}. Otherwise, {@code + * this.getClass().getClassLoader()}. + */ + public ClassLoader getWrappedClassLoader() { + return getWrappedObject().getClass().getClassLoader(); + } + + private static boolean isTrue(Descriptor d, String field) { + if (d == null) + return false; + Object x = d.getFieldValue(field); + if (x instanceof Boolean) + return (Boolean) x; + if (!(x instanceof String)) + return false; + String s = (String) x; + return ("true".equalsIgnoreCase(s) || "T".equalsIgnoreCase(s)); + } + /** *

      Instantiates this MBean instance with the data found for * the MBean in the persistent store. The data loaded could include diff --git a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java index f2f9887b4cd..b592b171b62 100644 --- a/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java +++ b/jdk/src/share/classes/javax/management/monitor/CounterMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java index 5ce63fbe532..7077f38cee1 100644 --- a/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java +++ b/jdk/src/share/classes/javax/management/monitor/GaugeMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/monitor/Monitor.java b/jdk/src/share/classes/javax/management/monitor/Monitor.java index 1b057e1b4a6..081c5ede429 100644 --- a/jdk/src/share/classes/javax/management/monitor/Monitor.java +++ b/jdk/src/share/classes/javax/management/monitor/Monitor.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/management/monitor/package.html b/jdk/src/share/classes/javax/management/monitor/package.html index 5ccb72c9660..2e04b2422fc 100644 --- a/jdk/src/share/classes/javax/management/monitor/package.html +++ b/jdk/src/share/classes/javax/management/monitor/package.html @@ -38,14 +38,17 @@ have any questions. so within the access control context of the {@link javax.management.monitor.Monitor#start} caller.

      -

      The value being monitored can be a simple value contained within a - complex type. For example, the {@link java.lang.management.MemoryMXBean - MemoryMXBean} defined in java.lang.management has an attribute - HeapMemoryUsage of type {@link java.lang.management.MemoryUsage - MemoryUsage}. To monitor the amount of used memory, described by - the used property of MemoryUsage, you could monitor - "HeapMemoryUsage.used". That string would be the argument to - {@link javax.management.monitor.MonitorMBean#setObservedAttribute(String) +

      The value being monitored can be a simple value + contained within a complex type. For example, the {@link + java.lang.management.MemoryMXBean MemoryMXBean} defined in + java.lang.management has an attribute + HeapMemoryUsage of type {@link + java.lang.management.MemoryUsage MemoryUsage}. To monitor the + amount of used memory, described by the used + property of MemoryUsage, you could monitor + "HeapMemoryUsage.used". That string would be the + argument to {@link + javax.management.monitor.MonitorMBean#setObservedAttribute(String) setObservedAttribute}.

      The rules used to interpret an ObservedAttribute like diff --git a/jdk/src/share/classes/javax/management/openmbean/ArrayType.java b/jdk/src/share/classes/javax/management/openmbean/ArrayType.java index 92ecc604498..49c8bbf1f63 100644 --- a/jdk/src/share/classes/javax/management/openmbean/ArrayType.java +++ b/jdk/src/share/classes/javax/management/openmbean/ArrayType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java b/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java index e0d95dfdccd..e0414e9d031 100644 --- a/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java +++ b/jdk/src/share/classes/javax/management/openmbean/CompositeDataInvocationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -26,7 +26,7 @@ package javax.management.openmbean; import com.sun.jmx.mbeanserver.MXBeanLookup; -import com.sun.jmx.mbeanserver.OpenConverter; +import com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; @@ -115,7 +115,12 @@ public class CompositeDataInvocationHandler implements InvocationHandler { is null. */ public CompositeDataInvocationHandler(CompositeData compositeData) { - this(compositeData, null); + this(compositeData, MXBeanMappingFactory.DEFAULT); + } + + public CompositeDataInvocationHandler(CompositeData compositeData, + MXBeanMappingFactory mappingFactory) { + this(compositeData, mappingFactory, null); } /** @@ -134,11 +139,13 @@ public class CompositeDataInvocationHandler implements InvocationHandler { is null. */ CompositeDataInvocationHandler(CompositeData compositeData, + MXBeanMappingFactory mappingFactory, MXBeanLookup lookup) { if (compositeData == null) throw new IllegalArgumentException("compositeData"); this.compositeData = compositeData; this.lookup = lookup; + this.mappingFactory = mappingFactory; } /** @@ -176,7 +183,7 @@ public class CompositeDataInvocationHandler implements InvocationHandler { } } - String propertyName = OpenConverter.propertyName(method); + String propertyName = DefaultMXBeanMappingFactory.propertyName(method); if (propertyName == null) { throw new IllegalArgumentException("Method is not getter: " + method.getName()); @@ -185,7 +192,7 @@ public class CompositeDataInvocationHandler implements InvocationHandler { if (compositeData.containsKey(propertyName)) openValue = compositeData.get(propertyName); else { - String decap = OpenConverter.decapitalize(propertyName); + String decap = DefaultMXBeanMappingFactory.decapitalize(propertyName); if (compositeData.containsKey(decap)) openValue = compositeData.get(decap); else { @@ -196,9 +203,10 @@ public class CompositeDataInvocationHandler implements InvocationHandler { throw new IllegalArgumentException(msg); } } - OpenConverter converter = - OpenConverter.toConverter(method.getGenericReturnType()); - return converter.fromOpenValue(lookup, openValue); + MXBeanMapping mapping = + mappingFactory.mappingForType(method.getGenericReturnType(), + MXBeanMappingFactory.DEFAULT); + return mapping.fromOpenValue(openValue); } /* This method is called when equals(Object) is @@ -242,4 +250,5 @@ public class CompositeDataInvocationHandler implements InvocationHandler { private final CompositeData compositeData; private final MXBeanLookup lookup; + private final MXBeanMappingFactory mappingFactory; } diff --git a/jdk/src/share/classes/javax/management/openmbean/CompositeType.java b/jdk/src/share/classes/javax/management/openmbean/CompositeType.java index 25f7b1dbb20..b513b0faa9a 100644 --- a/jdk/src/share/classes/javax/management/openmbean/CompositeType.java +++ b/jdk/src/share/classes/javax/management/openmbean/CompositeType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -159,8 +159,8 @@ public class CompositeType extends OpenType { } private static void checkForNullElement(Object[] arg, String argName) { - if ( (arg == null) || (arg.length == 0) ) { - throw new IllegalArgumentException("Argument "+ argName +"[] cannot be null or empty."); + if (arg == null) { + throw new IllegalArgumentException("Argument "+ argName +"[] cannot be null."); } for (int i=0; iA custom mapping between Java types and Open types for use in MXBeans. + * To define such a mapping, subclass this class and define at least the + * {@link #fromOpenValue fromOpenValue} and {@link #toOpenValue toOpenValue} + * methods, and optionally the {@link #checkReconstructible} method. + * Then either use an {@link MXBeanMappingClass} annotation on your custom + * Java types, or include this MXBeanMapping in an + * {@link MXBeanMappingFactory}.

      + * + *

      For example, suppose we have a class {@code MyLinkedList}, which looks + * like this:

      + * + *
      + * public class MyLinkedList {
      + *     public MyLinkedList(String name, MyLinkedList next) {...}
      + *     public String getName() {...}
      + *     public MyLinkedList getNext() {...}
      + * }
      + * 
      + * + *

      This is not a valid type for MXBeans, because it contains a + * self-referential property "next" defined by the {@code getNext()} + * method. MXBeans do not support recursive types. So we would like + * to specify a mapping for {@code MyLinkedList} explicitly. When an + * MXBean interface contains {@code MyLinkedList}, that will be mapped + * into a {@code String[]}, which is a valid Open Type.

      + * + *

      To define this mapping, we first subclass {@code MXBeanMapping}:

      + * + *
      + * public class MyLinkedListMapping extends MXBeanMapping {
      + *     public MyLinkedListMapping(Type type) throws OpenDataException {
      + *         super(MyLinkedList.class, ArrayType.getArrayType(SimpleType.STRING));
      + *         if (type != MyLinkedList.class)
      + *             throw new OpenDataException("Mapping only valid for MyLinkedList");
      + *     }
      + *
      + *     {@literal @Override}
      + *     public Object fromOpenValue(Object openValue) throws InvalidObjectException {
      + *         String[] array = (String[]) openValue;
      + *         MyLinkedList list = null;
      + *         for (int i = array.length - 1; i >= 0; i--)
      + *             list = new MyLinkedList(array[i], list);
      + *         return list;
      + *     }
      + *
      + *     {@literal @Override}
      + *     public Object toOpenValue(Object javaValue) throws OpenDataException {
      + *         ArrayList<String> array = new ArrayList<String>();
      + *         for (MyLinkedList list = (MyLinkedList) javaValue; list != null;
      + *              list = list.getNext())
      + *             array.add(list.getName());
      + *         return array.toArray(new String[0]);
      + *     }
      + * }
      + * 
      + * + *

      The call to the superclass constructor specifies what the + * original Java type is ({@code MyLinkedList.class}) and what Open + * Type it is mapped to ({@code + * ArrayType.getArrayType(SimpleType.STRING)}). The {@code + * fromOpenValue} method says how we go from the Open Type ({@code + * String[]}) to the Java type ({@code MyLinkedList}), and the {@code + * toOpenValue} method says how we go from the Java type to the Open + * Type.

      + * + *

      With this mapping defined, we can annotate the {@code MyLinkedList} + * class appropriately:

      + * + *
      + * {@literal @MXBeanMappingClass}(MyLinkedListMapping.class)
      + * public class MyLinkedList {...}
      + * 
      + * + *

      Now we can use {@code MyLinkedList} in an MXBean interface and it + * will work.

      + * + *

      If we are unable to modify the {@code MyLinkedList} class, + * we can define an {@link MXBeanMappingFactory}. See the documentation + * of that class for further details.

      + */ +public abstract class MXBeanMapping { + private final Type javaType; + private final OpenType openType; + private final Class openClass; + + /** + *

      Construct a mapping between the given Java type and the given + * Open Type.

      + * + * @param javaType the Java type (for example, {@code MyLinkedList}). + * @param openType the Open Type (for example, {@code + * ArrayType.getArrayType(SimpleType.STRING)}) + * + * @throws NullPointerException if either argument is null. + */ + protected MXBeanMapping(Type javaType, OpenType openType) { + if (javaType == null || openType == null) + throw new NullPointerException("Null argument"); + this.javaType = javaType; + this.openType = openType; + this.openClass = makeOpenClass(javaType, openType); + } + + /** + *

      The Java type that was supplied to the constructor.

      + * @return the Java type that was supplied to the constructor. + */ + public final Type getJavaType() { + return javaType; + } + + /** + *

      The Open Type that was supplied to the constructor.

      + * @return the Open Type that was supplied to the constructor. + */ + public final OpenType getOpenType() { + return openType; + } + + /** + *

      The Java class that corresponds to instances of the + * {@linkplain #getOpenType() Open Type} for this mapping.

      + * @return the Java class that corresponds to instances of the + * Open Type for this mapping. + * @see OpenType#getClassName + */ + public final Class getOpenClass() { + return openClass; + } + + private static Class makeOpenClass(Type javaType, OpenType openType) { + if (javaType instanceof Class && ((Class) javaType).isPrimitive()) + return (Class) javaType; + try { + String className = OpenType.validClassName(openType.getClassName()); + return Class.forName(className, false, null); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); // should not happen + } catch (OpenDataException e) { + throw new IllegalArgumentException("Bad OpenType: " + openType, e); + } + } + + /** + *

      Convert an instance of the Open Type into the Java type. + * @param openValue the value to be converted. + * @return the converted value. + * @throws InvalidObjectException if the value cannot be converted. + */ + public abstract Object fromOpenValue(Object openValue) + throws InvalidObjectException; + + /** + *

      Convert an instance of the Java type into the Open Type. + * @param javaValue the value to be converted. + * @return the converted value. + * @throws OpenDataException if the value cannot be converted. + */ + public abstract Object toOpenValue(Object javaValue) + throws OpenDataException; + + + /** + *

      Throw an appropriate InvalidObjectException if we will not + * be able to convert back from the open data to the original Java + * object. The {@link #fromOpenValue fromOpenValue} throws an + * exception if a given open data value cannot be converted. This + * method throws an exception if no open data values can + * be converted. The default implementation of this method never + * throws an exception. Subclasses can override it as + * appropriate.

      + * @throws InvalidObjectException if {@code fromOpenValue} will throw + * an exception no matter what its argument is. + */ + public void checkReconstructible() throws InvalidObjectException {} +} diff --git a/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingClass.java b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingClass.java new file mode 100644 index 00000000000..f3afbc1024b --- /dev/null +++ b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingClass.java @@ -0,0 +1,61 @@ +/* + * 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 javax.management.openmbean; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import javax.management.NotCompliantMBeanException; + +/** + * Specifies the MXBean mapping to be used for this Java type. + * @see MXBeanMapping + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +@Documented @Inherited +public @interface MXBeanMappingClass { + /** + *

      The {@link MXBeanMapping} class to be used to map the + * annotated type. This class must have a public constructor with + * a single argument of type {@link java.lang.reflect.Type}. The + * constructor will be called with the annotated type as an + * argument. See the {@code MXBeanMapping} documentation + * for an example.

      + * + *

      If the {@code MXBeanMapping} cannot in fact handle that + * type, the constructor should throw an {@link + * OpenDataException}. If the constructor throws this or any other + * exception then an MXBean in which the annotated type appears is + * invalid, and registering it in the MBean Server will produce a + * {@link NotCompliantMBeanException}. + */ + public Class value(); +} diff --git a/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactory.java b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactory.java new file mode 100644 index 00000000000..0820bf86a5d --- /dev/null +++ b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactory.java @@ -0,0 +1,162 @@ +/* + * 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 javax.management.openmbean; + +import com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory; +import java.lang.reflect.Type; + +/** + *

      Defines how types are mapped for a given MXBean or set of MXBeans. + * An {@code MXBeanMappingFactory} can be specified either through the + * {@link MXBeanMappingFactoryClass} annotation, or through the + * {@link javax.management.JMX.MBeanOptions JMX.MBeanOptions} argument to a + * {@link javax.management.StandardMBean StandardMBean} constructor or MXBean + * proxy.

      + * + *

      An {@code MXBeanMappingFactory} must return an {@code MXBeanMapping} + * for any Java type that appears in the MXBeans that the factory is being + * used for. Usually it does that by handling any custom types, and + * forwarding everything else to the {@linkplain #DEFAULT default mapping + * factory}.

      + * + *

      Consider the {@code MyLinkedList} example from the {@link MXBeanMapping} + * documentation. If we are unable to change the {@code MyLinkedList} class + * to add an {@link MXBeanMappingClass} annotation, we could achieve the same + * effect by defining {@code MyLinkedListMappingFactory} as follows:

      + * + *
      + * public class MyLinkedListMappingFactory implements MXBeanMappingFactory {
      + *     public MyLinkedListMappingFactory() {}
      + *
      + *     public MXBeanMapping mappingForType(Type t, MXBeanMappingFactory f)
      + *     throws OpenDataException {
      + *         if (t == MyLinkedList.class)
      + *             return new MyLinkedListMapping(t);
      + *         else
      + *             return MXBeanMappingFactory.DEFAULT.mappingForType(t, f);
      + *     }
      + * }
      + * 
      + * + *

      The mapping factory handles only the {@code MyLinkedList} class. + * Every other type is forwarded to the default mapping factory. + * This includes types such as {@code MyLinkedList[]} and + * {@code List}; the default mapping factory will recursively + * invoke {@code MyLinkedListMappingFactory} to map the contained + * {@code MyLinkedList} type.

      + * + *

      Once we have defined {@code MyLinkedListMappingFactory}, we can use + * it in an MXBean interface like this:

      + * + *
      + * {@literal @MXBeanMappingFactoryClass}(MyLinkedListMappingFactory.class)
      + * public interface SomethingMXBean {
      + *     public MyLinkedList getSomething();
      + * }
      + * 
      + * + *

      Alternatively we can annotate the package that {@code SomethingMXBean} + * appears in, or we can supply the factory to a {@link + * javax.management.StandardMBean StandardMBean} constructor or MXBean + * proxy.

      + */ +public abstract class MXBeanMappingFactory { + /** + *

      Construct an instance of this class.

      + */ + protected MXBeanMappingFactory() {} + + /** + *

      Mapping factory that applies the default rules for MXBean + * mappings, as described in the MXBean specification.

      + */ + public static final MXBeanMappingFactory DEFAULT = + new DefaultMXBeanMappingFactory(); + + /** + *

      Determine the appropriate MXBeanMappingFactory to use for the given + * MXBean interface, based on its annotations. If the interface has an + * {@link MXBeanMappingFactoryClass @MXBeanMappingFactoryClass} annotation, + * that is used to determine the MXBeanMappingFactory. Otherwise, if the + * package containing the interface has such an annotation, that is used. + * Otherwise the MXBeanMappingFactory is the {@linkplain #DEFAULT default} + * one.

      + * + * @param intf the MXBean interface for which to determine the + * MXBeanMappingFactory. + * + * @return the MXBeanMappingFactory for the given MXBean interface. + * + * @throws IllegalArgumentException if {@code intf} is null, or if an + * exception occurs while trying constructing an MXBeanMappingFactory + * based on an annotation. In the second case, the exception will appear + * in the {@linkplain Throwable#getCause() cause chain} of the + * {@code IllegalArgumentException}. + */ + public static MXBeanMappingFactory forInterface(Class intf) { + if (intf == null) + throw new IllegalArgumentException("Null interface"); + MXBeanMappingFactoryClass annot = + intf.getAnnotation(MXBeanMappingFactoryClass.class); + if (annot == null) { + Package p = intf.getPackage(); + if (p != null) + annot = p.getAnnotation(MXBeanMappingFactoryClass.class); + } + if (annot == null) + return MXBeanMappingFactory.DEFAULT; + Class factoryClass = annot.value(); + try { + return annot.value().newInstance(); + } catch (Exception e) { + throw new IllegalArgumentException( + "Could not instantiate MXBeanMappingFactory " + + factoryClass.getName() + + " from @MXBeanMappingFactoryClass", e); + } + } + + /** + *

      Return the mapping for the given Java type. Typically, a + * mapping factory will return mappings for types it handles, and + * forward other types to another mapping factory, most often + * the {@linkplain #DEFAULT default one}.

      + * @param t the Java type to be mapped. + * @param f the original mapping factory that was consulted to do + * the mapping. A mapping factory should pass this parameter intact + * if it forwards a type to another mapping factory. In the example, + * this is how {@code MyLinkedListMappingFactory} works for types + * like {@code MyLinkedList[]} and {@code List}. + * @return the mapping for the given type. + * @throws OpenDataException if this type cannot be mapped. This + * exception is appropriate if the factory is supposed to handle + * all types of this sort (for example, all linked lists), but + * cannot handle this particular type. + */ + public abstract MXBeanMapping mappingForType(Type t, MXBeanMappingFactory f) + throws OpenDataException; +} diff --git a/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactoryClass.java b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactoryClass.java new file mode 100644 index 00000000000..e707ef81ed9 --- /dev/null +++ b/jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactoryClass.java @@ -0,0 +1,72 @@ +/* + * 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 javax.management.openmbean; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + *

      Specifies the MXBean mapping factory to be used for Java types + * in an MXBean interface, or in all MXBean interfaces in a package.

      + * + *

      Applying a mapping factory to all Java types in an MXBean interface + * looks like this:

      + * + *
      + * {@literal @MXBeanMappingFactoryClass}(MyLinkedListMappingFactory.class)
      + * public interface SomethingMXBean {
      + *     public MyLinkedList getSomething();
      + * }
      + * 
      + * + *

      Applying a mapping factory to all Java types in all MXBean interfaces + * in a package, say {@code com.example.mxbeans}, looks like this. In the + * package source directory, create a file called {@code package-info.java} + * with these contents:

      + * + *
      + * {@literal @MXBeanMappingFactoryClass}(MyLinkedListMappingFactory.class)
      + * package com.example.mxbeans;
      + * 
      + * + * @see MXBeanMappingFactory + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.PACKAGE}) +@Documented @Inherited +public @interface MXBeanMappingFactoryClass { + /** + *

      The {@link MXBeanMappingFactory} class to be used to map + * types in the annotated interface or package. This class must + * have a public constructor with no arguments. See the {@code + * MXBeanMappingFactory} documentation for an example.

      + */ + public Class value(); +} diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java index 797a8787344..bcfa4c157ad 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanAttributeInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java index d416c49d0da..ef155b6fdcf 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanConstructorInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java index 6079ad62b76..78b06d7f83c 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java index 61f182db9e6..2bfe931a98b 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenMBeanOperationInfoSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/OpenType.java b/jdk/src/share/classes/javax/management/openmbean/OpenType.java index 34d8e925c8c..7aac2c0fd8f 100644 --- a/jdk/src/share/classes/javax/management/openmbean/OpenType.java +++ b/jdk/src/share/classes/javax/management/openmbean/OpenType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -219,7 +219,7 @@ public abstract class OpenType implements Serializable { }); } - private static String validClassName(String className) throws OpenDataException { + static String validClassName(String className) throws OpenDataException { className = valid("className", className); // Check if className describes an array class, and determines its elements' class name. diff --git a/jdk/src/share/classes/javax/management/openmbean/SimpleType.java b/jdk/src/share/classes/javax/management/openmbean/SimpleType.java index 60bb3ff40bb..7837819c4c2 100644 --- a/jdk/src/share/classes/javax/management/openmbean/SimpleType.java +++ b/jdk/src/share/classes/javax/management/openmbean/SimpleType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/openmbean/TabularType.java b/jdk/src/share/classes/javax/management/openmbean/TabularType.java index dfd621359ec..b45f2f661d5 100644 --- a/jdk/src/share/classes/javax/management/openmbean/TabularType.java +++ b/jdk/src/share/classes/javax/management/openmbean/TabularType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/package.html b/jdk/src/share/classes/javax/management/package.html index 8d6205c2411..14027d648ea 100644 --- a/jdk/src/share/classes/javax/management/package.html +++ b/jdk/src/share/classes/javax/management/package.html @@ -56,41 +56,41 @@ have any questions. resource. It has a management interface consisting of:

      -
        -
      • named and typed attributes that can be read and/or - written
      • - -
      • named and typed operations that can be invoked
      • +
          +
        • named and typed attributes that can be read and/or + written
        • -
        • typed notifications that can be emitted by the MBean.
        • -
        +
      • named and typed operations that can be invoked
      • -

        For example, an MBean representing an application's - configuration could have attributes representing the different - configuration items. Reading the CacheSize - attribute would return the current value of that item. - Writing it would update the item, potentially changing the - behavior of the running application. An operation such as - save could store the current configuration - persistently. A notification such as - ConfigurationChangedNotification could be sent - every time the configuration is changed.

        +
      • typed notifications that can be emitted by the MBean.
      • +
      -

      In the standard usage of the JMX API, MBeans are implemented - as Java objects. However, as explained below, these objects are - not usually referenced directly.

      +

      For example, an MBean representing an application's + configuration could have attributes representing the different + configuration items. Reading the CacheSize + attribute would return the current value of that item. + Writing it would update the item, potentially changing the + behavior of the running application. An operation such as + save could store the current configuration + persistently. A notification such as + ConfigurationChangedNotification could be sent + every time the configuration is changed.

      + +

      In the standard usage of the JMX API, MBeans are implemented + as Java objects. However, as explained below, these objects are + not usually referenced directly.

      -

      Standard MBeans

      +

      Standard MBeans

      -

      To make MBean implementation simple, the JMX API includes the - notion of Standard MBeans. A Standard MBean is one - whose attributes and operations are deduced from a Java - interface using certain naming patterns, similar to those used - by JavaBeansTM. For - example, consider an interface like this:

      +

      To make MBean implementation simple, the JMX API includes the + notion of Standard MBeans. A Standard MBean is one + whose attributes and operations are deduced from a Java + interface using certain naming patterns, similar to those used + by JavaBeansTM. For + example, consider an interface like this:

      -
      +        
           public interface ConfigurationMBean {
       	public int getCacheSize();
       	public void setCacheSize(int size);
      @@ -128,107 +128,148 @@ have any questions.
       	class.

      -

      MXBeans

      - -

      An MXBean is a variant of Standard MBean where complex - types are mapped to a standard set of types defined in the - {@link javax.management.openmbean} package. MXBeans are appropriate - if you would otherwise need to reference application-specific - classes in your MBean interface. They are described in detail - in the specification for {@link javax.management.MXBean MXBean}. +

      Defining Standard MBeans with annotations

      + +

      As an alternative to creating an interface such as + ConfigurationMBean and a class that implements it, + you can write just the class, and use annotations to pick out the + public methods that will make up the management interface. For + example, the following class has the same management interface + as a Configuration class that implements the + ConfigurationMBean interface above.

      + +
      +    {@link javax.management.MBean @MBean}
      +    public class Configuration {
      +        {@link javax.management.ManagedAttribute @ManagedAttribute}
      +        public int getCacheSize() {...}
      +        @ManagedAttribute
      +        public void setCacheSize(int size) {...}
      +
      +        @ManagedAttribute
      +        public long getLastChangedTime() {...}
      +
      +        {@link javax.management.ManagedOperation @ManagedOperation}
      +        public void save() {...}
      +        ...
      +    }
      +        
      + +

      This approach simplifies development, but it does have two + potential drawbacks. First, if you run the Javadoc tool on + this class, the documentation of the management interface may + be mixed in with the documentation of non-management methods + in the class. Second, you cannot make a proxy + as described below if you do not have an + interface like ConfigurationMBean.

      -

      Dynamic MBeans

      +

      MXBeans

      -

      A Dynamic MBean is an MBean that defines its - management interface at run-time. For example, a configuration - MBean could determine the names and types of the attributes it - exposes by parsing an XML file.

      +

      An MXBean is a variant of Standard MBean where complex + types are mapped to a standard set of types defined in the + {@link javax.management.openmbean} package. MXBeans are appropriate + if you would otherwise need to reference application-specific + classes in your MBean interface. They are described in detail + in the specification for {@link javax.management.MXBean MXBean}.

      -

      Any Java object of a class that implements the {@link - javax.management.DynamicMBean DynamicMBean} interface is a - Dynamic MBean.

      +

      You can define MXBeans using annotations as described + in the previous section, but + using the @MXBean annotation instead of + @MBean.

      -

      Open MBeans

      +

      Dynamic MBeans

      -

      An Open MBean is a kind of Dynamic MBean where the - types of attributes and of operation parameters and return - values are built using a small set of predefined Java classes. - Open MBeans facilitate operation with remote management programs - that do not necessarily have access to application-specific - types, including non-Java programs. Open MBeans are defined by - the package - javax.management.openmbean.

      +

      A Dynamic MBean is an MBean that defines its + management interface at run-time. For example, a configuration + MBean could determine the names and types of the attributes it + exposes by parsing an XML file.

      + +

      Any Java object of a class that implements the {@link + javax.management.DynamicMBean DynamicMBean} interface is a + Dynamic MBean.

      -

      Model MBeans

      +

      Open MBeans

      -

      A Model MBean is a kind of Dynamic MBean that acts - as a bridge between the management interface and the - underlying managed resource. Both the management interface and - the managed resource are specified as Java objects. The same - Model MBean implementation can be reused many times with - different management interfaces and managed resources, and it can - provide common functionality such as persistence and caching. - Model MBeans are defined by the package - - javax.management.modelmbean.

      +

      An Open MBean is a kind of Dynamic MBean where the + types of attributes and of operation parameters and return + values are built using a small set of predefined Java classes. + Open MBeans facilitate operation with remote management programs + that do not necessarily have access to application-specific + types, including non-Java programs. Open MBeans are defined by + the package + javax.management.openmbean.

      -

      MBean Server

      - -

      To be useful, an MBean must be registered in an MBean - Server. An MBean Server is a repository of MBeans. - Usually the only access to the MBeans is through the MBean - Server. In other words, code no longer accesses the Java - object implementing the MBean directly, but instead accesses - the MBean by name through the MBean Server. Each MBean has a - unique name within the MBean Server, defined by the {@link - javax.management.ObjectName ObjectName} class.

      - -

      An MBean Server is an object implementing the interface - {@link javax.management.MBeanServer MBeanServer}. - The most convenient MBean Server to use is the - Platform MBean Server. This is a - single MBean Server that can be shared by different managed - components running within the same Java Virtual Machine. The - Platform MBean Server is accessed with the method {@link - java.lang.management.ManagementFactory#getPlatformMBeanServer()}.

      +

      Model MBeans

      -

      Application code can also create a new MBean Server, or - access already-created MBean Servers, using the {@link - javax.management.MBeanServerFactory MBeanServerFactory} class.

      +

      A Model MBean is a kind of Dynamic MBean that acts + as a bridge between the management interface and the + underlying managed resource. Both the management interface and + the managed resource are specified as Java objects. The same + Model MBean implementation can be reused many times with + different management interfaces and managed resources, and it can + provide common functionality such as persistence and caching. + Model MBeans are defined by the package + + javax.management.modelmbean.

      -

      Creating MBeans in the MBean Server

      +

      MBean Server

      -

      There are two ways to create an MBean. One is to construct a - Java object that will be the MBean, then use the {@link - javax.management.MBeanServer#registerMBean registerMBean} - method to register it in the MBean Server. The other is to - create and register the MBean in a single operation using one - of the {@link javax.management.MBeanServer#createMBean(String, - javax.management.ObjectName) createMBean} methods.

      +

      To be useful, an MBean must be registered in an MBean + Server. An MBean Server is a repository of MBeans. + Usually the only access to the MBeans is through the MBean + Server. In other words, code no longer accesses the Java + object implementing the MBean directly, but instead accesses + the MBean by name through the MBean Server. Each MBean has a + unique name within the MBean Server, defined by the {@link + javax.management.ObjectName ObjectName} class.

      -

      The registerMBean method is simpler for local - use, but cannot be used remotely. The - createMBean method can be used remotely, but - sometimes requires attention to class loading issues.

      +

      An MBean Server is an object implementing the interface + {@link javax.management.MBeanServer MBeanServer}. + The most convenient MBean Server to use is the + Platform MBean Server. This is a + single MBean Server that can be shared by different managed + components running within the same Java Virtual Machine. The + Platform MBean Server is accessed with the method {@link + java.lang.management.ManagementFactory#getPlatformMBeanServer()}.

      -

      An MBean can perform actions when it is registered in or - unregistered from an MBean Server if it implements the {@link - javax.management.MBeanRegistration MBeanRegistration} - interface.

      +

      Application code can also create a new MBean Server, or + access already-created MBean Servers, using the {@link + javax.management.MBeanServerFactory MBeanServerFactory} class.

      -

      Accessing MBeans in the MBean Server

      +

      Creating MBeans in the MBean Server

      -

      Given an ObjectName name and an - MBeanServer mbs, you can access - attributes and operations as in this example:

      +

      There are two ways to create an MBean. One is to construct a + Java object that will be the MBean, then use the {@link + javax.management.MBeanServer#registerMBean registerMBean} + method to register it in the MBean Server. The other is to + create and register the MBean in a single operation using one + of the {@link javax.management.MBeanServer#createMBean(String, + javax.management.ObjectName) createMBean} methods.

      -
      +        

      The registerMBean method is simpler for local + use, but cannot be used remotely. The + createMBean method can be used remotely, but + sometimes requires attention to class loading issues.

      + +

      An MBean can perform actions when it is registered in or + unregistered from an MBean Server if it implements the {@link + javax.management.MBeanRegistration MBeanRegistration} + interface.

      + + +

      Accessing MBeans in the MBean Server

      + +

      Given an ObjectName name and an + MBeanServer mbs, you can access + attributes and operations as in this example:

      + +
           int cacheSize = mbs.getAttribute(name, "CacheSize");
           {@link javax.management.Attribute Attribute} newCacheSize =
           	new Attribute("CacheSize", new Integer(2000));
      @@ -236,9 +277,9 @@ have any questions.
           mbs.invoke(name, "save", new Object[0], new Class[0]);
             
      -

      Alternatively, if you have a Java interface that corresponds - to the management interface for the MBean, you can use an - MBean proxy like this:

      +

      Alternatively, if you have a Java interface that + corresponds to the management interface for the MBean, you can use an + MBean proxy like this:

           ConfigurationMBean conf =
      @@ -264,66 +305,116 @@ have any questions.
       	perform the query.

      -

      Notifications

      +

      MBean lifecycle and resource injection

      -

      A notification is an instance of the {@link - javax.management.Notification Notification} class or a - subclass. In addition to its Java class, it has a - type string that can distinguish it from other - notifications of the same class.

      +

      An MBean can implement the {@link javax.management.MBeanRegistration + MBeanRegistration} interface in order to be told when it is registered + and unregistered in the MBean Server. Additionally, the {@link + javax.management.MBeanRegistration#preRegister preRegister} method + allows the MBean to get a reference to the MBeanServer + object and to get its ObjectName within the MBean + Server.

      -

      An MBean that will emit notifications must implement the - {@link javax.management.NotificationBroadcaster - NotificationBroadcaster} or {@link - javax.management.NotificationEmitter NotificationEmitter} - interface. Usually, it does this by subclassing {@link - javax.management.NotificationBroadcasterSupport - NotificationBroadcasterSupport} or by delegating to an instance - of that class.

      - -

      Notifications can be received by a listener, which - is an object that implements the {@link - javax.management.NotificationListener NotificationListener} - interface. You can add a listener to an MBean with the method - {@link - javax.management.MBeanServer#addNotificationListener(ObjectName, - NotificationListener, NotificationFilter, Object)}. - You can optionally supply a filter to this method, to - select only notifications of interest. A filter is an object - that implements the {@link javax.management.NotificationFilter - NotificationFilter} interface.

      - -

      An MBean can be a listener for notifications emitted by other - MBeans in the same MBean Server. In this case, it implements - {@link javax.management.NotificationListener - NotificationListener} and the method {@link - javax.management.MBeanServer#addNotificationListener(ObjectName, - ObjectName, NotificationFilter, Object)} is used to listen.

      +

      If the only reason to implement MBeanRegistration is to + discover the MBeanServer and ObjectName, resource injection may be + more convenient.

      -

      Remote Access to MBeans

      +

      Notifications

      -

      An MBean Server can be accessed remotely through a - connector. A connector allows a remote Java - application to access an MBean Server in essentially the same - way as a local one. The package - - javax.management.remote defines connectors.

      +

      A notification is an instance of the {@link + javax.management.Notification Notification} class or a + subclass. In addition to its Java class, it has a + type string that can distinguish it from other + notifications of the same class.

      -

      The JMX specification also defines the notion of an - adaptor. An adaptor translates between requests in a - protocol such as SNMP or HTML and accesses to an MBean Server. - So for example an SNMP GET operation might result in a - getAttribute on the MBean Server.

      +

      If an MBean is to emit notifications, it must do one of two things.

      -

      - @see - Java SE 6 Platform documentation on JMX technology - in particular the - - JMX Specification, version 1.4(pdf). +

        +
      • It can implement the interface {@link + javax.management.NotificationEmitter NotificationEmitter} (or + its parent {@link javax.management.NotificationBroadcaster + NotificationBroadcaster}), usually by subclassing + {@link javax.management.NotificationBroadcasterSupport + NotificationBroadcasterSupport} or delegating to an instance of + that class.
      • +
      • It can use resource + injection to obtain a {@link javax.management.SendNotification + SendNotification} object that it can use to send + notifications.
      • +
      - @since 1.5 +

      The two classes below illustrate these two techniques:

      + +
      +    // Implementing NotificationEmitter (via NotificationBroadcasterSupport)
      +    public class Configuration extends NotificationBroadcasterSupport
      +            implements ConfigurationMBean {
      +        ...
      +        private void updated() {
      +            Notification n = new Notification(...);
      +            {@link javax.management.NotificationBroadcasterSupport#sendNotification
      +            sendNotification}(n);
      +        }
      +    }
      +
      +    // Getting a SendNotification through resource injection
      +    public class Configuration implements ConfigurationMBean {
      +        @Resource
      +        private volatile SendNotification sender;
      +        ...
      +        private void updated() {
      +            Notification n = new Notification(...);
      +            sender.sendNotification(n);
      +        }
      +    }
      +        
      + + +

      Notifications can be received by a listener, which + is an object that implements the {@link + javax.management.NotificationListener NotificationListener} + interface. You can add a listener to an MBean with the method + {@link + javax.management.MBeanServer#addNotificationListener(ObjectName, + NotificationListener, NotificationFilter, Object)}. + You can optionally supply a filter to this method, to + select only notifications of interest. A filter is an object + that implements the {@link javax.management.NotificationFilter + NotificationFilter} interface.

      + +

      An MBean can be a listener for notifications emitted by other + MBeans in the same MBean Server. In this case, it implements + {@link javax.management.NotificationListener + NotificationListener} and the method {@link + javax.management.MBeanServer#addNotificationListener(ObjectName, + ObjectName, NotificationFilter, Object)} is used to listen.

      + + +

      Remote Access to MBeans

      + +

      An MBean Server can be accessed remotely through a + connector. A connector allows a remote Java + application to access an MBean Server in essentially the same + way as a local one. The package + + javax.management.remote defines connectors.

      + +

      The JMX specification also defines the notion of an + adaptor. An adaptor translates between requests in a + protocol such as SNMP or HTML and accesses to an MBean Server. + So for example an SNMP GET operation might result in a + getAttribute on the MBean Server.

      + +

      + @see + Java SE 6 Platform documentation on JMX technology + in particular the + + JMX Specification, version 1.4(pdf). + + @since 1.5 diff --git a/jdk/src/share/classes/javax/management/relation/RelationNotification.java b/jdk/src/share/classes/javax/management/relation/RelationNotification.java index 70d3ba7e791..54a8dfdff49 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationNotification.java +++ b/jdk/src/share/classes/javax/management/relation/RelationNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/relation/RelationService.java b/jdk/src/share/classes/javax/management/relation/RelationService.java index 79ed35a1977..5950aafa573 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationService.java +++ b/jdk/src/share/classes/javax/management/relation/RelationService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/relation/RelationSupport.java b/jdk/src/share/classes/javax/management/relation/RelationSupport.java index 24a40514ba4..ed0958e9b4a 100644 --- a/jdk/src/share/classes/javax/management/relation/RelationSupport.java +++ b/jdk/src/share/classes/javax/management/relation/RelationSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java b/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java index 07b766741dd..23003f007c5 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java +++ b/jdk/src/share/classes/javax/management/remote/JMXConnectorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java b/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java index 0ea7aa66251..a641f3c98d9 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java +++ b/jdk/src/share/classes/javax/management/remote/JMXConnectorServerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java index 349f1752ad6..f2b19c5ef0b 100644 --- a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java +++ b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java index e5bb512f231..2f5f234eac1 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java +++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java index 8ad0cfbb95e..28015461b2b 100644 --- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java +++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnectorServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/javax/management/timer/Timer.java b/jdk/src/share/classes/javax/management/timer/Timer.java index d0dfa4cdc15..ea4d0b24a2a 100644 --- a/jdk/src/share/classes/javax/management/timer/Timer.java +++ b/jdk/src/share/classes/javax/management/timer/Timer.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java index bb2e2d93fc3..4fdc34c3207 100644 --- a/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java +++ b/jdk/src/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java b/jdk/src/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java index 9d266fac861..b21d8607106 100644 --- a/jdk/src/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java +++ b/jdk/src/share/classes/javax/rmi/ssl/SslRMIClientSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/src/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java b/jdk/src/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java index 802e1668b86..4ea12445010 100644 --- a/jdk/src/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java +++ b/jdk/src/share/classes/javax/rmi/ssl/SslRMIServerSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java index 6fcffbdeecc..a91f3925267 100644 --- a/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java +++ b/jdk/src/share/classes/javax/security/auth/kerberos/KeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/security/cert/X509Certificate.java b/jdk/src/share/classes/javax/security/cert/X509Certificate.java index 14ccaffaffd..c411d307577 100644 --- a/jdk/src/share/classes/javax/security/cert/X509Certificate.java +++ b/jdk/src/share/classes/javax/security/cert/X509Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java index d28113b9177..3c084afd17f 100644 --- a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java +++ b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -263,7 +263,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { (SubRegionShowable)bufferStrategy; boolean paintAllOnExpose = info.getPaintAllOnExpose(); info.setPaintAllOnExpose(false); - if (bsSubRegion.validateAndShow(x, y, (x + w), (y + h))) { + if (bsSubRegion.showIfNotLost(x, y, (x + w), (y + h))) { return !paintAllOnExpose; } // Mark the buffer as needing to be repainted. We don't diff --git a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java index 635be42475e..f9e6c72a984 100644 --- a/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java +++ b/jdk/src/share/classes/javax/swing/DebugGraphicsInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JEditorPane.java b/jdk/src/share/classes/javax/swing/JEditorPane.java index c126fe70c01..4d70cacb7b2 100644 --- a/jdk/src/share/classes/javax/swing/JEditorPane.java +++ b/jdk/src/share/classes/javax/swing/JEditorPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JFileChooser.java b/jdk/src/share/classes/javax/swing/JFileChooser.java index 8a2b2d5393f..4a213df6273 100644 --- a/jdk/src/share/classes/javax/swing/JFileChooser.java +++ b/jdk/src/share/classes/javax/swing/JFileChooser.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -770,7 +770,8 @@ public class JFileChooser extends JComponent implements Accessible { * @since 1.4 */ protected JDialog createDialog(Component parent) throws HeadlessException { - String title = getUI().getDialogTitle(this); + FileChooserUI ui = getUI(); + String title = ui.getDialogTitle(this); putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY, title); @@ -794,6 +795,7 @@ public class JFileChooser extends JComponent implements Accessible { dialog.getRootPane().setWindowDecorationStyle(JRootPane.FILE_CHOOSER_DIALOG); } } + dialog.getRootPane().setDefaultButton(ui.getDefaultButton(this)); dialog.pack(); dialog.setLocationRelativeTo(parent); diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java index 67d39b0cbb7..c3e3cad1c11 100644 --- a/jdk/src/share/classes/javax/swing/JInternalFrame.java +++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JOptionPane.java b/jdk/src/share/classes/javax/swing/JOptionPane.java index 130d9f666a0..0e2f528470a 100644 --- a/jdk/src/share/classes/javax/swing/JOptionPane.java +++ b/jdk/src/share/classes/javax/swing/JOptionPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JPopupMenu.java b/jdk/src/share/classes/javax/swing/JPopupMenu.java index b1cdd7db6af..83aec9a17b3 100644 --- a/jdk/src/share/classes/javax/swing/JPopupMenu.java +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -41,6 +41,7 @@ import javax.swing.plaf.PopupMenuUI; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.basic.BasicComboPopup; import javax.swing.event.*; +import sun.security.util.SecurityConstants; import java.applet.Applet; @@ -320,17 +321,67 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { * This adustment may be cancelled by invoking the application with * -Djavax.swing.adjustPopupLocationToFit=false */ - Point adjustPopupLocationToFitScreen(int xposition, int yposition) { - Point p = new Point(xposition, yposition); + Point adjustPopupLocationToFitScreen(int xPosition, int yPosition) { + Point popupLocation = new Point(xPosition, yPosition); - if(popupPostionFixDisabled == true || GraphicsEnvironment.isHeadless()) - return p; + if(popupPostionFixDisabled == true || GraphicsEnvironment.isHeadless()) { + return popupLocation; + } + // Get screen bounds + Rectangle scrBounds; + GraphicsConfiguration gc = getCurrentGraphicsConfiguration(popupLocation); Toolkit toolkit = Toolkit.getDefaultToolkit(); - Rectangle screenBounds; + if(gc != null) { + // If we have GraphicsConfiguration use it to get screen bounds + scrBounds = gc.getBounds(); + } else { + // If we don't have GraphicsConfiguration use primary screen + scrBounds = new Rectangle(toolkit.getScreenSize()); + } + + // Calculate the screen size that popup should fit + Dimension popupSize = JPopupMenu.this.getPreferredSize(); + int popupRightX = popupLocation.x + popupSize.width; + int popupBottomY = popupLocation.y + popupSize.height; + int scrWidth = scrBounds.width; + int scrHeight = scrBounds.height; + if (!canPopupOverlapTaskBar()) { + // Insets include the task bar. Take them into account. + Insets scrInsets = toolkit.getScreenInsets(gc); + scrBounds.x += scrInsets.left; + scrBounds.y += scrInsets.top; + scrWidth -= scrInsets.left + scrInsets.right; + scrHeight -= scrInsets.top + scrInsets.bottom; + } + int scrRightX = scrBounds.x + scrWidth; + int scrBottomY = scrBounds.y + scrHeight; + + // Ensure that popup menu fits the screen + if (popupRightX > scrRightX) { + popupLocation.x = scrRightX - popupSize.width; + if( popupLocation.x < scrBounds.x ) { + popupLocation.x = scrBounds.x ; + } + } + if (popupBottomY > scrBottomY) { + popupLocation.y = scrBottomY - popupSize.height; + if( popupLocation.y < scrBounds.y ) { + popupLocation.y = scrBounds.y; + } + } + + return popupLocation; + } + + /** + * Tries to find GraphicsConfiguration + * that contains the mouse cursor position. + * Can return null. + */ + private GraphicsConfiguration getCurrentGraphicsConfiguration( + Point popupLocation) { GraphicsConfiguration gc = null; - // Try to find GraphicsConfiguration, that includes mouse - // pointer position GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] gd = ge.getScreenDevices(); @@ -338,50 +389,36 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement { if(gd[i].getType() == GraphicsDevice.TYPE_RASTER_SCREEN) { GraphicsConfiguration dgc = gd[i].getDefaultConfiguration(); - if(dgc.getBounds().contains(p)) { + if(dgc.getBounds().contains(popupLocation)) { gc = dgc; break; } } } - // If not found and we have invoker, ask invoker about his gc if(gc == null && getInvoker() != null) { gc = getInvoker().getGraphicsConfiguration(); } + return gc; + } - if(gc != null) { - // If we have GraphicsConfiguration use it to get - // screen bounds - screenBounds = gc.getBounds(); - } else { - // If we don't have GraphicsConfiguration use primary screen - screenBounds = new Rectangle(toolkit.getScreenSize()); + /** + * Checks that there are enough security permissions + * to make popup "always on top", which allows to show it above the task bar. + */ + static boolean canPopupOverlapTaskBar() { + boolean result = true; + try { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission( + SecurityConstants.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION); + } + } catch (SecurityException se) { + // There is no permission to show popups over the task bar + result = false; } - - Dimension size; - - size = JPopupMenu.this.getPreferredSize(); - - // Use long variables to prevent overflow - long pw = (long) p.x + (long) size.width; - long ph = (long) p.y + (long) size.height; - - if( pw > screenBounds.x + screenBounds.width ) - p.x = screenBounds.x + screenBounds.width - size.width; - - if( ph > screenBounds.y + screenBounds.height) - p.y = screenBounds.y + screenBounds.height - size.height; - - /* Change is made to the desired (X,Y) values, when the - PopupMenu is too tall OR too wide for the screen - */ - if( p.x < screenBounds.x ) - p.x = screenBounds.x ; - if( p.y < screenBounds.y ) - p.y = screenBounds.y; - - return p; + return result; } diff --git a/jdk/src/share/classes/javax/swing/JProgressBar.java b/jdk/src/share/classes/javax/swing/JProgressBar.java index 68a6322c39a..b1d27c8cd02 100644 --- a/jdk/src/share/classes/javax/swing/JProgressBar.java +++ b/jdk/src/share/classes/javax/swing/JProgressBar.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JScrollBar.java b/jdk/src/share/classes/javax/swing/JScrollBar.java index 2136fe62975..5897fd6fad8 100644 --- a/jdk/src/share/classes/javax/swing/JScrollBar.java +++ b/jdk/src/share/classes/javax/swing/JScrollBar.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JSlider.java b/jdk/src/share/classes/javax/swing/JSlider.java index e1a7909b073..ea2b510be1d 100644 --- a/jdk/src/share/classes/javax/swing/JSlider.java +++ b/jdk/src/share/classes/javax/swing/JSlider.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -25,18 +25,15 @@ package javax.swing; -import javax.swing.border.*; import javax.swing.event.*; import javax.swing.plaf.*; import javax.accessibility.*; import java.io.Serializable; import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; import java.io.IOException; -import java.awt.Color; -import java.awt.Font; +import java.awt.*; import java.util.*; import java.beans.*; @@ -409,8 +406,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { * @since 1.4 */ public ChangeListener[] getChangeListeners() { - return (ChangeListener[])listenerList.getListeners( - ChangeListener.class); + return listenerList.getListeners(ChangeListener.class); } @@ -642,9 +638,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { /** * Sets the model's {@code valueIsAdjusting} property. Slider look and * feel implementations should set this property to {@code true} when - * a knob drag begins, and to {@code false} when the drag ends. The - * slider model will not generate {@code ChangeEvent}s while - * {@code valueIsAdjusting} is {@code true}. + * a knob drag begins, and to {@code false} when the drag ends. * * @param b the new value for the {@code valueIsAdjusting} property * @see #getValueIsAdjusting @@ -764,6 +758,33 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { updateLabelSizes(); } + /** + * {@inheritDoc} + * @since 1.7 + */ + public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { + if (!isShowing()) { + return false; + } + + // Check that there is a label with such image + Enumeration elements = labelTable.elements(); + + while (elements.hasMoreElements()) { + Component component = (Component) elements.nextElement(); + + if (component instanceof JLabel) { + JLabel label = (JLabel) component; + + if (SwingUtilities.doesIconReferenceImage(label.getIcon(), img) || + SwingUtilities.doesIconReferenceImage(label.getDisabledIcon(), img)) { + return super.imageUpdate(img, infoflags, x, y, w, h); + } + } + } + + return false; + } /** * Returns the dictionary of what labels to draw at which values. @@ -826,17 +847,16 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { * @see JComponent#updateUI */ protected void updateLabelUIs() { - if ( getLabelTable() == null ) { + Dictionary labelTable = getLabelTable(); + + if (labelTable == null) { return; } - Enumeration labels = getLabelTable().keys(); + Enumeration labels = labelTable.keys(); while ( labels.hasMoreElements() ) { - Object value = getLabelTable().get( labels.nextElement() ); - if ( value instanceof JComponent ) { - JComponent component = (JComponent)value; - component.updateUI(); - component.setSize( component.getPreferredSize() ); - } + JComponent component = (JComponent) labelTable.get(labels.nextElement()); + component.updateUI(); + component.setSize(component.getPreferredSize()); } } @@ -845,11 +865,8 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { if (labelTable != null) { Enumeration labels = labelTable.elements(); while (labels.hasMoreElements()) { - Object value = labels.nextElement(); - if (value instanceof JComponent) { - JComponent component = (JComponent)value; - component.setSize(component.getPreferredSize()); - } + JComponent component = (JComponent) labels.nextElement(); + component.setSize(component.getPreferredSize()); } } } @@ -960,14 +977,14 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { if ( e.getPropertyName().equals( "minimum" ) || e.getPropertyName().equals( "maximum" ) ) { - Enumeration keys = getLabelTable().keys(); - Object key = null; + Dictionary labelTable = getLabelTable(); + Enumeration keys = labelTable.keys(); Hashtable hashtable = new Hashtable(); // Save the labels that were added by the developer while ( keys.hasMoreElements() ) { - key = keys.nextElement(); - Object value = getLabelTable().get( key ); + Object key = keys.nextElement(); + Object value = labelTable.get(key); if ( !(value instanceof LabelUIResource) ) { hashtable.put( key, value ); } @@ -979,7 +996,7 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { // Add the saved labels keys = hashtable.keys(); while ( keys.hasMoreElements() ) { - key = keys.nextElement(); + Object key = keys.nextElement(); put( key, hashtable.get( key ) ); } @@ -996,8 +1013,10 @@ public class JSlider extends JComponent implements SwingConstants, Accessible { SmartHashtable table = new SmartHashtable( increment, start ); - if ( getLabelTable() != null && (getLabelTable() instanceof PropertyChangeListener) ) { - removePropertyChangeListener( (PropertyChangeListener)getLabelTable() ); + Dictionary labelTable = getLabelTable(); + + if (labelTable != null && (labelTable instanceof PropertyChangeListener)) { + removePropertyChangeListener((PropertyChangeListener) labelTable); } addPropertyChangeListener( table ); diff --git a/jdk/src/share/classes/javax/swing/JSplitPane.java b/jdk/src/share/classes/javax/swing/JSplitPane.java index d96a7ee7445..1e38b9f8b63 100644 --- a/jdk/src/share/classes/javax/swing/JSplitPane.java +++ b/jdk/src/share/classes/javax/swing/JSplitPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JTable.java b/jdk/src/share/classes/javax/swing/JTable.java index 62485a1c925..976cb813093 100644 --- a/jdk/src/share/classes/javax/swing/JTable.java +++ b/jdk/src/share/classes/javax/swing/JTable.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JTextArea.java b/jdk/src/share/classes/javax/swing/JTextArea.java index ad311900f74..539071c0ccc 100644 --- a/jdk/src/share/classes/javax/swing/JTextArea.java +++ b/jdk/src/share/classes/javax/swing/JTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/JTextPane.java b/jdk/src/share/classes/javax/swing/JTextPane.java index c820f512d7e..efb339bd59f 100644 --- a/jdk/src/share/classes/javax/swing/JTextPane.java +++ b/jdk/src/share/classes/javax/swing/JTextPane.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/MenuSelectionManager.java b/jdk/src/share/classes/javax/swing/MenuSelectionManager.java index aec83c9ab19..8e1f36a3aa0 100644 --- a/jdk/src/share/classes/javax/swing/MenuSelectionManager.java +++ b/jdk/src/share/classes/javax/swing/MenuSelectionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/Popup.java b/jdk/src/share/classes/javax/swing/Popup.java index a6373f87b16..0d1f2d53f19 100644 --- a/jdk/src/share/classes/javax/swing/Popup.java +++ b/jdk/src/share/classes/javax/swing/Popup.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -26,7 +26,9 @@ package javax.swing; import java.awt.*; + import sun.awt.ModalExclude; +import sun.awt.SunToolkit; /** * Popups are used to display a Component to the user, typically @@ -225,7 +227,12 @@ public class Popup { HeavyWeightWindow(Window parent) { super(parent); setFocusableWindowState(false); - setName("###overrideRedirect###"); + 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); + } // 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/PopupFactory.java b/jdk/src/share/classes/javax/swing/PopupFactory.java index 86b737750dd..f9c3c0dd5d7 100644 --- a/jdk/src/share/classes/javax/swing/PopupFactory.java +++ b/jdk/src/share/classes/javax/swing/PopupFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -548,47 +548,46 @@ public class PopupFactory { } /** - * Returns true if the Popup can fit on the screen. + * Returns true if popup can fit the screen and the owner's top parent. + * It determines can popup be lightweight or mediumweight. */ boolean fitsOnScreen() { + boolean result = false; Component component = getComponent(); - if (owner != null && component != null) { - Container parent; - int width = component.getWidth(); - int height = component.getHeight(); - for(parent = owner.getParent(); parent != null ; - parent = parent.getParent()) { - if (parent instanceof JFrame || - parent instanceof JDialog || - parent instanceof JWindow) { + Container parent = (Container) SwingUtilities.getRoot(owner); + int popupWidth = component.getWidth(); + int popupHeight = component.getHeight(); + Rectangle parentBounds = parent.getBounds(); + if (parent instanceof JFrame || + parent instanceof JDialog || + parent instanceof JWindow) { - Rectangle r = parent.getBounds(); - Insets i = parent.getInsets(); - r.x += i.left; - r.y += i.top; - r.width -= (i.left + i.right); - r.height -= (i.top + i.bottom); + Insets i = parent.getInsets(); + parentBounds.x += i.left; + parentBounds.y += i.top; + parentBounds.width -= i.left + i.right; + parentBounds.height -= i.top + i.bottom; - GraphicsConfiguration gc = parent.getGraphicsConfiguration(); + if (JPopupMenu.canPopupOverlapTaskBar()) { + GraphicsConfiguration gc = + parent.getGraphicsConfiguration(); Rectangle popupArea = getContainerPopupArea(gc); - return r.intersection(popupArea).contains(x, y, width, height); - - } else if (parent instanceof JApplet) { - Rectangle r = parent.getBounds(); - Point p = parent.getLocationOnScreen(); - - r.x = p.x; - r.y = p.y; - return r.contains(x, y, width, height); - } else if (parent instanceof Window || - parent instanceof Applet) { - // No suitable swing component found - break; + result = parentBounds.intersection(popupArea) + .contains(x, y, popupWidth, popupHeight); + } else { + result = parentBounds + .contains(x, y, popupWidth, popupHeight); } + } else if (parent instanceof JApplet) { + Point p = parent.getLocationOnScreen(); + parentBounds.x = p.x; + parentBounds.y = p.y; + result = parentBounds + .contains(x, y, popupWidth, popupHeight); } } - return false; + return result; } Rectangle getContainerPopupArea(GraphicsConfiguration gc) { diff --git a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java index ed769a92937..1106e339685 100644 --- a/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java +++ b/jdk/src/share/classes/javax/swing/ScrollPaneLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java index fb8521b16f4..e8771dd11b6 100644 --- a/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java +++ b/jdk/src/share/classes/javax/swing/SpinnerNumberModel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/src/share/classes/javax/swing/TablePrintable.java b/jdk/src/share/classes/javax/swing/TablePrintable.java index 864b550b3c8..c5831ea051a 100644 --- a/jdk/src/share/classes/javax/swing/TablePrintable.java +++ b/jdk/src/share/classes/javax/swing/TablePrintable.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java index a3773ab09e1..855a357575e 100644 --- a/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java +++ b/jdk/src/share/classes/javax/swing/filechooser/FileSystemView.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/javax/swing/plaf/FileChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/FileChooserUI.java index 78064e08efc..6910a8b671a 100644 --- a/jdk/src/share/classes/javax/swing/plaf/FileChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/FileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -25,7 +25,7 @@ package javax.swing.plaf; -import javax.swing.JFileChooser; +import javax.swing.*; import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileView; import java.io.File; @@ -46,4 +46,15 @@ public abstract class FileChooserUI extends ComponentUI public abstract void rescanCurrentDirectory(JFileChooser fc); public abstract void ensureFileIsVisible(JFileChooser fc, File f); + + /** + * Returns default button for current LookAndFeel. + * JFileChooser will use this button as default button + * for dialog windows. + * + * @since 1.7 + */ + public JButton getDefaultButton(JFileChooser fc) { + return null; + } } diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java index d6ad0643c1e..6802c9d81bf 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java index 06b4dc5b6e4..52877839218 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -196,7 +196,7 @@ public class BasicDirectoryModel extends AbstractListModel implements PropertyCh } protected void sort(Vector v){ - ShellFolder.sortFiles(v); + ShellFolder.sort(v); } // Obsolete - not used diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java index 5a9daae328d..467db5a1bb7 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -384,6 +384,10 @@ public class BasicFileChooserUI extends FileChooserUI { return null; } + public JButton getDefaultButton(JFileChooser fc) { + return getApproveButton(fc); + } + public String getApproveButtonToolTipText(JFileChooser fc) { String tooltipText = fc.getApproveButtonToolTipText(); if(tooltipText != null) { diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java index df078dbf606..e0d139f48ef 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 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 c56a1b49d39..85f56a52cd9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java index 5ad6c2b92df..4a226a282e9 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 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 c1aada74441..1d16e1d8893 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -25,25 +25,12 @@ package javax.swing.plaf.basic; -import java.awt.Component; -import java.awt.Container; -import java.awt.Adjustable; import java.awt.event.*; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.Point; -import java.awt.Insets; -import java.awt.Color; -import java.awt.IllegalComponentStateException; -import java.awt.Polygon; +import java.awt.*; import java.beans.*; import java.util.Dictionary; import java.util.Enumeration; -import javax.swing.border.AbstractBorder; - import javax.swing.*; import javax.swing.event.*; import javax.swing.plaf.*; @@ -409,7 +396,7 @@ public class BasicSliderUI extends SliderUI{ Enumeration elements = dictionary.elements(); int baseline = -1; while (elements.hasMoreElements()) { - Component label = (Component)elements.nextElement(); + JComponent label = (JComponent) elements.nextElement(); Dimension pref = label.getPreferredSize(); int labelBaseline = label.getBaseline(pref.width, pref.height); @@ -634,7 +621,7 @@ public class BasicSliderUI extends SliderUI{ protected void calculateTrackRect() { - int centerSpacing = 0; // used to center sliders added using BorderLayout.CENTER (bug 4275631) + int centerSpacing; // used to center sliders added using BorderLayout.CENTER (bug 4275631) if ( slider.getOrientation() == JSlider.HORIZONTAL ) { centerSpacing = thumbRect.height; if ( slider.getPaintTicks() ) centerSpacing += getTickLength(); @@ -764,7 +751,7 @@ public class BasicSliderUI extends SliderUI{ if ( dictionary != null ) { Enumeration keys = dictionary.keys(); while ( keys.hasMoreElements() ) { - Component label = (Component)dictionary.get( keys.nextElement() ); + JComponent label = (JComponent) dictionary.get(keys.nextElement()); widest = Math.max( label.getPreferredSize().width, widest ); } } @@ -777,7 +764,7 @@ public class BasicSliderUI extends SliderUI{ if ( dictionary != null ) { Enumeration keys = dictionary.keys(); while ( keys.hasMoreElements() ) { - Component label = (Component)dictionary.get( keys.nextElement() ); + JComponent label = (JComponent) dictionary.get(keys.nextElement()); tallest = Math.max( label.getPreferredSize().height, tallest ); } } @@ -1001,22 +988,14 @@ public class BasicSliderUI extends SliderUI{ public void paintTicks(Graphics g) { Rectangle tickBounds = tickRect; - int i; - int maj, min, max; - int w = tickBounds.width; - int h = tickBounds.height; - int centerEffect, tickHeight; g.setColor(DefaultLookup.getColor(slider, this, "Slider.tickColor", Color.black)); - maj = slider.getMajorTickSpacing(); - min = slider.getMinorTickSpacing(); - if ( slider.getOrientation() == JSlider.HORIZONTAL ) { g.translate( 0, tickBounds.y); int value = slider.getMinimum(); - int xPos = 0; + int xPos; if ( slider.getMinorTickSpacing() > 0 ) { while ( value <= slider.getMaximum() ) { @@ -1042,7 +1021,7 @@ public class BasicSliderUI extends SliderUI{ g.translate(tickBounds.x, 0); int value = slider.getMinimum(); - int yPos = 0; + int yPos; if ( slider.getMinorTickSpacing() > 0 ) { int offset = 0; @@ -1111,10 +1090,19 @@ public class BasicSliderUI extends SliderUI{ Integer key = (Integer)keys.nextElement(); int value = key.intValue(); if (value >= minValue && value <= maxValue) { - Component label = (Component)dictionary.get( key ); - if (label instanceof JComponent) { - ((JComponent)label).setEnabled(enabled); + JComponent label = (JComponent) dictionary.get(key); + label.setEnabled(enabled); + + if (label instanceof JLabel) { + Icon icon = label.isEnabled() ? ((JLabel) label).getIcon() : ((JLabel) label).getDisabledIcon(); + + if (icon instanceof ImageIcon) { + // Register Slider as an image observer. It allows to catch notifications about + // image changes (e.g. gif animation) + Toolkit.getDefaultToolkit().checkImage(((ImageIcon) icon).getImage(), -1, -1, slider); + } } + if ( slider.getOrientation() == JSlider.HORIZONTAL ) { g.translate( 0, labelBounds.y ); paintHorizontalLabel( g, value, label ); @@ -1364,7 +1352,7 @@ public class BasicSliderUI extends SliderUI{ int min = slider.getMinimum(); int max = slider.getMaximum(); double valueRange = (double)max - (double)min; - double pixelsPerValue = (double)trackHeight / (double)valueRange; + double pixelsPerValue = (double)trackHeight / valueRange; int trackBottom = trackY + (trackHeight - 1); int yPosition; @@ -1715,7 +1703,7 @@ public class BasicSliderUI extends SliderUI{ * of the thumb relative to the origin of the track. */ public void mouseDragged(MouseEvent e) { - int thumbMiddle = 0; + int thumbMiddle; if (!slider.isEnabled()) { return; @@ -1841,7 +1829,7 @@ public class BasicSliderUI extends SliderUI{ public void componentResized(ComponentEvent e) { getHandler().componentResized(e); } - }; + } /** * Focus-change listener. @@ -1903,7 +1891,7 @@ public class BasicSliderUI extends SliderUI{ return b; } - }; + } /** diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java index 2d0873cfcd2..29919d50475 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 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 e039d1b425b..061dd31b4ed 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java @@ -1,5 +1,5 @@ /* - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java index 72c2230d1e2..c7da086d466 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java index d1f7c05935d..f0084d9f162 100644 --- a/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java +++ b/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -853,9 +853,7 @@ public class MetalLookAndFeel extends BasicLookAndFeel "ESCAPE", "cancelSelection", "F2", "editFileName", "F5", "refresh", - "BACK_SPACE", "Go Up", - "ENTER", "approveSelection", - "ctrl ENTER", "approveSelection" + "BACK_SPACE", "Go Up" }), diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java index dd703d0b517..33adfc53170 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 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 e41fead8add..b793f2b380f 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 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 0cf5ed22648..58fb5370977 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 @@ -25,26 +25,17 @@ package javax.swing.plaf.synth; -import java.awt.Component; -import java.awt.Container; -import java.awt.Adjustable; import java.awt.event.*; import java.awt.Graphics; import java.awt.Dimension; -import java.awt.Font; import java.awt.FontMetrics; import java.awt.Rectangle; import java.awt.Point; import java.awt.Insets; -import java.awt.Color; -import java.awt.IllegalComponentStateException; -import java.awt.Polygon; import java.beans.*; import java.util.Dictionary; import java.util.Enumeration; -import javax.swing.border.AbstractBorder; import javax.swing.*; -import javax.swing.event.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.BasicSliderUI; import sun.swing.plaf.synth.SynthUI; @@ -203,8 +194,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, centerY += valueHeight + 2; centerY += trackHeight + trackInsets.top + trackInsets.bottom; centerY += tickHeight + 2; - Component label = (Component)slider.getLabelTable(). - elements().nextElement(); + JComponent label = (JComponent) slider.getLabelTable().elements().nextElement(); Dimension pref = label.getPreferredSize(); return centerY + label.getBaseline(pref.width, pref.height); } @@ -226,8 +216,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, int trackHeight = contentHeight - valueHeight; int yPosition = yPositionForValue(value.intValue(), trackY, trackHeight); - Component label = (Component)slider.getLabelTable(). - get(value); + JComponent label = (JComponent) slider.getLabelTable().get(value); Dimension pref = label.getPreferredSize(); return yPosition - pref.height / 2 + label.getBaseline(pref.width, pref.height); @@ -434,16 +423,14 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, /** * Calculates the pad for the label at the specified index. * - * @param index index of the label to calculate pad for. + * @param i index of the label to calculate pad for. * @return padding required to keep label visible. */ private int getPadForLabel(int i) { - Dictionary dictionary = slider.getLabelTable(); int pad = 0; - Object o = dictionary.get(i); - if (o != null) { - Component c = (Component)o; + JComponent c = (JComponent) slider.getLabelTable().get(i); + if (c != null) { int centerX = xPositionForValue(i); int cHalfWidth = c.getPreferredSize().width / 2; if (centerX - cHalfWidth < insetCache.left) { @@ -500,8 +487,6 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } } - private static Rectangle unionRect = new Rectangle(); - public void setThumbLocation(int x, int y) { super.setThumbLocation(x, y); // Value rect is tied to the thumb location. We need to repaint when @@ -544,7 +529,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, trackBorder; int trackLength = trackBottom - trackTop; double valueRange = (double)max - (double)min; - double pixelsPerValue = (double)trackLength / (double)valueRange; + double pixelsPerValue = (double)trackLength / valueRange; int yPosition; if (!drawInverted()) { @@ -802,8 +787,7 @@ class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, } public void mouseDragged(MouseEvent e) { - SynthScrollBarUI ui; - int thumbMiddle = 0; + int thumbMiddle; if (!slider.isEnabled()) { return; 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 ddbc7ae7e69..00f5d955f97 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synth.dtd b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synth.dtd index 9188d43e2d4..0d5dee69720 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synth.dtd +++ b/jdk/src/share/classes/javax/swing/plaf/synth/doc-files/synth.dtd @@ -2,7 +2,7 @@ -#if !defined(__int3264) -#define GetWindowLongPtr GetWindowLong -#define SetWindowLongPtr SetWindowLong -#define GWLP_USERDATA GWL_USERDATA -#define GWLP_WNDPROC GWL_WNDPROC -typedef __int32 LONG_PTR; -typedef unsigned __int32 ULONG_PTR; -#endif // __int3264 -// - #include LPCTSTR szAwtComponentClassName = TEXT("SunAwtComponent"); @@ -165,6 +144,11 @@ struct SetRectangularShapeStruct { jint x1, x2, y1, y2; jobject region; }; +// Struct for _GetInsets function +struct GetInsetsStruct { + jobject window; + RECT *insets; +}; /************************************************************************/ ////////////////////////////////////////////////////////////////////////// @@ -203,9 +187,7 @@ LANGID AwtComponent::m_idLang = LOWORD(::GetKeyboardLayout(0)); UINT AwtComponent::m_CodePage = AwtComponent::LangToCodePage(m_idLang); -BOOL AwtComponent::m_isWin95 = IS_WIN95; -BOOL AwtComponent::m_isWin2000 = IS_WIN2000; -BOOL AwtComponent::m_isWinNT = IS_NT; +jint *AwtComponent::masks; static BOOL bLeftShiftIsDown = false; static BOOL bRightShiftIsDown = false; @@ -414,7 +396,10 @@ BOOL AwtComponent::IsFocusable() { jobject peer = GetPeer(env); jobject target = env->GetObjectField(peer, AwtObject::targetID); BOOL res = env->GetBooleanField(target, focusableID); - res &= GetContainer()->IsFocusableWindow(); + AwtWindow *pCont = GetContainer(); + if (pCont) { + res &= pCont->IsFocusableWindow(); + } env->DeleteLocalRef(target); return res; } @@ -537,7 +522,7 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title, jobject createError = NULL; if (dw == ERROR_OUTOFMEMORY) { - jstring errorMsg = env->NewStringUTF("too many window handles"); + jstring errorMsg = JNU_NewStringPlatform(env, L"too many window handles"); createError = JNU_NewObjectByName(env, "java/lang/OutOfMemoryError", "(Ljava/lang/String;)V", errorMsg); @@ -1194,6 +1179,9 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) { WIN_MSG(WM_MBUTTONDOWN) WIN_MSG(WM_MBUTTONUP) WIN_MSG(WM_MBUTTONDBLCLK) + WIN_MSG(WM_XBUTTONDBLCLK) + WIN_MSG(WM_XBUTTONDOWN) + WIN_MSG(WM_XBUTTONUP) WIN_MSG(WM_MOUSEWHEEL) WIN_MSG(WM_PARENTNOTIFY) WIN_MSG(WM_ENTERMENULOOP) @@ -1340,17 +1328,9 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) return (LRESULT)TRUE; } - UINT switchMessage; - if (IS_WIN95 && !IS_WIN98 && message == Wheel95GetMsg()) { - // Wheel message is generated dynamically on 95. A quick swap and - // we're good to go. - DTRACE_PRINTLN1("got wheel event on 95. msg is %i\n", message); - switchMessage = WM_MOUSEWHEEL; - } - else { - switchMessage = message; - } + DWORD curPos = 0; + UINT switchMessage = message; switch (switchMessage) { case WM_AWT_GETDC: { @@ -1637,67 +1617,87 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) case WM_MBUTTONDOWN: case WM_MBUTTONDBLCLK: case WM_MBUTTONUP: + case WM_XBUTTONDBLCLK: + case WM_XBUTTONDOWN: + case WM_XBUTTONUP: case WM_MOUSEMOVE: case WM_MOUSEWHEEL: case WM_AWT_MOUSEENTER: case WM_AWT_MOUSEEXIT: - { - DWORD curPos = ::GetMessagePos(); + curPos = ::GetMessagePos(); POINT myPos; myPos.x = GET_X_LPARAM(curPos); myPos.y = GET_Y_LPARAM(curPos); ::ScreenToClient(GetHWnd(), &myPos); switch(switchMessage) { case WM_AWT_MOUSEENTER: - mr = WmMouseEnter(static_cast(wParam), myPos.x, myPos.y); break; + mr = WmMouseEnter(static_cast(wParam), myPos.x, myPos.y); + break; case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: - mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, - LEFT_BUTTON); break; - case WM_LBUTTONUP: - mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, - LEFT_BUTTON); break; - case WM_MOUSEMOVE: - mr = WmMouseMove(static_cast(wParam), myPos.x, myPos.y); break; - case WM_MBUTTONDOWN: - case WM_MBUTTONDBLCLK: - mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, - MIDDLE_BUTTON); break; - case WM_RBUTTONDOWN: - case WM_RBUTTONDBLCLK: - mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, - RIGHT_BUTTON); break; - case WM_RBUTTONUP: - mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, - RIGHT_BUTTON); - break; - case WM_MBUTTONUP: - mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, - MIDDLE_BUTTON); - break; - case WM_AWT_MOUSEEXIT: - mr = WmMouseExit(static_cast(wParam), myPos.x, myPos.y); - break; - case WM_MOUSEWHEEL: - if (IS_WIN95 && !IS_WIN98) { - // On 95, the wParam doesn't contain the keystate flags, just - // the wheel rotation. The keystates are fetched in WmMouseWheel - // using GetJavaModifiers(). - mr = WmMouseWheel(0, - GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), - (int)wParam); - return FALSE; - } - else { + mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, + LEFT_BUTTON); + break; + case WM_LBUTTONUP: + mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, + LEFT_BUTTON); + break; + case WM_MOUSEMOVE: + mr = WmMouseMove(static_cast(wParam), myPos.x, myPos.y); + break; + case WM_MBUTTONDOWN: + case WM_MBUTTONDBLCLK: + mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, + MIDDLE_BUTTON); + break; + case WM_XBUTTONDOWN: + case WM_XBUTTONDBLCLK: + if (AwtToolkit::GetInstance().areExtraMouseButtonsEnabled()) { + if (HIWORD(wParam) == 1) { + mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, + X1_BUTTON); + } + if (HIWORD(wParam) == 2) { + mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, + X2_BUTTON); + } + } + break; + case WM_XBUTTONUP: + if (AwtToolkit::GetInstance().areExtraMouseButtonsEnabled()) { + if (HIWORD(wParam) == 1) { + mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, + X1_BUTTON); + } + if (HIWORD(wParam) == 2) { + mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, + X2_BUTTON); + } + } + break; + case WM_RBUTTONDOWN: + case WM_RBUTTONDBLCLK: + mr = WmMouseDown(static_cast(wParam), myPos.x, myPos.y, + RIGHT_BUTTON); + break; + case WM_RBUTTONUP: + mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, + RIGHT_BUTTON); + break; + case WM_MBUTTONUP: + mr = WmMouseUp(static_cast(wParam), myPos.x, myPos.y, + MIDDLE_BUTTON); + break; + case WM_AWT_MOUSEEXIT: + mr = WmMouseExit(static_cast(wParam), myPos.x, myPos.y); + break; + case WM_MOUSEWHEEL: mr = WmMouseWheel(GET_KEYSTATE_WPARAM(wParam), GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), GET_WHEEL_DELTA_WPARAM(wParam)); + break; } break; - } - } - break; - case WM_SETCURSOR: mr = mrDoDefault; if (LOWORD(lParam) == HTCLIENT) { @@ -1936,25 +1936,6 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) *((SIZE *)lParam)); mr = mrConsume; break; - case WM_AWT_DD_CREATE_SURFACE: - { - return (LRESULT)WmDDCreateSurface((Win32SDOps*)wParam); - } - case WM_AWT_DD_ENTER_FULLSCREEN: - { - mr = WmDDEnterFullScreen((HMONITOR)wParam); - break; - } - case WM_AWT_DD_EXIT_FULLSCREEN: - { - mr = WmDDExitFullScreen((HMONITOR)wParam); - break; - } - case WM_AWT_DD_SET_DISPLAY_MODE: - { - mr = WmDDSetDisplayMode((HMONITOR)wParam, (DDrawDisplayMode*)lParam); - break; - } case WM_UNDOCUMENTED_CLICKMENUBAR: { if (::IsWindow(AwtWindow::GetModalBlocker(GetHWnd()))) { @@ -2223,7 +2204,8 @@ AwtComponent::AwtSetFocus() } } - AwtFrame *owner = GetContainer()->GetOwningFrameOrDialog(); + AwtWindow *pCont = GetContainer(); + AwtFrame *owner = pCont ? pCont->GetOwningFrameOrDialog() : NULL; if (owner == NULL) { ::SetFocus(hwnd); @@ -2600,8 +2582,12 @@ MsgRouting AwtComponent::WmMouseMove(UINT flags, int x, int y) lastComp = this; lastX = x; lastY = y; - - if ( (flags & ALL_MK_BUTTONS) != 0 ) { + BOOL extraButtonsEnabled = AwtToolkit::GetInstance().areExtraMouseButtonsEnabled(); + if (((flags & (ALL_MK_BUTTONS)) != 0) || + (extraButtonsEnabled && (flags & (X_BUTTONS)) != 0)) +// if (( extraButtonsEnabled && ( (flags & (ALL_MK_BUTTONS | X_BUTTONS)) != 0 )) || +// ( !extraButtonsEnabled && (((flags & (ALL_MK_BUTTONS)) != 0 )) && ((flags & (X_BUTTONS)) == 0) )) + { // 6404008 : if Dragged event fired we shouldn't fire // Clicked event: m_firstDragSent set to TRUE. // This is a partial backout of 5039416 fix. @@ -2660,21 +2646,10 @@ MsgRouting AwtComponent::WmMouseWheel(UINT flags, int x, int y, jdouble preciseWheelRotation = (jdouble) wheelRotation / (-1 * WHEEL_DELTA); MSG msg; - - if (IS_WIN95 && !IS_WIN98) { - // 95 doesn't understand the SPI_GETWHEELSCROLLLINES - get the user - // preference by other means - DTRACE_PRINTLN("WmMouseWheel: using 95 branch"); - platformLines = Wheel95GetScrLines(); - result = true; - InitMessage(&msg, lastMessage, wheelRotation, MAKELPARAM(x, y)); - } - else { - result = ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, - &platformLines, 0); - InitMessage(&msg, lastMessage, MAKEWPARAM(flags, wheelRotation), - MAKELPARAM(x, y)); - } + result = ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, + &platformLines, 0); + InitMessage(&msg, lastMessage, MAKEWPARAM(flags, wheelRotation), + MAKELPARAM(x, y)); if (result) { if (platformLines == WHEEL_PAGESCROLL) { @@ -2754,156 +2729,21 @@ jint AwtComponent::GetShiftKeyLocation(UINT vkey, UINT flags) "AwtComponent::GetShiftKeyLocation vkey = %d = 0x%x scan = %d", vkey, vkey, keyScanCode); - if (m_isWinNT) { - leftShiftScancode = ::MapVirtualKey(VK_LSHIFT, 0); - rightShiftScancode = ::MapVirtualKey(VK_RSHIFT, 0); + leftShiftScancode = ::MapVirtualKey(VK_LSHIFT, 0); + rightShiftScancode = ::MapVirtualKey(VK_RSHIFT, 0); - if (keyScanCode == leftShiftScancode) { - return java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } - if (keyScanCode == rightShiftScancode) { - return java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } - - DASSERT(false); - // Note: the above should not fail on NT (or 2000), - // but just in case it does, try the more complicated method - // we use for Win9x below. + if (keyScanCode == leftShiftScancode) { + return java_awt_event_KeyEvent_KEY_LOCATION_LEFT; + } + if (keyScanCode == rightShiftScancode) { + return java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; } - // "Transition" bit = 0 if keyPressed, 1 if keyReleased - BOOL released = ((1<<15) & flags); + DASSERT(false); + // Note: the above should not fail on NT (or 2000) - DTRACE_PRINTLN2( - "AwtComponent::GetShiftKeyLocation bLeftShiftIsDown = %d bRightShiftIsDown == %d", - bLeftShiftIsDown, bRightShiftIsDown); - DTRACE_PRINTLN2( - "AwtComponent::GetShiftKeyLocation lastShiftKeyPressed = %d released = %d", - lastShiftKeyPressed, released); - - jint keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN; - - // It is possible for somebody to hold down one or both - // Shift keys, causing repeat key events. We need to - // handle all the cases. - // - // Just a side-note: if two or more keys are being held down, - // and then one key is released, whether more key presses are - // generated for the keys that are still held down depends on - // which keys they are, and whether you released the right or - // the left shift/ctrl/etc. key first. This also differs - // between Win9x and NT. Just plain screwy. - // - // Note: on my PC, the repeat count is always 1. Yup, we need - // 16 bits to handle that, all right. - - // Handle the case where only one of the Shift keys - // was down before this event took place - if (bLeftShiftIsDown && !bRightShiftIsDown) { - if (released) { - // This is a left Shift release - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } else { - // This is a right Shift press - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } - } else if (!bLeftShiftIsDown && bRightShiftIsDown) { - if (released) { - // This is a right Shift release - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } else { - // This is a left Shift press - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } - } - - // Handle the case where neither of the Shift keys - // were down before this event took place - if (!bLeftShiftIsDown && !bRightShiftIsDown) { - DASSERT(!released); - if (HIBYTE(::GetKeyState(VK_LSHIFT)) != 0) { - // This is a left Shift press - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } else if (HIBYTE(::GetKeyState(VK_RSHIFT)) != 0) { - // This is a right Shift press - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } else { - DASSERT(false); - } - } - - // Handle the case where both Shift keys were down before - // this event took place - if (bLeftShiftIsDown && bRightShiftIsDown) { - // If this is a key release event, we can just check to see - // what the keyboard state is after the event - if (released) { - if (HIBYTE(::GetKeyState(VK_RSHIFT)) == 0) { - // This is a right Shift release - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } else if (HIBYTE(::GetKeyState(VK_LSHIFT)) == 0) { - // This is a left Shift release - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } else { - DASSERT(false); - } - } else { - // If this is a key press event, and both Shift keys were - // already down, this is going to be a repeat of the last - // Shift press - if (lastShiftKeyPressed == VK_LSHIFT) { - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } else if (lastShiftKeyPressed == VK_RSHIFT) { - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } else { - DASSERT(false); - } - } - } - - if (keyLocation == java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN) { - // Nothing we tried above worked for some reason. Sigh. - // Make a last-ditch effort to guess what happened: - // guess that the Shift scancodes are usually the same - // from system to system, even though this isn't guaranteed. - DTRACE_PRINTLN("Last-ditch effort at guessing Shift keyLocation"); - - // Tested on a couple of Windows keyboards: these are standard values - leftShiftScancode = 42; - rightShiftScancode = 54; - - if (keyScanCode == leftShiftScancode) { - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_LEFT; - } else if (keyScanCode == rightShiftScancode) { - keyLocation = java_awt_event_KeyEvent_KEY_LOCATION_RIGHT; - } - } - - // Set the Shift flags with the new key state. - bLeftShiftIsDown = (HIBYTE(::GetKeyState(VK_LSHIFT)) != 0); - bRightShiftIsDown = (HIBYTE(::GetKeyState(VK_RSHIFT)) != 0); - - // Update lastShiftKeyPressed - if (released) { - // At most one shift key is down now, so just check which one - if (bLeftShiftIsDown) { - lastShiftKeyPressed = VK_LSHIFT; - DASSERT(!bRightShiftIsDown); - } else if (bRightShiftIsDown) { - lastShiftKeyPressed = VK_RSHIFT; - } else { - lastShiftKeyPressed = 0; - } - } else { - // It was a press, so at least one shift key is down now - if (keyLocation == java_awt_event_KeyEvent_KEY_LOCATION_LEFT) { - lastShiftKeyPressed = VK_LSHIFT; - } else if (keyLocation == java_awt_event_KeyEvent_KEY_LOCATION_RIGHT) { - lastShiftKeyPressed = VK_RSHIFT; - } - } - - return keyLocation; + // default value + return java_awt_event_KeyEvent_KEY_LOCATION_LEFT; } /* Returns Java extended InputEvent modifieres. @@ -2925,7 +2765,7 @@ AwtComponent::GetJavaModifiers() modifiers |= java_awt_event_InputEvent_ALT_DOWN_MASK; } if (HIBYTE(::GetKeyState(VK_MBUTTON)) != 0) { - modifiers |= java_awt_event_InputEvent_BUTTON2_DOWN_MASK; + modifiers |= java_awt_event_InputEvent_BUTTON2_DOWN_MASK; } if (HIBYTE(::GetKeyState(VK_RBUTTON)) != 0) { modifiers |= java_awt_event_InputEvent_BUTTON3_DOWN_MASK; @@ -2933,6 +2773,13 @@ AwtComponent::GetJavaModifiers() if (HIBYTE(::GetKeyState(VK_LBUTTON)) != 0) { modifiers |= java_awt_event_InputEvent_BUTTON1_DOWN_MASK; } + + if (HIBYTE(::GetKeyState(VK_XBUTTON1)) != 0) { + modifiers |= masks[3]; + } + if (HIBYTE(::GetKeyState(VK_XBUTTON2)) != 0) { + modifiers |= masks[4]; + } return modifiers; } @@ -2947,6 +2794,11 @@ AwtComponent::GetButton(int mouseButton) return java_awt_event_MouseEvent_BUTTON2; case RIGHT_BUTTON: return java_awt_event_MouseEvent_BUTTON3; + case X1_BUTTON: //16 : + //just assign 4 and 5 numbers because MouseEvent class doesn't contain const identifier for them now + return 4; + case X2_BUTTON: //32 + return 5; } return java_awt_event_MouseEvent_NOBUTTON; } @@ -2961,6 +2813,10 @@ AwtComponent::GetButtonMK(int mouseButton) return MK_MBUTTON; case RIGHT_BUTTON: return MK_RBUTTON; + case X1_BUTTON: + return MK_XBUTTON1; + case X2_BUTTON: + return MK_XBUTTON2; } return 0; } @@ -2978,6 +2834,14 @@ AwtComponent::GetButtonMK(int mouseButton) #define VK_NONCONVERT 0x1D #endif +#ifndef VK_XBUTTON1 +#define VK_XBUTTON1 0x05 +#endif + +#ifndef VK_XBUTTON2 +#define VK_XBUTTON2 0x06 +#endif + typedef struct { UINT javaKey; UINT windowsKey; @@ -3797,22 +3661,6 @@ MsgRouting AwtComponent::WmChar(UINT character, UINT repCnt, UINT flags, // via WM_AWT_FORWARD_BYTE, but the Edit classes don't seem to // like that. - // Begin pollution - if (!m_isWinNT && IsDBCSLeadByteEx(GetCodePage(), BYTE(character))) { - if (GetDBCSEditHandle() != NULL) { - return mrDoDefault; - } else { - // Kludge: Some Chinese IMEs, e.g. QuanPin, sends two WM_CHAR - // messages for some punctuations (e.g. full stop) without sending - // WM_IME_CHAR message beforehand. - if (m_PendingLeadByte == 0) { - m_PendingLeadByte = character; - return mrConsume; - } - } - } - // End pollution - // We will simply create Java events here. UINT message = system ? WM_SYSCHAR : WM_CHAR; @@ -3872,43 +3720,8 @@ MsgRouting AwtComponent::WmChar(UINT character, UINT repCnt, UINT flags, MsgRouting AwtComponent::WmForwardChar(WCHAR character, LPARAM lParam, BOOL synthetic) { - if (m_isWinNT) { - // just post WM_CHAR with unicode key value - DefWindowProc(WM_CHAR, (WPARAM)character, lParam); - return mrConsume; - } - - // This message is sent from the Java key event handler. - CHAR mbChar[2] = {'\0', '\0'}; - - int cBytes = ::WideCharToMultiByte(GetCodePage(), 0, &character, 1, mbChar, 2, NULL, NULL); - if (cBytes!=1 && cBytes!=2) return mrConsume; - - HWND hDBCSEditHandle = GetDBCSEditHandle(); - - if (hDBCSEditHandle != NULL && cBytes==2) - { - // The first WM_CHAR message will get handled by the WmChar, but - // the second WM_CHAR message will get picked off by the Edit class. - // WmChar will never see it. - // If an Edit class gets a lead byte, it immediately calls PeekMessage - // and pulls the trail byte out of the message queue. - ::PostMessage(hDBCSEditHandle, WM_CHAR, mbChar[0] & 0x00ff, lParam); - ::PostMessage(hDBCSEditHandle, WM_CHAR, mbChar[1] & 0x00ff, lParam); - } - else - { - MSG* pMsg; - pMsg = CreateMessage(WM_CHAR, mbChar[0] & 0x00ff, lParam); - ::PostMessage(GetHWnd(), WM_AWT_FORWARD_BYTE, (WPARAM)synthetic, - (LPARAM)pMsg); - if (mbChar[1]) - { - pMsg = CreateMessage(WM_CHAR, mbChar[1] & 0x00ff, lParam); - ::PostMessage(GetHWnd(), WM_AWT_FORWARD_BYTE, (WPARAM)synthetic, - (LPARAM)pMsg); - } - } + // just post WM_CHAR with unicode key value + DefWindowProc(WM_CHAR, (WPARAM)character, lParam); return mrConsume; } @@ -3940,7 +3753,7 @@ void AwtComponent::OpenCandidateWindow(int x, int y) SetCandidateWindow(iCandType, x-rc.left, y-rc.top); } if (m_bitsCandType != 0) { - DefWindowProc(WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType); + ::DefWindowProc(GetHWnd(), WM_IME_NOTIFY, IMN_OPENCANDIDATE, m_bitsCandType); } } @@ -4554,7 +4367,7 @@ MsgRouting AwtComponent::WmPrint(HDC hDC, LPARAM flags) // Special case for components with a sunken border. Windows does not // print the border correctly on PCL printers, so we have to do it ourselves. - if (IS_WIN4X && (GetStyleEx() & WS_EX_CLIENTEDGE)) { + if (GetStyleEx() & WS_EX_CLIENTEDGE) { RECT r; VERIFY(::GetWindowRect(GetHWnd(), &r)); VERIFY(::OffsetRect(&r, -r.left, -r.top)); @@ -4570,7 +4383,7 @@ MsgRouting AwtComponent::WmPrint(HDC hDC, LPARAM flags) * We will first print the non-client area with the original offset, * then the client area with a corrected offset. */ - if (IS_WIN4X && (GetStyleEx() & WS_EX_CLIENTEDGE)) { + if (GetStyleEx() & WS_EX_CLIENTEDGE) { int nEdgeWidth = ::GetSystemMetrics(SM_CXEDGE); int nEdgeHeight = ::GetSystemMetrics(SM_CYEDGE); @@ -4806,31 +4619,6 @@ jintArray AwtComponent::CreatePrintedPixels(SIZE &loc, SIZE &size) { return pixelArray; } -BOOL AwtComponent::WmDDCreateSurface(Win32SDOps* wsdo) { - return DDCreateSurface(wsdo); -} - -// This method is fully implemented in AwtWindow -MsgRouting AwtComponent::WmDDEnterFullScreen(HMONITOR monitor) { - DASSERT(FALSE); - return mrDoDefault; -} - -// This method is fully implemented in AwtWindow -MsgRouting AwtComponent::WmDDExitFullScreen(HMONITOR monitor) { - DASSERT(FALSE); - return mrDoDefault; -} - -MsgRouting AwtComponent::WmDDSetDisplayMode(HMONITOR monitor, - DDrawDisplayMode* pDisplayMode) { - - DDSetDisplayMode(monitor, *pDisplayMode); - - delete pDisplayMode; - return mrDoDefault; -} - void * AwtComponent::GetNativeFocusOwner() { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); @@ -5341,7 +5129,12 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) if (modifiers & java_awt_event_InputEvent_BUTTON3_DOWN_MASK) { wLow |= MK_MBUTTON; } - + if (modifiers & X1_BUTTON) { + wLow |= GetButtonMK(X1_BUTTON); + } + if (modifiers & X2_BUTTON) { + wLow |= GetButtonMK(X2_BUTTON); + } wheelAmt = (jint)JNU_CallMethodByName(env, NULL, @@ -5355,18 +5148,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) // convert Java wheel amount value to Win32 wheelAmt *= -1 * WHEEL_DELTA; - if (IS_WIN95 && !IS_WIN98) { - // 95 doesn't understand WM_MOUSEWHEEL, so plug in value of - // mouse wheel event on 95 - DTRACE_PRINTLN("awt_C::synthmm - 95 case"); - DASSERT(Wheel95GetMsg() != NULL); - message = Wheel95GetMsg(); - wParam = wheelAmt; - } - else { - message = WM_MOUSEWHEEL; - wParam = MAKEWPARAM(wLow, wheelAmt); - } + message = WM_MOUSEWHEEL; + wParam = MAKEWPARAM(wLow, wheelAmt); break; default: @@ -5377,7 +5160,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) MSG* msg = CreateMessage(message, wParam, MAKELPARAM(x, y), x, y); // If the window is not focusable but if this is a focusing // message we should skip it then and perform our own actions. - if (((AwtWindow*)GetContainer())->IsFocusableWindow() || !ActMouseMessage(msg)) { + AwtWindow *pCont = GetContainer(); + if ((pCont && pCont->IsFocusableWindow()) || !ActMouseMessage(msg)) { PostHandleEventMessage(msg, TRUE); } else { delete msg; @@ -5480,45 +5264,6 @@ void AwtComponent::Enable(BOOL bEnable) VerifyState(); } -/* Initialization of MouseWheel support on Windows 95 */ -void AwtComponent::Wheel95Init() { - DASSERT(IS_WIN95 && !IS_WIN98); - - HWND mwHWND = NULL; - UINT wheelMSG = WM_NULL; - UINT suppMSG = WM_NULL; - UINT linesMSG = WM_NULL; - BOOL wheelActive; - INT lines; - - mwHWND = HwndMSWheel(&wheelMSG, &suppMSG, &linesMSG, &wheelActive, &lines); - if (mwHWND != WM_NULL) { - sm_95WheelMessage = wheelMSG; - sm_95WheelSupport = suppMSG; - } -} - -/* Win95 only - * Return the user's preferred number of lines of test to scroll when the - * mouse wheel is rotated. - */ -UINT AwtComponent::Wheel95GetScrLines() { - DASSERT(IS_WIN95 && !IS_WIN98); - DASSERT(sm_95WheelSupport != NULL); - - HWND mwHWND = NULL; - UINT linesMSG = WM_NULL; - INT numLines = 3; - - linesMSG = RegisterWindowMessage(MSH_SCROLL_LINES); - mwHWND = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE); - - if (mwHWND && linesMSG) { - numLines = (INT)::SendMessage(mwHWND, linesMSG, 0, 0); - } - return numLines; -} - /* * associate an AwtDropTarget with this AwtComponent */ @@ -5900,7 +5645,10 @@ void AwtComponent::_NativeHandleEvent(void *param) AwtComponent* p = (AwtComponent*)pData; // If the window is not focusable but if this is a focusing // message we should skip it then and perform our own actions. - if (((AwtWindow*)p->GetContainer())->IsFocusableWindow() || !p->ActMouseMessage(&msg)) { + AwtWindow *pCont = (AwtWindow*)(p->GetContainer()); + if ((pCont && pCont->IsFocusableWindow()) || + !p->ActMouseMessage(&msg)) + { // Create copy for local msg MSG* pCopiedMsg = new MSG; memmove(pCopiedMsg, &msg, sizeof(MSG)); @@ -6015,7 +5763,7 @@ void AwtComponent::_SetFont(void *param) { AwtFont *awtFont = (AwtFont *)env->GetLongField(font, AwtFont::pDataID); if (awtFont == NULL) { - /*arguments of AwtFont::Create are changed for multifont component */ + /*arguments of AwtFont::Create are changed for multifont component */ awtFont = AwtFont::Create(env, font); } env->SetLongField(font, AwtFont::pDataID, (jlong)awtFont); @@ -6439,10 +6187,62 @@ AwtComponent_GetHWnd(JNIEnv *env, jlong pData) return p->GetHWnd(); } +static void _GetInsets(void* param) +{ + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + + GetInsetsStruct *gis = (GetInsetsStruct *)param; + jobject self = gis->window; + + gis->insets->left = gis->insets->top = + gis->insets->right = gis->insets->bottom = 0; + + PDATA pData; + JNI_CHECK_PEER_GOTO(self, ret); + AwtComponent *component = (AwtComponent *)pData; + + component->GetInsets(gis->insets); + + ret: + env->DeleteGlobalRef(self); + delete gis; +} + +/** + * This method is called from the WGL pipeline when it needs to retrieve + * the insets associated with a ComponentPeer's C++ level object. + */ +void AwtComponent_GetInsets(JNIEnv *env, jobject peer, RECT *insets) +{ + TRY; + + GetInsetsStruct *gis = new GetInsetsStruct; + gis->window = env->NewGlobalRef(peer); + gis->insets = insets; + + AwtToolkit::GetInstance().InvokeFunction(_GetInsets, gis); + // global refs and mds are deleted in _UpdateWindow + + CATCH_BAD_ALLOC; + +} + JNIEXPORT void JNICALL Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls) { TRY; + jclass inputEventClazz = env->FindClass("java/awt/event/InputEvent"); + jmethodID getButtonDownMasksID = env->GetStaticMethodID(inputEventClazz, "getButtonDownMasks", "()[I"); + jintArray obj = (jintArray)env->CallStaticObjectMethod(inputEventClazz, getButtonDownMasksID); + jint * tmp = env->GetIntArrayElements(obj, JNI_FALSE); + + jsize len = env->GetArrayLength(obj); + AwtComponent::masks = new jint[len]; + for (int i = 0; i < len; i++) { + AwtComponent::masks[i] = tmp[i]; + } + env->ReleaseIntArrayElements(obj, tmp, 0); + env->DeleteLocalRef(obj); /* class ids */ jclass peerCls = env->FindClass("sun/awt/windows/WComponentPeer"); @@ -7017,20 +6817,6 @@ Java_sun_awt_windows_WComponentPeer_isObscured(JNIEnv* env, CATCH_BAD_ALLOC_RET(NULL); } -/* - * Class: sun_awt_windows_WComponentPeer - * Method: wheelInit - * Signature: ()V - */ -JNIEXPORT void JNICALL -Java_sun_awt_windows_WComponentPeer_wheelInit(JNIEnv *env, jclass cls) -{ - // Only necessary on Win95 - if (IS_WIN95 && !IS_WIN98) { - AwtComponent::Wheel95Init(); - } -} - JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WComponentPeer_processSynchronousLightweightTransfer(JNIEnv *env, jclass cls, jobject heavyweight, @@ -7209,7 +6995,9 @@ void AwtComponent::VerifyState() "getName", "()Ljava/lang/String;").l; DASSERT(!safe_ExceptionOccurred(env)); - printf("\t%S\n", TO_WSTRING(targetStr)); + LPCWSTR targetStrW = JNU_GetStringPlatformChars(env, targetStr, NULL); + printf("\t%S\n", targetStrW); + JNU_ReleaseStringPlatformChars(env, targetStr, targetStrW); } printf("\twas: [%d,%d,%dx%d]\n", x, y, width, height); if (!fSizeValid) { diff --git a/jdk/src/windows/native/sun/windows/awt_Component.h b/jdk/src/windows/native/sun/windows/awt_Component.h index b4bd849424c..0c18961ed49 100644 --- a/jdk/src/windows/native/sun/windows/awt_Component.h +++ b/jdk/src/windows/native/sun/windows/awt_Component.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -32,7 +32,7 @@ #include "awt_Brush.h" #include "awt_Pen.h" #include "awt_Win32GraphicsDevice.h" -#include "Win32SurfaceData.h" +#include "GDIWindowSurfaceData.h" #include "java_awt_Component.h" #include "sun_awt_windows_WComponentPeer.h" @@ -53,6 +53,22 @@ const UINT MAX_ACP_STR_LEN = 7; // ANSI CP identifiers are no longer than this #define MIDDLE_BUTTON 2 #define RIGHT_BUTTON 4 #define DBL_CLICK 8 +#define X1_BUTTON 16 +#define X2_BUTTON 32 + +#ifndef MK_XBUTTON1 +#define MK_XBUTTON1 0x0020 +#endif + +#ifndef MK_XBUTTON2 +#define MK_XBUTTON2 0x0040 +#endif + +// combination of standard mouse button flags +const int ALL_MK_BUTTONS = MK_LBUTTON|MK_MBUTTON|MK_RBUTTON; +const int X_BUTTONS = MK_XBUTTON1|MK_XBUTTON2; + + // Whether to check for embedded frame and adjust location #define CHECK_EMBEDDED 0 @@ -62,8 +78,6 @@ class AwtPopupMenu; class AwtDropTarget; -class DDrawDisplayMode; - struct WmComponentSetFocusData; /* @@ -83,11 +97,6 @@ enum MsgRouting { class AwtComponent : public AwtObject { public: - enum { - // combination of all mouse button flags - ALL_MK_BUTTONS = MK_LBUTTON|MK_MBUTTON|MK_RBUTTON - }; - /* java.awt.Component fields and method IDs */ static jfieldID peerID; static jfieldID xID; @@ -114,6 +123,7 @@ public: static jmethodID replaceSurfaceDataLaterMID; static const UINT WmAwtIsComponent; + static jint * masks; //InputEvent mask array AwtComponent(); virtual ~AwtComponent(); @@ -203,7 +213,8 @@ public: */ AwtComponent* GetParent(); - /* Get the component's immediate container. */ + /* Get the component's immediate container. Note: may return NULL while + the component is being reparented in full-screen mode by Direct3D */ class AwtWindow* GetContainer(); /* Is a component a container? Used by above method */ @@ -600,11 +611,6 @@ public: jintArray CreatePrintedPixels(SIZE &loc, SIZE &size); - virtual BOOL WmDDCreateSurface(Win32SDOps* wsdo); - virtual MsgRouting WmDDEnterFullScreen(HMONITOR monitor); - virtual MsgRouting WmDDExitFullScreen(HMONITOR monitor); - virtual MsgRouting WmDDSetDisplayMode(HMONITOR monitor, DDrawDisplayMode* pDisplayMode); - static void * GetNativeFocusOwner(); static void * GetNativeFocusedWindow(); static void ClearGlobalFocusOwner(); @@ -681,10 +687,6 @@ public: static HWND sm_focusOwner; static HWND sm_focusedWindow; - static BOOL m_isWin95; - static BOOL m_isWin2000; - static BOOL m_isWinNT; - static BOOL sm_bMenuLoop; static INLINE BOOL isMenuLoopActive() { return sm_bMenuLoop; diff --git a/jdk/src/windows/native/sun/windows/awt_Cursor.cpp b/jdk/src/windows/native/sun/windows/awt_Cursor.cpp index f524a465c01..c1f3d84e077 100644 --- a/jdk/src/windows/native/sun/windows/awt_Cursor.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Cursor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -79,10 +79,6 @@ AwtCursor::AwtCursor(JNIEnv *env, HCURSOR hCur, jobject jCur, int xH, int yH, custom = TRUE; dirty = FALSE; - - if (IsWin95Cursor()) { - customCursors.Add(this); - } } AwtCursor::~AwtCursor() @@ -96,9 +92,6 @@ void AwtCursor::Dispose() if (custom) { ::DestroyIcon(hCursor); - if (IsWin95Cursor()) { - customCursors.Remove(this); - } } JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); @@ -256,16 +249,6 @@ void AwtCursor::UpdateCursor(AwtComponent *comp) { env->DeleteLocalRef(jcomp); } -void AwtCursor::DirtyAllCustomCursors() { - if (IsWin95Cursor()) { - AwtObjectListItem *cur = customCursors.m_head; - while (cur != NULL) { - ((AwtCursor *)(cur->obj))->dirty = TRUE; - cur = cur->next; - } - } -} - void AwtCursor::Rebuild() { if (!dirty) { return; @@ -294,23 +277,6 @@ void AwtCursor::Rebuild() { dirty = FALSE; } -/* Bug fix for 4205805: - Custom cursor on WIN95 needs more effort, the same API works fine on NT - and WIN98. On Win95, DDB has to be passed in when calling createIconIndirect - Since DDB depends on the DISPLAY, we have to rebuild all the custom cursors - when user changes the display settings. -*/ -BOOL AwtCursor::IsWin95Cursor() { - static BOOL val; - static BOOL known = FALSE; - if (!known) { - val = (IS_WIN32 && !IS_NT && LOBYTE(LOWORD(::GetVersion())) == 4 && - HIBYTE(LOWORD(::GetVersion())) == 0); - known = TRUE; - } - return val; -} - extern "C" { /************************************************************************ diff --git a/jdk/src/windows/native/sun/windows/awt_Cursor.h b/jdk/src/windows/native/sun/windows/awt_Cursor.h index 7e59a899dcd..69c2931a2b8 100644 --- a/jdk/src/windows/native/sun/windows/awt_Cursor.h +++ b/jdk/src/windows/native/sun/windows/awt_Cursor.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -66,7 +66,6 @@ public: } static AwtCursor * CreateSystemCursor(jobject jCursor); static void UpdateCursor(AwtComponent *comp); - static void DirtyAllCustomCursors(); static HCURSOR GetCursor(JNIEnv *env, AwtComponent *comp); static void setPData(jobject cursor, jlong pdata) { @@ -76,7 +75,6 @@ public: private: void Rebuild(); - static BOOL IsWin95Cursor(); HCURSOR hCursor; jweak jCursor; diff --git a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp index 8cd5be4542e..5028b2a3e9d 100644 --- a/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DataTransferer.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 @@ -24,12 +24,11 @@ */ #include "awt.h" -#include "awt_dlls.h" #include "awt_DataTransferer.h" #include "awt_DnDDT.h" #include "awt_TextComponent.h" -#include "awt_Unicode.h" #include +#include #include #include @@ -271,9 +270,7 @@ Java_sun_awt_windows_WDataTransferer_dragQueryFile hdrop = (HDROP)bBytes; - load_shell_procs(); - - UINT nFilenames = (*do_drag_query_file)(hdrop, 0xFFFFFFFF, NULL, 0); + UINT nFilenames = ::DragQueryFile(hdrop, 0xFFFFFFFF, NULL, 0); jclass str_clazz = env->FindClass("java/lang/String"); DASSERT(str_clazz != NULL); @@ -287,12 +284,12 @@ Java_sun_awt_windows_WDataTransferer_dragQueryFile buffer = (LPTSTR)safe_Malloc(bufsize*sizeof(TCHAR)); for (UINT i = 0; i < nFilenames; i++) { - UINT size = (*do_drag_query_file)(hdrop, i, NULL, 0); + UINT size = ::DragQueryFile(hdrop, i, NULL, 0); if (size > bufsize) { bufsize = size; buffer = (LPTSTR)safe_Realloc(buffer, bufsize*sizeof(TCHAR)); } - (*do_drag_query_file)(hdrop, i, buffer, bufsize); + ::DragQueryFile(hdrop, i, buffer, bufsize); jstring name = JNU_NewStringPlatform(env, buffer); if (name == NULL) { @@ -454,11 +451,6 @@ Java_sun_awt_windows_WDataTransferer_platformImageBytesToImageData( width = p.x; height = -p.y; - // Win9X supports only 16-bit signed coordinates. - if (IS_WIN95) { - if (width > 0x7FFF) { width = 0x7FFF; } - if (height > 0x7FFF) { height = 0x7FFF; } - } free(lpemh); } break; diff --git a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp index f232a728231..4462ca12e4f 100644 --- a/jdk/src/windows/native/sun/windows/awt_Desktop.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Desktop.cpp @@ -23,8 +23,8 @@ * have any questions. */ +#include "awt.h" #include -#include #include #include @@ -40,32 +40,32 @@ extern "C" { JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute (JNIEnv *env, jclass cls, jstring uri_j, jstring verb_j) { - const WCHAR* uri_c = env->GetStringChars(uri_j, JNI_FALSE); - const WCHAR* verb_c = env->GetStringChars(verb_j, JNI_FALSE); + LPCWSTR uri_c = JNU_GetStringPlatformChars(env, uri_j, JNI_FALSE); + LPCWSTR verb_c = JNU_GetStringPlatformChars(env, verb_j, JNI_FALSE); // 6457572: ShellExecute possibly changes FPU control word - saving it here unsigned oldcontrol87 = _control87(0, 0); - HINSTANCE retval = ShellExecuteW(NULL, verb_c, uri_c, NULL, NULL, SW_SHOWNORMAL); + HINSTANCE retval = ::ShellExecute(NULL, verb_c, uri_c, NULL, NULL, SW_SHOWNORMAL); _control87(oldcontrol87, 0xffffffff); - env->ReleaseStringChars(uri_j, uri_c); - env->ReleaseStringChars(verb_j, verb_c); + JNU_ReleaseStringPlatformChars(env, uri_j, uri_c); + JNU_ReleaseStringPlatformChars(env, verb_j, verb_c); if ((int)retval <= 32) { // ShellExecute failed. - LPVOID buffer; - int len = FormatMessageW( + LPTSTR buffer = NULL; + int len = ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - (LPWSTR) &buffer, + (LPTSTR)&buffer, 0, NULL ); - jstring errmsg = env->NewString((LPCWSTR)buffer, len); + jstring errmsg = JNU_NewStringPlatform(env, buffer, len); LocalFree(buffer); return errmsg; } diff --git a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp index 10c00fe2c29..1475dee38ab 100644 --- a/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DesktopProperties.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -23,17 +23,17 @@ * have any questions. */ -#include "stdhdrs.h" +#include "awt.h" #include "mmsystem.h" #include "jlong.h" -#include "awt.h" #include "awt_DesktopProperties.h" -#include "awt_dlls.h" +#include "awt_Toolkit.h" #include "sun_awt_windows_WDesktopProperties.h" #include "java_awt_Font.h" #include "awtmsg.h" -#include "Zmouse.h" -#include "shellapi.h" +#include "zmouse.h" +#include +#include // WDesktopProperties fields jfieldID AwtDesktopProperties::pDataID = 0; @@ -44,10 +44,6 @@ jmethodID AwtDesktopProperties::setColorPropertyID = 0; jmethodID AwtDesktopProperties::setFontPropertyID = 0; jmethodID AwtDesktopProperties::setSoundPropertyID = 0; -typedef VOID (WINAPI *SHGetSettingsType)(LPSHELLFLAGSTATE, DWORD); -static HMODULE libShell32 = NULL; -static SHGetSettingsType fn_SHGetSettings; - AwtDesktopProperties::AwtDesktopProperties(jobject self) { this->self = GetEnv()->NewGlobalRef(self); GetEnv()->SetLongField( self, AwtDesktopProperties::pDataID, @@ -431,14 +427,12 @@ void CheckFontSmoothingSettings(HWND hWnd) { void AwtDesktopProperties::GetColorParameters() { - if (IS_WIN98 || IS_WIN2000) { - SetColorProperty(TEXT("win.frame.activeCaptionGradientColor"), - GetSysColor(COLOR_GRADIENTACTIVECAPTION)); - SetColorProperty(TEXT("win.frame.inactiveCaptionGradientColor"), - GetSysColor(COLOR_GRADIENTINACTIVECAPTION)); - SetColorProperty(TEXT("win.item.hotTrackedColor"), - GetSysColor(COLOR_HOTLIGHT)); - } + SetColorProperty(TEXT("win.frame.activeCaptionGradientColor"), + GetSysColor(COLOR_GRADIENTACTIVECAPTION)); + SetColorProperty(TEXT("win.frame.inactiveCaptionGradientColor"), + GetSysColor(COLOR_GRADIENTINACTIVECAPTION)); + SetColorProperty(TEXT("win.item.hotTrackedColor"), + GetSysColor(COLOR_HOTLIGHT)); SetColorProperty(TEXT("win.3d.darkShadowColor"), GetSysColor(COLOR_3DDKSHADOW)); SetColorProperty(TEXT("win.3d.backgroundColor"), GetSysColor(COLOR_3DFACE)); SetColorProperty(TEXT("win.3d.highlightColor"), GetSysColor(COLOR_3DHIGHLIGHT)); @@ -510,40 +504,18 @@ void AwtDesktopProperties::GetOtherParameters() { // This property is called "win.frame.fullWindowDragsOn" above // This is one of the properties that don't trigger WM_SETTINGCHANGE SetBooleanProperty(TEXT("awt.dynamicLayoutSupported"), GetBooleanParameter(SPI_GETDRAGFULLWINDOWS)); - - // 95 MouseWheel support - // More or less copied from the MSH_MOUSEWHEEL MSDN entry - if (IS_WIN95 && !IS_WIN98) { - HWND hdlMSHWHEEL = NULL; - UINT msgMSHWheelSupported = NULL; - BOOL wheelSupported = FALSE; - - msgMSHWheelSupported = RegisterWindowMessage(MSH_WHEELSUPPORT); - hdlMSHWHEEL = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE); - if (hdlMSHWHEEL && msgMSHWheelSupported) { - wheelSupported = (BOOL)::SendMessage(hdlMSHWHEEL, - msgMSHWheelSupported, 0, 0); - } - SetBooleanProperty(TEXT("awt.wheelMousePresent"), wheelSupported); - } - else { - SetBooleanProperty(TEXT("awt.wheelMousePresent"), - ::GetSystemMetrics(SM_MOUSEWHEELPRESENT)); - } + SetBooleanProperty(TEXT("awt.wheelMousePresent"), + ::GetSystemMetrics(SM_MOUSEWHEELPRESENT)); // END cross-platform properties - if (IS_WIN98 || IS_WIN2000) { - //DWORD menuShowDelay; - //SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &menuShowDelay, 0); - // SetIntegerProperty(TEXT("win.menu.showDelay"), menuShowDelay); - SetBooleanProperty(TEXT("win.frame.captionGradientsOn"), GetBooleanParameter(SPI_GETGRADIENTCAPTIONS)); - SetBooleanProperty(TEXT("win.item.hotTrackingOn"), GetBooleanParameter(SPI_GETHOTTRACKING)); - } + //DWORD menuShowDelay; + //SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &menuShowDelay, 0); + // SetIntegerProperty(TEXT("win.menu.showDelay"), menuShowDelay); + SetBooleanProperty(TEXT("win.frame.captionGradientsOn"), GetBooleanParameter(SPI_GETGRADIENTCAPTIONS)); + SetBooleanProperty(TEXT("win.item.hotTrackingOn"), GetBooleanParameter(SPI_GETHOTTRACKING)); - if (IS_WIN2000) { - SetBooleanProperty(TEXT("win.menu.keyboardCuesOn"), GetBooleanParameter(SPI_GETKEYBOARDCUES)); - } + SetBooleanProperty(TEXT("win.menu.keyboardCuesOn"), GetBooleanParameter(SPI_GETKEYBOARDCUES)); // High contrast accessibility property HIGHCONTRAST contrast; @@ -557,21 +529,19 @@ void AwtDesktopProperties::GetOtherParameters() { SetBooleanProperty(TEXT("win.highContrast.on"), FALSE); } - if (fn_SHGetSettings != NULL) { - SHELLFLAGSTATE sfs; - fn_SHGetSettings(&sfs, SSF_SHOWALLOBJECTS | SSF_SHOWATTRIBCOL); - if (sfs.fShowAllObjects) { - SetBooleanProperty(TEXT("awt.file.showHiddenFiles"), TRUE); - } - else { - SetBooleanProperty(TEXT("awt.file.showHiddenFiles"), FALSE); - } - if (sfs.fShowAttribCol) { - SetBooleanProperty(TEXT("awt.file.showAttribCol"), TRUE); - } - else { - SetBooleanProperty(TEXT("awt.file.showAttribCol"), FALSE); - } + SHELLFLAGSTATE sfs; + ::SHGetSettings(&sfs, SSF_SHOWALLOBJECTS | SSF_SHOWATTRIBCOL); + if (sfs.fShowAllObjects) { + SetBooleanProperty(TEXT("awt.file.showHiddenFiles"), TRUE); + } + else { + SetBooleanProperty(TEXT("awt.file.showHiddenFiles"), FALSE); + } + if (sfs.fShowAttribCol) { + SetBooleanProperty(TEXT("awt.file.showAttribCol"), TRUE); + } + else { + SetBooleanProperty(TEXT("awt.file.showAttribCol"), FALSE); } LPTSTR value; @@ -667,7 +637,7 @@ UINT AwtDesktopProperties::GetIntegerParameter(UINT spi) { } void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setStringPropertyID, key, JNU_NewStringPlatform(GetEnv(), value)); @@ -675,7 +645,7 @@ void AwtDesktopProperties::SetStringProperty(LPCTSTR propName, LPTSTR value) { } void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setIntegerPropertyID, key, (jint)value); @@ -683,7 +653,7 @@ void AwtDesktopProperties::SetIntegerProperty(LPCTSTR propName, int value) { } void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setBooleanPropertyID, key, value ? JNI_TRUE : JNI_FALSE); @@ -691,7 +661,7 @@ void AwtDesktopProperties::SetBooleanProperty(LPCTSTR propName, BOOL value) { } void AwtDesktopProperties::SetColorProperty(LPCTSTR propName, DWORD value) { - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setColorPropertyID, key, GetRValue(value), GetGValue(value), @@ -743,7 +713,7 @@ void AwtDesktopProperties::SetFontProperty(HDC dc, int fontID, style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -761,7 +731,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon jint pointSize; jint style; - fontName = JNU_NewStringPlatform(GetEnv(), font.lfFaceName); + fontName = JNU_NewStringPlatform(GetEnv(), const_cast(font.lfFaceName)); #if 0 HDC hdc; @@ -784,7 +754,7 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon style |= java_awt_Font_ITALIC; } - jstring key = JNU_NewStringPlatform(GetEnv(), propName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setFontPropertyID, key, fontName, style, pointSize); @@ -793,8 +763,8 @@ void AwtDesktopProperties::SetFontProperty(LPCTSTR propName, const LOGFONT & fon } void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventName) { - jstring key = JNU_NewStringPlatform(GetEnv(), propName); - jstring event = JNU_NewStringPlatform(GetEnv(), winEventName); + jstring key = JNU_NewStringPlatform(GetEnv(), const_cast(propName)); + jstring event = JNU_NewStringPlatform(GetEnv(), const_cast(winEventName)); GetEnv()->CallVoidMethod(self, AwtDesktopProperties::setSoundPropertyID, key, event); @@ -805,9 +775,9 @@ void AwtDesktopProperties::SetSoundProperty(LPCTSTR propName, LPCTSTR winEventNa void AwtDesktopProperties::PlayWindowsSound(LPCTSTR event) { // stop any currently playing sounds - AwtWinMM::PlaySoundWrapper(NULL, NULL, SND_PURGE); + ::PlaySound(NULL, NULL, SND_PURGE); // play the sound for the given event name - AwtWinMM::PlaySoundWrapper(event, NULL, SND_ASYNC|SND_ALIAS|SND_NODEFAULT); + ::PlaySound(event, NULL, SND_ASYNC|SND_ALIAS|SND_NODEFAULT); } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -852,16 +822,6 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WDesktopProperties_init(JNIEnv *env, jobject self) { TRY; - // Open shell32.dll, get the symbol for SHGetSettings - libShell32 = LoadLibrary(TEXT("shell32.dll")); - if (libShell32 == NULL) { - fn_SHGetSettings = NULL; - } - else { - fn_SHGetSettings = (SHGetSettingsType)GetProcAddress( - libShell32, "SHGetSettings"); - } - new AwtDesktopProperties(self); CATCH_BAD_ALLOC; diff --git a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp index 948fc0883ed..ecf74549d46 100644 --- a/jdk/src/windows/native/sun/windows/awt_Dialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Dialog.cpp @@ -132,14 +132,13 @@ AwtDialog* AwtDialog::Create(jobject peer, jobject parent) dialog = new AwtDialog(); { - int colorId = IS_WIN4X ? COLOR_3DFACE : COLOR_WINDOW; + int colorId = COLOR_3DFACE; DWORD style = WS_CAPTION | WS_SYSMENU | WS_CLIPCHILDREN; if (hwndParent != NULL) { style |= WS_POPUP; } style &= ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX); - DWORD exStyle = IS_WIN4X ? WS_EX_WINDOWEDGE | WS_EX_DLGMODALFRAME - : 0; + DWORD exStyle = WS_EX_WINDOWEDGE | WS_EX_DLGMODALFRAME; if (GetRTL()) { exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR; @@ -663,7 +662,7 @@ void AwtDialog::_SetIMMOption(void *param) int badAlloc = 0; LPCTSTR coption; - LPTSTR empty = TEXT("InputMethod"); + LPCTSTR empty = TEXT("InputMethod"); AwtDialog *d = NULL; PDATA pData; diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDS.cpp index 31ee7edcbe3..bb2ac566493 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-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -23,6 +23,7 @@ * have any questions. */ +#include "awt.h" #include "jlong.h" #include "awt_DataTransferer.h" #include "awt_DnDDS.h" @@ -36,8 +37,6 @@ #include "sun_awt_dnd_SunDragSourceContextPeer.h" #include "sun_awt_windows_WDragSourceContextPeer.h" -#include -#include #include #include diff --git a/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp b/jdk/src/windows/native/sun/windows/awt_DnDDT.cpp index 8940a30266a..fce80f468b2 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-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -30,11 +30,8 @@ #include "awt_Toolkit.h" #include "java_awt_dnd_DnDConstants.h" #include "sun_awt_windows_WDropTargetContextPeer.h" -#include "awt_dlls.h" #include "awt_Container.h" -#include -#include #include #include @@ -555,8 +552,7 @@ jobject AwtDropTarget::GetData(jlong fmt) { break; } case TYMED_FILE: { - jobject local = JNU_NewStringPlatform(env, (LPCTSTR) - stgmedium.lpszFileName); + jobject local = JNU_NewStringPlatform(env, stgmedium.lpszFileName); jstring fileName = (jstring)env->NewGlobalRef(local); env->DeleteLocalRef(local); diff --git a/jdk/src/windows/native/sun/windows/awt_DrawingSurface.cpp b/jdk/src/windows/native/sun/windows/awt_DrawingSurface.cpp index a69d932d03f..b7b7913b780 100644 --- a/jdk/src/windows/native/sun/windows/awt_DrawingSurface.cpp +++ b/jdk/src/windows/native/sun/windows/awt_DrawingSurface.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -24,13 +24,13 @@ */ #define _JNI_IMPLEMENTATION_ + +#include "awt.h" #include "awt_DrawingSurface.h" -#include "WindowsFlags.h" #include "awt_Component.h" jclass jawtVImgClass; jclass jawtComponentClass; -jclass jawtW32ossdClass; jfieldID jawtPDataID; jfieldID jawtSDataID; jfieldID jawtSMgrID; @@ -82,31 +82,7 @@ jint JAWTOffscreenDrawingSurfaceInfo::Init(JAWTOffscreenDrawingSurface* parent) { TRY; - JNIEnv* env = parent->env; - jobject target = parent->target; - if (JNU_IsNull(env, target)) { - DTRACE_PRINTLN("NULL target"); - return JAWT_LOCK_ERROR; - } - Win32SDOps * ops = - (Win32SDOps *)((void*)env->GetLongField(target, jawtPDataID)); - if (ops == NULL) { - DTRACE_PRINTLN("NULL ops"); - return JAWT_LOCK_ERROR; - } - ddrawSurface = ops->lpSurface; - if (ddrawSurface == NULL) { - DTRACE_PRINTLN("NULL lpSurface"); - return JAWT_LOCK_ERROR; - } - DXSurface *dxSurface = ddrawSurface->GetDXSurface(); - if (dxSurface == NULL) { - DTRACE_PRINTLN("NULL dxSurface"); - return JAWT_LOCK_ERROR; - } - platformInfo = this; - ds = parent; - return 0; + return JAWT_LOCK_ERROR; CATCH_BAD_ALLOC_RET(JAWT_LOCK_ERROR); } @@ -248,58 +224,12 @@ void JNICALL JAWTOffscreenDrawingSurface::FreeDSI jint JNICALL JAWTOffscreenDrawingSurface::LockSurface (JAWT_DrawingSurface* ds) { - TRY; - - if (ds == NULL) { - DTRACE_PRINTLN("Drawing Surface is NULL"); - return JAWT_LOCK_ERROR; - } - JAWTOffscreenDrawingSurface* pds = - static_cast(ds); - jint val = pds->info.Init(pds); - if ((val & JAWT_LOCK_ERROR) != 0) { - return val; - } - DDrawSurface *ddrawSurface = pds->info.ddrawSurface; - if (ddrawSurface == NULL) { - return JAWT_LOCK_ERROR; - } - ddrawSurface->GetExclusiveAccess(); - DXSurface *dxSurface = ddrawSurface->GetDXSurface(); - if (!dxSurface) { - return JAWT_LOCK_ERROR; - } - switch (dxSurface->GetVersionID()) { - case VERSION_DX7: - { - pds->info.dx7Surface = dxSurface->GetDDSurface(); - break; - } - default: - // Leave info values at default and return error - DTRACE_PRINTLN1("unknown jawt offscreen version: %d\n", - dxSurface->GetVersionID()); - return JAWT_LOCK_ERROR; - } - return 0; - - CATCH_BAD_ALLOC_RET(JAWT_LOCK_ERROR); + return JAWT_LOCK_ERROR; } void JNICALL JAWTOffscreenDrawingSurface::UnlockSurface (JAWT_DrawingSurface* ds) { - TRY_NO_VERIFY; - - if (ds == NULL) { - DTRACE_PRINTLN("Drawing Surface is NULL"); - return; - } - JAWTOffscreenDrawingSurface* pds = - static_cast(ds); - pds->info.ddrawSurface->ReleaseExclusiveAccess(); - - CATCH_BAD_ALLOC; } /* C exports */ @@ -313,31 +243,9 @@ extern "C" JNIEXPORT JAWT_DrawingSurface* JNICALL DSGetDrawingSurface if (env->IsInstanceOf(target, jawtComponentClass)) { return new JAWTDrawingSurface(env, target); } - // Sharing native offscreen surfaces is disabled by default in - // this release. Sharing is enabled via the -Dsun.java2d.offscreenSharing - // flag. - if (g_offscreenSharing && env->IsInstanceOf(target, jawtVImgClass)) { - jobject sMgr, sData; - sMgr = env->GetObjectField(target, jawtSMgrID); - if (!sMgr) { - return NULL; - } - sData = env->GetObjectField(sMgr, jawtSDataID); - if (!sData || !(env->IsInstanceOf(sData, jawtW32ossdClass))) { - return NULL; - } - return new JAWTOffscreenDrawingSurface(env, sData); - } else { - if (!g_offscreenSharing) { - DTRACE_PRINTLN( - "GetDrawingSurface target must be a Component"); - } else { - DTRACE_PRINTLN( - "GetDrawingSurface target must be a Component or VolatileImage"); - } - return NULL; - } + DTRACE_PRINTLN("GetDrawingSurface target must be a Component"); + return NULL; CATCH_BAD_ALLOC_RET(NULL); } diff --git a/jdk/src/windows/native/sun/windows/awt_DrawingSurface.h b/jdk/src/windows/native/sun/windows/awt_DrawingSurface.h index 5bfd7b7353a..4027ebe722c 100644 --- a/jdk/src/windows/native/sun/windows/awt_DrawingSurface.h +++ b/jdk/src/windows/native/sun/windows/awt_DrawingSurface.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -30,7 +30,7 @@ #include #include #include "awt_Component.h" -#include "ddrawObject.h" +#include class JAWTDrawingSurface; class JAWTOffscreenDrawingSurface; @@ -84,8 +84,6 @@ class JAWTOffscreenDrawingSurfaceInfo : public: jint Init(JAWTOffscreenDrawingSurface* parent); -public: - DDrawSurface *ddrawSurface; }; /* diff --git a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp index 08d839fc44f..84339e40eee 100644 --- a/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -27,7 +27,6 @@ #include "awt_FileDialog.h" #include "awt_Dialog.h" #include "awt_Toolkit.h" -#include "awt_dlls.h" #include "ComCtl32Util.h" #include #include @@ -65,7 +64,7 @@ AwtFileDialog::Initialize(JNIEnv *env, jstring filterDescription) { int length = env->GetStringLength(filterDescription); DASSERT(length + 1 < MAX_FILTER_STRING); - LPCTSTR tmp = (LPTSTR)JNU_GetStringPlatformChars(env, filterDescription, NULL); + LPCTSTR tmp = JNU_GetStringPlatformChars(env, filterDescription, NULL); _tcscpy(s_fileFilterString, tmp); JNU_ReleaseStringPlatformChars(env, filterDescription, tmp); @@ -156,7 +155,7 @@ FileDialogHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) LPITEMIDLIST pidl = (LPITEMIDLIST)notifyEx->pidl; // Get the filename and directory TCHAR szPath[MAX_PATH]; - if (!get_path_from_idlist(pidl,szPath)) { + if (!::SHGetPathFromIDList(pidl, szPath)) { return TRUE; } jstring strPath = JNU_NewStringPlatform(env, szPath); @@ -190,7 +189,7 @@ AwtFileDialog::Show(void *p) WCHAR unicodeChar = L' '; LPTSTR fileBuffer = NULL; LPTSTR currentDirectory = NULL; - AWTOPENFILENAME ofn; + OPENFILENAME ofn; jint mode = 0; BOOL result = FALSE; DWORD dlgerr; @@ -222,7 +221,7 @@ AwtFileDialog::Show(void *p) HWND hwndOwner = awtParent ? awtParent->GetHWnd() : NULL; if (title == NULL || env->GetStringLength(title)==0) { - title = env->NewString(&unicodeChar, 1); + title = JNU_NewStringPlatform(env, &unicodeChar); } JavaStringBuffer titleBuffer(env, title); @@ -243,14 +242,7 @@ AwtFileDialog::Show(void *p) memset(&ofn, 0, sizeof(ofn)); - // According to the MSDN docs, lStructSize must be set to - // OPENFILENAME_SIZE_VERSION_400 on NT4.0. - if (IS_NT && !(IS_WIN2000)) { - ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; - } - else { ofn.lStructSize = sizeof(ofn); - } ofn.lpstrFilter = s_fileFilterString; ofn.nFilterIndex = 1; /* @@ -289,9 +281,6 @@ AwtFileDialog::Show(void *p) mode = env->GetIntField(target, AwtFileDialog::modeID); - // Fix for 4364256 : call load_shell_procs() - load_shell_procs(); - AwtDialog::CheckInstallModalHook(); // show the Win32 file dialog @@ -304,7 +293,7 @@ AwtFileDialog::Show(void *p) // If the dialog is not shown because of invalid file name // replace the file name by empty string. if (!result) { - dlgerr = AwtCommDialog::CommDlgExtendedError(); + dlgerr = ::CommDlgExtendedError(); if (dlgerr == FNERR_INVALIDFILENAME) { _tcscpy(fileBuffer, TEXT("")); if (mode == java_awt_FileDialog_LOAD) { @@ -326,7 +315,7 @@ AwtFileDialog::Show(void *p) // Report result to peer. if (result) { jstring tmpJString = (_tcslen(ofn.lpstrFile) == 0 ? - env->NewStringUTF("") : + JNU_NewStringPlatform(env, L"") : JNU_NewStringPlatform(env, ofn.lpstrFile)); env->CallVoidMethod(peer, AwtFileDialog::handleSelectedMID, tmpJString); env->DeleteLocalRef(tmpJString); @@ -362,20 +351,18 @@ AwtFileDialog::Show(void *p) } BOOL -AwtFileDialog::GetOpenFileName(LPAWTOPENFILENAME data) { - AwtCommDialog::load_comdlg_procs(); +AwtFileDialog::GetOpenFileName(LPOPENFILENAME data) { return static_cast(reinterpret_cast( AwtToolkit::GetInstance().InvokeFunction((void*(*)(void*)) - AwtCommDialog::GetOpenFileNameWrapper, data))); + ::GetOpenFileName, data))); } BOOL -AwtFileDialog::GetSaveFileName(LPAWTOPENFILENAME data) { - AwtCommDialog::load_comdlg_procs(); +AwtFileDialog::GetSaveFileName(LPOPENFILENAME data) { return static_cast(reinterpret_cast( AwtToolkit::GetInstance().InvokeFunction((void *(*)(void *)) - AwtCommDialog::GetSaveFileNameWrapper, data))); + ::GetSaveFileName, data))); } diff --git a/jdk/src/windows/native/sun/windows/awt_FileDialog.h b/jdk/src/windows/native/sun/windows/awt_FileDialog.h index 9a324f68f34..82638d30752 100644 --- a/jdk/src/windows/native/sun/windows/awt_FileDialog.h +++ b/jdk/src/windows/native/sun/windows/awt_FileDialog.h @@ -1,5 +1,5 @@ /* - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -36,43 +36,6 @@ #include "java_awt_FileDialog.h" #include "sun_awt_windows_WFileDialogPeer.h" -// The VC6 headers don't include this, but it's necessary for -// backward-compatibility with NT4.0, so we fake it. -#ifndef OPENFILENAME_SIZE_VERSION_400 - // Determined via sizeof(OPENFILENAME) - #define OPENFILENAME_SIZE_VERSION_400 76 -#endif - -// 4859390 -// For the Places Bar to show up, we need the "full" OPENFILENAME struct -typedef struct tagAWTOFN { - DWORD lStructSize; - HWND hwndOwner; - HINSTANCE hInstance; - LPCTSTR lpstrFilter; - LPTSTR lpstrCustomFilter; - DWORD nMaxCustFilter; - DWORD nFilterIndex; - LPTSTR lpstrFile; - DWORD nMaxFile; - LPTSTR lpstrFileTitle; - DWORD nMaxFileTitle; - LPCTSTR lpstrInitialDir; - LPCTSTR lpstrTitle; - DWORD Flags; - WORD nFileOffset; - WORD nFileExtension; - LPCTSTR lpstrDefExt; - LPARAM lCustData; - LPOFNHOOKPROC lpfnHook; - LPCTSTR lpTemplateName; -//#if (_WIN32_WINNT >= 0x0500) - void * pvReserved; - DWORD dwReserved; - DWORD FlagsEx; -//#endif // (_WIN32_WINNT >= 0x0500) -} AWTOPENFILENAME, *LPAWTOPENFILENAME; - /************************************************************************ * AwtFileDialog class */ @@ -96,8 +59,8 @@ public: static void Initialize(JNIEnv *env, jstring filterDescription); static void Show(void *peer); - static BOOL GetOpenFileName(LPAWTOPENFILENAME); - static BOOL GetSaveFileName(LPAWTOPENFILENAME); + static BOOL GetOpenFileName(LPOPENFILENAME); + static BOOL GetSaveFileName(LPOPENFILENAME); virtual BOOL InheritsNativeMouseWheelBehavior(); diff --git a/jdk/src/windows/native/sun/windows/awt_Font.cpp b/jdk/src/windows/native/sun/windows/awt_Font.cpp index 8dc9d5a67b5..6815b1afab1 100644 --- a/jdk/src/windows/native/sun/windows/awt_Font.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Font.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -23,6 +23,7 @@ * have any questions. */ +#include "awt.h" #include #include "jlong.h" #include "awt_Font.h" @@ -195,7 +196,7 @@ AwtFont* AwtFont::GetFont(JNIEnv *env, jobject font, } // Get suitable CHARSET from charset string provided by font configuration. -static int GetNativeCharset(WCHAR* name) +static int GetNativeCharset(LPCWSTR name) { if (wcsstr(name, L"ANSI_CHARSET")) return ANSI_CHARSET; @@ -259,7 +260,7 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) cfnum = 0; } - WCHAR* wName; + LPCWSTR wName; awtFont = new AwtFont(cfnum, env, font); @@ -269,9 +270,7 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) if (cfnum > 0) { // Ask peer class for the text component font name jstring jTextComponentFontName = GetTextComponentFontName(env, font); - WCHAR* textComponentFontName = TO_WSTRING(jTextComponentFontName); - - env->DeleteLocalRef(jTextComponentFontName); + LPCWSTR textComponentFontName = JNU_GetStringPlatformChars(env, jTextComponentFontName, NULL); awtFont->m_textInput = -1; for (int i = 0; i < cfnum; i++) { @@ -282,13 +281,13 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) jstring nativeName = (jstring)env->GetObjectField(fontDescriptor, AwtFont::nativeNameID); - wName = TO_WSTRING(nativeName); + wName = JNU_GetStringPlatformChars(env, nativeName, NULL); DASSERT(wName); //On NT platforms, if the font is not Symbol or Dingbats //use "W" version of Win32 APIs directly, info the FontDescription //no need to convert characters from Unicode to locale encodings. - if (IS_NT && GetNativeCharset(wName) != SYMBOL_CHARSET) { + if (GetNativeCharset(wName) != SYMBOL_CHARSET) { env->SetBooleanField(fontDescriptor, AwtFont::useUnicodeID, TRUE); } @@ -299,10 +298,12 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) (wcscmp(wName, textComponentFontName) == 0)) { awtFont->m_textInput = i; } - HFONT hfonttmp = CreateHFont(wName, fontStyle, fontSize, + HFONT hfonttmp = CreateHFont(const_cast(wName), fontStyle, fontSize, angle, awScale); awtFont->m_hFont[i] = hfonttmp; + JNU_ReleaseStringPlatformChars(env, nativeName, wName); + env->DeleteLocalRef(fontDescriptor); env->DeleteLocalRef(nativeName); } @@ -311,11 +312,14 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) // to first component awtFont->m_textInput = 0; } + + JNU_ReleaseStringPlatformChars(env, jTextComponentFontName, textComponentFontName); + env->DeleteLocalRef(jTextComponentFontName); } else { // Instantiation for English version. jstring fontName = (jstring)env->GetObjectField(font, AwtFont::nameID); - wName = TO_WSTRING(fontName); + wName = JNU_GetStringPlatformChars(env, fontName, NULL); WCHAR* wEName; if (!wcscmp(wName, L"Helvetica") || !wcscmp(wName, L"SansSerif")) { @@ -338,6 +342,9 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) awtFont->m_textInput = 0; awtFont->m_hFont[0] = CreateHFont(wEName, fontStyle, fontSize, angle, awScale); + + JNU_ReleaseStringPlatformChars(env, fontName, wName); + env->DeleteLocalRef(fontName); } /* The several callers of this method also set the pData field. @@ -381,7 +388,7 @@ static void strip_tail(wchar_t* text, wchar_t* tail) { // strips tail and any po } -static HFONT CreateHFont_sub(WCHAR* name, int style, int height, +static HFONT CreateHFont_sub(LPCWSTR name, int style, int height, int angle=0, float awScale=1.0f) { LOGFONTW logFont; @@ -420,18 +427,7 @@ static HFONT CreateHFont_sub(WCHAR* name, int style, int height, strip_tail(tmpname,L"Italic"); strip_tail(tmpname,L"Bold"); wcscpy(&(logFont.lfFaceName[0]), tmpname); - HFONT hFont; - if (IS_WIN95) { -#ifdef WIN32 - DASSERT(IS_WIN95); -#endif - HDC hdc = ::GetDC(NULL); - ::EnumFontFamiliesEx(hdc, &logFont, (FONTENUMPROC)FindFamilyName, - (LPARAM)tmpname, 0L); - ::ReleaseDC(NULL, hdc); - wcscpy(&logFont.lfFaceName[0], tmpname); - } - hFont = ::CreateFontIndirectW(&logFont); + HFONT hFont = ::CreateFontIndirect(&logFont); DASSERT(hFont != NULL); // get a expanded or condensed version if its specified. if (awScale != 1.0f) { @@ -446,7 +442,7 @@ static HFONT CreateHFont_sub(WCHAR* name, int style, int height, } avgWidth = tm.tmAveCharWidth; logFont.lfWidth = (LONG)((fabs)(avgWidth*awScale)); - hFont = CreateFontIndirectW(&logFont); + hFont = ::CreateFontIndirect(&logFont); DASSERT(hFont != NULL); VERIFY(::ReleaseDC(0, hDC)); } @@ -460,15 +456,8 @@ HFONT AwtFont::CreateHFont(WCHAR* name, int style, int height, WCHAR longName[80]; // 80 > (max face name(=30) + strlen("CHINESEBIG5_CHARSET")) // longName doesn't have to be printable. So, it is OK not to convert. - if (IS_NT) { - //wsprintfW only works on NT. See bugid 4123362 - wsprintfW(longName, L"%ls-%d-%d", name, style, height); - } else { -#ifdef WIN32 - DASSERT(IS_WIN95); -#endif - swprintf(longName, L"%ls-%d-%d", name, style, height); - } + + wsprintf(longName, L"%ls-%d-%d", name, style, height); HFONT hFont = NULL; @@ -682,28 +671,16 @@ SIZE AwtFont::DrawStringSize_sub(jstring str, HDC hDC, if (arrayLength == 0) { int length = env->GetStringLength(str); - WCHAR* string = TO_WSTRING(str); + LPCWSTR strW = JNU_GetStringPlatformChars(env, str, NULL); VERIFY(::SelectObject(hDC, awtFont->GetHFont())); if (AwtComponent::GetRTLReadingOrder()){ - if (IS_WIN95) { - // Start of conversion Code to fix arabic shaping problems - // with unicode support in win 95 - LPSTR buffer = (LPSTR) alloca((wcslen(string) + 1) * 2); - int count = ::WideCharToMultiByte(codePage, 0, string, length, - buffer, - static_cast((wcslen(string) + 1) * 2), - NULL, NULL); - VERIFY(!draw || ::ExtTextOutA(hDC, x, y, ETO_RTLREADING, NULL, - buffer, count, NULL)); - // End Of Conversion Code - } else { - VERIFY(!draw || ::ExtTextOutW(hDC, x, y, ETO_RTLREADING, NULL, - string, length, NULL)); - } + VERIFY(!draw || ::ExtTextOut(hDC, x, y, ETO_RTLREADING, NULL, + strW, length, NULL)); } else { - VERIFY(!draw || ::TextOutW(hDC, x, y, string, length)); + VERIFY(!draw || ::TextOut(hDC, x, y, strW, length)); } - VERIFY(::GetTextExtentPoint32W(hDC, string, length, &size)); + VERIFY(::GetTextExtentPoint32(hDC, strW, length, &size)); + JNU_ReleaseStringPlatformChars(env, str, strW); } else { for (int i = 0; i < arrayLength; i = i + 2) { jobject fontDescriptor = env->GetObjectArrayElement(array, i); @@ -732,7 +709,7 @@ SIZE AwtFont::DrawStringSize_sub(jstring str, HDC hDC, * extend buflen and bad things will happen. */ unsigned char* buffer = NULL; - jboolean unicodeUsed = env->GetBooleanField(fontDescriptor,AwtFont::useUnicodeID); + jboolean unicodeUsed = env->GetBooleanField(fontDescriptor, AwtFont::useUnicodeID); try { buffer = (unsigned char *) env->GetPrimitiveArrayCritical(convertedBytes, 0); @@ -1231,7 +1208,7 @@ class CSegTableComponent public: CSegTableComponent(); virtual ~CSegTableComponent(); - virtual void Create(LPWSTR name); + virtual void Create(LPCWSTR name); virtual BOOL In(USHORT iChar) { DASSERT(FALSE); return FALSE; }; LPWSTR GetFontName(){ DASSERT(m_lpszFontName != NULL); return m_lpszFontName; @@ -1254,7 +1231,7 @@ CSegTableComponent::~CSegTableComponent() } } -void CSegTableComponent::Create(LPWSTR name) +void CSegTableComponent::Create(LPCWSTR name) { if (m_lpszFontName != NULL) { free(m_lpszFontName); @@ -1453,7 +1430,7 @@ public: CStdSegTable(); virtual ~CStdSegTable(); BOOL IsEUDC() { return FALSE; }; - virtual void Create(LPWSTR name); + virtual void Create(LPCWSTR name); protected: void GetData(DWORD dwOffset, LPVOID lpData, DWORD cbData); @@ -1481,7 +1458,7 @@ inline void CStdSegTable::GetData(DWORD dwOffset, DASSERT(nBytes != GDI_ERROR); } -void CStdSegTable::Create(LPWSTR name) +void CStdSegTable::Create(LPCWSTR name) { CSegTableComponent::Create(name); @@ -1509,7 +1486,7 @@ public: CEUDCSegTable(); virtual ~CEUDCSegTable(); BOOL IsEUDC() { return TRUE; }; - virtual void Create(LPWSTR name); + virtual void Create(LPCWSTR name); protected: void GetData(DWORD dwOffset, LPVOID lpData, DWORD cbData); @@ -1543,7 +1520,7 @@ inline void CEUDCSegTable::GetData(DWORD dwOffset, DASSERT(dwRead == cbData); } -void CEUDCSegTable::Create(LPWSTR name) +void CEUDCSegTable::Create(LPCWSTR name) { typedef struct tagHEAD{ FIXED sfnt_version; @@ -1564,19 +1541,8 @@ typedef struct tagENTRY{ // create EUDC font file and make EUDCSegTable // after wrapper function for CreateFileW, we use only CreateFileW - if (IS_NT) { - m_hTmpFile = ::CreateFileW(name, GENERIC_READ, - FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - } else { -#ifdef WIN32 - DASSERT(IS_WIN95); -#endif - char szFileName[_MAX_PATH]; - ::WideCharToMultiByte(CP_ACP, 0, name, -1, - szFileName, sizeof(szFileName), NULL, NULL); - m_hTmpFile = ::CreateFileA(szFileName, GENERIC_READ, - FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - } + m_hTmpFile = ::CreateFile(name, GENERIC_READ, + FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (m_hTmpFile == INVALID_HANDLE_VALUE){ m_hTmpFile = NULL; return; @@ -1654,10 +1620,10 @@ void CSegTableManagerComponent::MakeBiggerTable() class CSegTableManager : public CSegTableManagerComponent { public: - CSegTable* GetTable(LPWSTR lpszFontName, BOOL fEUDC); + CSegTable* GetTable(LPCWSTR lpszFontName, BOOL fEUDC); }; -CSegTable* CSegTableManager::GetTable(LPWSTR lpszFontName, BOOL fEUDC) +CSegTable* CSegTableManager::GetTable(LPCWSTR lpszFontName, BOOL fEUDC) { for (int i = 0; i < m_nTable; i++) { if ((((CSegTable*)m_tables[i])->IsEUDC() == fEUDC) && @@ -1685,7 +1651,7 @@ class CCombinedSegTable : public CSegTableComponent { public: CCombinedSegTable(); - void Create(LPWSTR name); + void Create(LPCWSTR name); BOOL In(USHORT iChar); private: @@ -1807,7 +1773,7 @@ void CCombinedSegTable::GetEUDCFileName(LPWSTR lpszFileName, int cchFileName) wcscpy(m_szDefaultEUDCFile, lpszFileName); } -void CCombinedSegTable::Create(LPWSTR name) +void CCombinedSegTable::Create(LPCWSTR name) { CSegTableComponent::Create(name); @@ -1840,10 +1806,10 @@ BOOL CCombinedSegTable::In(USHORT iChar) class CCombinedSegTableManager : public CSegTableManagerComponent { public: - CCombinedSegTable* GetTable(LPWSTR lpszFontName); + CCombinedSegTable* GetTable(LPCWSTR lpszFontName); }; -CCombinedSegTable* CCombinedSegTableManager::GetTable(LPWSTR lpszFontName) +CCombinedSegTable* CCombinedSegTableManager::GetTable(LPCWSTR lpszFontName) { for (int i = 0; i < m_nTable; i++) { if (wcscmp(m_tables[i]->GetFontName(),lpszFontName) == 0) @@ -1901,8 +1867,9 @@ Java_sun_awt_windows_WDefaultFontCharset_canConvert(JNIEnv *env, jobject self, jstring fontName = (jstring)env->GetObjectField(self, AwtFont::fontNameID); DASSERT(fontName != NULL); - LPWSTR fontNameWStr = TO_WSTRING(fontName); - CCombinedSegTable* pTable = tableManager.GetTable(fontNameWStr); + LPCWSTR fontNameW = JNU_GetStringPlatformChars(env, fontName, NULL); + CCombinedSegTable* pTable = tableManager.GetTable(fontNameW); + JNU_ReleaseStringPlatformChars(env, fontName, fontNameW); return (pTable->In((USHORT) ch) ? JNI_TRUE : JNI_FALSE); CATCH_BAD_ALLOC_RET(FALSE); diff --git a/jdk/src/windows/native/sun/windows/awt_Font.h b/jdk/src/windows/native/sun/windows/awt_Font.h index c1edd9d0eab..ac537a122b0 100644 --- a/jdk/src/windows/native/sun/windows/awt_Font.h +++ b/jdk/src/windows/native/sun/windows/awt_Font.h @@ -28,7 +28,6 @@ #include "awt.h" #include "awt_Object.h" -#include "awt_Unicode.h" #include "java_awt_Font.h" #include "sun_awt_windows_WFontMetrics.h" diff --git a/jdk/src/windows/native/sun/windows/awt_Frame.cpp b/jdk/src/windows/native/sun/windows/awt_Frame.cpp index 37e8546ed49..60738e69357 100644 --- a/jdk/src/windows/native/sun/windows/awt_Frame.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Frame.cpp @@ -1472,7 +1472,7 @@ void AwtFrame::_SetIMMOption(void *param) int badAlloc = 0; LPCTSTR coption; - LPTSTR empty = TEXT("InputMethod"); + LPCTSTR empty = TEXT("InputMethod"); AwtFrame *f = NULL; PDATA pData; diff --git a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp index ff944b0e8e7..bd78cdaf3ef 100644 --- a/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp +++ b/jdk/src/windows/native/sun/windows/awt_InputMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -580,18 +580,10 @@ HKL getDefaultKeyboardLayout() { DWORD cbHKL = 16; LPTSTR end; - if (IS_NT) { - ret = ::RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Keyboard Layout\\Preload"), NULL, KEY_READ, &hKey); - } else { - ret = ::RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("keyboard layout\\preload\\1"), NULL, KEY_READ, &hKey); - } + ret = ::RegOpenKeyEx(HKEY_CURRENT_USER, TEXT("Keyboard Layout\\Preload"), NULL, KEY_READ, &hKey); if (ret == ERROR_SUCCESS) { - if (IS_NT) { - ret = ::RegQueryValueEx(hKey, TEXT("1"), 0, 0, szHKL, &cbHKL); - } else { - ret = ::RegQueryValueEx(hKey, NULL, 0, 0, szHKL, &cbHKL); - } + ret = ::RegQueryValueEx(hKey, TEXT("1"), 0, 0, szHKL, &cbHKL); if (ret == ERROR_SUCCESS) { hkl = reinterpret_cast(static_cast( diff --git a/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp b/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp index 82f54a4ead8..3c26fbb95d0 100644 --- a/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp +++ b/jdk/src/windows/native/sun/windows/awt_InputTextInfor.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -22,10 +22,9 @@ * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ -#include -#include -#include + #include "awt.h" +#include #include "awt_Component.h" #include "awt_InputTextInfor.h" @@ -91,12 +90,12 @@ AwtInputTextInfor::GetContextData(HIMC hIMC, const LPARAM flags) { LONG cbData[5] = {0}; LPVOID lpData[5] = {NULL}; for (int i = startIndex, j = 0; i <= endIndex; i++, j++) { - cbData[j] = ImmGetCompositionStringW(hIMC, GCS_INDEX[i], NULL, 0); + cbData[j] = ::ImmGetCompositionString(hIMC, GCS_INDEX[i], NULL, 0); if (cbData[j] == 0) { lpData[j] = NULL; } else { LPBYTE lpTemp = new BYTE[cbData[j]]; - cbData[j] = ImmGetCompositionStringW(hIMC, GCS_INDEX[i], lpTemp, cbData[j]); + cbData[j] = ::ImmGetCompositionString(hIMC, GCS_INDEX[i], lpTemp, cbData[j]); if (IMM_ERROR_GENERAL != cbData[j]) { lpData[j] = (LPVOID)lpTemp; } else { @@ -126,7 +125,7 @@ AwtInputTextInfor::GetContextData(HIMC hIMC, const LPARAM flags) { // Get the cursor position if (flags & GCS_COMPSTR) { - m_cursorPosW = ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, + m_cursorPosW = ::ImmGetCompositionString(hIMC, GCS_CURSORPOS, NULL, 0); } @@ -185,9 +184,11 @@ AwtInputTextInfor::~AwtInputTextInfor() { jstring AwtInputTextInfor::MakeJavaString(JNIEnv* env, LPWSTR lpStrW, int cStrW) { - if (env == NULL || lpStrW == NULL || cStrW == 0) return NULL; - - return env->NewString(lpStrW, cStrW); + if (env == NULL || lpStrW == NULL || cStrW == 0) { + return NULL; + } else { + return env->NewString(reinterpret_cast(lpStrW), cStrW); + } } // @@ -232,7 +233,7 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla LCID lcJPN = MAKELCID(MAKELANGID(LANG_JAPANESE,SUBLANG_DEFAULT),SORT_DEFAULT); // Reading string is given in half width katakana in Japanese Windows // Convert it to full width katakana. - int cFWStrW = LCMapStringW( lcJPN, LCMAP_FULLWIDTH, lpHWStrW, cHWStrW, NULL, 0 ); + int cFWStrW = ::LCMapString(lcJPN, LCMAP_FULLWIDTH, lpHWStrW, cHWStrW, NULL, 0); LPWSTR lpFWStrW; try { lpFWStrW = new WCHAR[cFWStrW]; @@ -244,7 +245,7 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla throw; } - LCMapStringW( lcJPN, LCMAP_FULLWIDTH, lpHWStrW, cHWStrW, lpFWStrW, cFWStrW ); + ::LCMapString(lcJPN, LCMAP_FULLWIDTH, lpHWStrW, cHWStrW, lpFWStrW, cFWStrW); readingClauseW[cls] = MakeJavaString(env, lpFWStrW, cFWStrW); delete [] lpFWStrW; } else { @@ -252,7 +253,7 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla } } else { - readingClauseW[cls] = MakeJavaString(env, (LPWSTR)NULL, 0); + readingClauseW[cls] = NULL; } } diff --git a/jdk/src/windows/native/sun/windows/awt_List.cpp b/jdk/src/windows/native/sun/windows/awt_List.cpp index 9000aaa685a..20844de7875 100644 --- a/jdk/src/windows/native/sun/windows/awt_List.cpp +++ b/jdk/src/windows/native/sun/windows/awt_List.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -27,7 +27,6 @@ #include "awt_KeyboardFocusManager.h" #include "awt_Canvas.h" #include "awt_Dimension.h" -#include "awt_Unicode.h" #include "awt_Toolkit.h" #include "awt_Window.h" @@ -112,9 +111,8 @@ AwtList* AwtList::Create(jobject peer, jobject parent) DWORD wrapExStyle = 0; DWORD style = WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL | - LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_OWNERDRAWFIXED | - (IS_WIN4X ? 0 : WS_BORDER); - DWORD exStyle = IS_WIN4X ? WS_EX_CLIENTEDGE : 0; + LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_OWNERDRAWFIXED; + DWORD exStyle = WS_EX_CLIENTEDGE; /* * NOTE: WS_VISIBLE is always set for the listbox. Listbox @@ -571,10 +569,10 @@ MsgRouting AwtList::HandleEvent(MSG *msg, BOOL synthetic) // operate WM_PRINT to be compatible with the "smooth scrolling" feature. MsgRouting AwtList::WmPrint(HDC hDC, LPARAM flags) { - if (!isWrapperPrint && IS_WIN4X - && (flags & PRF_CLIENT) - && (GetStyleEx() & WS_EX_CLIENTEDGE)) { - + if (!isWrapperPrint && + (flags & PRF_CLIENT) && + (GetStyleEx() & WS_EX_CLIENTEDGE)) + { int nOriginalDC = ::SaveDC(hDC); DASSERT(nOriginalDC != 0); // Save a copy of the DC for WmPrintClient diff --git a/jdk/src/windows/native/sun/windows/awt_MMStub.cpp b/jdk/src/windows/native/sun/windows/awt_MMStub.cpp deleted file mode 100644 index 675f48e784b..00000000000 --- a/jdk/src/windows/native/sun/windows/awt_MMStub.cpp +++ /dev/null @@ -1,573 +0,0 @@ -/* - * Copyright 1999-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. - */ - -#include "awt_MMStub.h" - -//--------------------------------------------------------------------------- -// Basic API -//--------------------------------------------------------------------------- - -int (WINAPI* g_pfnGetSystemMetrics) (int); -MHND (WINAPI* g_pfnMonitorFromWindow) (HWND,BOOL); -MHND (WINAPI* g_pfnMonitorFromRect) (LPCRECT,BOOL); -MHND (WINAPI* g_pfnMonitorFromPoint) (POINT,BOOL); -BOOL (WINAPI* g_pfnGetMonitorInfo) (MHND,PMONITOR_INFO); -BOOL (WINAPI* g_pfnEnumDisplayMonitors) (HDC,LPCRECT,MON_ENUM_CALLBACK_PROC,LPARAM); -BOOL (WINAPI* g_pfnEnumDisplayDevices) (LPVOID,int,P_DISPLAY_DEVICE,DWORD); - -BOOL __initMultipleMonitorStubs(void); -BOOL __initMultipleMonitorStubs(void) -{ - static BOOL fInitDone; - HMODULE hUser32; - HMODULE hUnicows = UnicowsLoader::GetModuleHandle(); - BOOL retCode = FALSE; - - if (fInitDone) - { - retCode = g_pfnGetMonitorInfo != NULL; - goto _RET_; - } - - if ((hUser32 = GetModuleHandle(TEXT("USER32"))) && - (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) && - (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) && - (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) && - (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) && - (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) && - (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(IS_WIN95 ? hUnicows : hUser32,"GetMonitorInfoW")) && - (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(IS_WIN95 ? hUnicows : hUser32,"EnumDisplayDevicesW")) && - (GetSystemMetrics(SM_CXVSCREEN) >= GetSystemMetrics(SM_CXSCREEN)) && - (GetSystemMetrics(SM_CYVSCREEN) >= GetSystemMetrics(SM_CYSCREEN)) ) - { - fInitDone = TRUE; - retCode = TRUE; - goto _RET_; - } - g_pfnGetSystemMetrics = NULL; - g_pfnMonitorFromWindow = NULL; - g_pfnMonitorFromRect = NULL; - g_pfnMonitorFromPoint = NULL; - g_pfnGetMonitorInfo = NULL; - g_pfnEnumDisplayMonitors = NULL; - g_pfnEnumDisplayDevices = NULL; - - fInitDone = TRUE; - retCode = FALSE; - -_RET_: - return retCode; -} - -int WINAPI _getSystemMetrics(int nCode) -{ - int retCode; - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnGetSystemMetrics(nCode); - goto _RET_; - } - - switch( nCode ) - { - case SM_CMONITORS: - case SM_SAMEDSPLFORMAT: - return 1; - - case SM_XVSCREEN: - case SM_YVSCREEN: - return 0; - - case SM_CXVSCREEN: - nCode = SM_CXSCREEN; - break; - - case SM_CYVSCREEN: - nCode = SM_CYSCREEN; - break; - } - - retCode = GetSystemMetrics(nCode); -_RET_: - return retCode; -} - - -MHND WINAPI _monitorFromRect(LPCRECT prScreen, UINT nFlags) -{ - MHND retCode = NULL; - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnMonitorFromRect(prScreen, nFlags); - goto _RET_; - } - - if( (prScreen->right < 0) || (prScreen->bottom < 0) ) - { - goto _RET_; - } - { - POINT pP = {0,0}; - - pP.x = prScreen->left; - pP.y = prScreen->top; - - retCode = _monitorFromPoint(pP,nFlags); - } - -_RET_: - return retCode; -} - -MHND WINAPI _monitorFromWindow(HWND hwProbe, UINT nFlags) -{ - RECT rR; - MHND retCode = NULL; - - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnMonitorFromWindow(hwProbe, nFlags); - goto _RET_; - } - - if( nFlags & (MONITOR_DEFAULT_TO_PRIMARY | MONITOR_DEFAULT_TO_NEAR) ) - { - retCode = PRIMARY_MONITOR; - goto _RET_; - } - - if( GetWindowRect(hwProbe, &rR) ) - { - retCode = _monitorFromRect(&rR, nFlags); - goto _RET_; - } - -_RET_: - return retCode; -} - -MHND WINAPI _monitorFromPoint(POINT ptProbe, UINT nFlags) -{ - MHND retCode = NULL; - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnMonitorFromPoint(ptProbe,nFlags); - goto _RET_; - } - - if( nFlags & (MONITOR_DEFAULT_TO_PRIMARY | MONITOR_DEFAULT_TO_NEAR) ) - { - goto _ASSIGN_; - } - - if( (ptProbe.x <= 0) || (ptProbe.x > GetSystemMetrics(SM_CXSCREEN)) ) - { - goto _RET_; - } - - if( (ptProbe.y <= 0) || (ptProbe.y < GetSystemMetrics(SM_CYSCREEN)) ) - { - goto _RET_; - } -_ASSIGN_: - retCode = PRIMARY_MONITOR; - -_RET_: - return retCode; -} - -BOOL WINAPI _getMonitorInfo(MHND mhMon, PMONITOR_INFO pmMonInfo) -{ - RECT rArea; - BOOL retCode = FALSE; - - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnGetMonitorInfo(mhMon, pmMonInfo); - goto _RET_; - } - - if( mhMon != PRIMARY_MONITOR ) - { - goto _RET_; - } - - if( NULL == pmMonInfo ) - { - goto _RET_; - } - - if( FALSE == SystemParametersInfo(SPI_GETWORKAREA,0,&rArea,0) ) - { - goto _RET_; - } - - if( pmMonInfo->dwSize >= sizeof(MONITOR_INFO) ) - { - pmMonInfo->rMonitor.left = 0; - pmMonInfo->rMonitor.top = 0; - pmMonInfo->rMonitor.right = GetSystemMetrics(SM_CXSCREEN); - pmMonInfo->rMonitor.bottom = GetSystemMetrics(SM_CYSCREEN); - pmMonInfo->rWork = rArea; - pmMonInfo->dwFlags = MONITOR_INFO_FLAG_PRIMARY; - - if( pmMonInfo->dwSize >= sizeof(MONITOR_INFO_EXTENDED)) - { - lstrcpy(((PMONITOR_INFO_EXTENDED)pmMonInfo)->strDevice, - TEXT("DISPLAY") ); - } - - retCode = TRUE; - } - -_RET_: - return retCode; -} - -BOOL WINAPI _enumDisplayMonitors( - HDC hDC,LPCRECT lrcSect, - MON_ENUM_CALLBACK_PROC lpfnEnumProc, - LPARAM lData - ) -{ - BOOL retCode = FALSE; - RECT rToPass = {0,0,0,0}; - RECT rBorder = {0,0,0,0}; - - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnEnumDisplayMonitors ( - hDC, lrcSect, - lpfnEnumProc,lData - ); - goto _RET_; - } - - if( !lpfnEnumProc ) - { - goto _RET_; - } - - rBorder.left = 0; - rBorder.top = 0; - rBorder.right = GetSystemMetrics(SM_CXSCREEN); - rBorder.bottom = GetSystemMetrics(SM_CYSCREEN); - - if( hDC ) - { - RECT rSect = {0,0,0,0}; - HWND hWnd = NULL; - - if( NULL == (hWnd = WindowFromDC(hDC)) ) - { - goto _RET_; - } - - switch( GetClipBox(hDC,&rSect) ) - { - case NULLREGION: - goto _ASSIGN_; - case ERROR: - goto _RET_; - default: - MapWindowPoints(NULL, hWnd, (LPPOINT)&rBorder, 2); - if( TRUE == IntersectRect(&rToPass,&rSect,&rBorder) ) - { - break; - } - } - - rBorder = rToPass; - } - - if( (NULL == lrcSect) || (TRUE == IntersectRect(&rToPass,lrcSect,&rBorder)) ) - { - lpfnEnumProc(PRIMARY_MONITOR,hDC,&rToPass,lData); - } -_ASSIGN_: - retCode = TRUE; -_RET_: - return retCode; -} - -BOOL WINAPI _enumDisplayDevices ( - LPVOID lpReserved, int iDeviceNum, - _DISPLAY_DEVICE * pDisplayDevice, DWORD dwFlags - ) -{ - BOOL retCode = FALSE; - if( __initMultipleMonitorStubs() ) - { - retCode = g_pfnEnumDisplayDevices(lpReserved,iDeviceNum,pDisplayDevice,dwFlags); - } - - return retCode; -} - - -//--------------------------------------------------------------------------- -// Extended API. -//--------------------------------------------------------------------------- -// Globais -int g_nMonitorCounter; -int g_nMonitorLimit; -MHND* g_hmpMonitors; -// Callbacks -BOOL WINAPI clb_fCountMonitors(MHND,HDC,LPRECT,LPARAM); -BOOL WINAPI clb_fCountMonitors(MHND hMon,HDC hDC,LPRECT rRect,LPARAM lP) -{ - g_nMonitorCounter ++; - return TRUE; -} -BOOL WINAPI clb_fCollectMonitors(MHND,HDC,LPRECT,LPARAM); -BOOL WINAPI clb_fCollectMonitors(MHND hMon,HDC hDC,LPRECT rRect,LPARAM lP) -{ - - if( (g_nMonitorCounter < g_nMonitorLimit) && (NULL != g_hmpMonitors) ) - { - g_hmpMonitors[g_nMonitorCounter] = hMon; - g_nMonitorCounter ++; - } - - return TRUE; -} -// Tools -void __normaRectPos(RECT*,RECT,RECT); -HWND __createWindow0(MHND,LPCTSTR,LPCTSTR,DWORD,int,int,int,int,HWND,HMENU,HANDLE,LPVOID); -HWND __createWindow1(MHND,LPCTSTR,LPCTSTR,DWORD,int,int,int,int,HWND,HMENU,HANDLE,LPVOID); -void __normaRectPos(RECT* rDest,RECT rSrc,RECT rNorma) -{ - int nDX = rSrc.right - rSrc.left; - int nDY = rSrc.bottom - rSrc.top; - - rDest->left = rSrc.left + rNorma.left; - rDest->top = rSrc.top + rNorma.top; - - rDest->right = rDest->left + nDX; - rDest->bottom = rDest->top + nDY; -} -HWND __createWindow0( MHND hmMonitor,LPCTSTR lpClassName,LPCTSTR lpWindowName, - DWORD dwStyle,int x,int y,int nWidth, - int nHeight,HWND hWndParent,HMENU hMenu, - HANDLE hInstance,LPVOID lpParam ) -{ - HWND retCode = NULL; - - if( (NULL != hmMonitor) && (NULL != lpClassName) && - (NULL != lpWindowName) && (NULL != hInstance) ) - { - RECT rRW = {0,0,0,0}; - RECT rRM = {0,0,0,0}; - RECT rSect = {0,0,0,0}; - - SetRect(&rRW,x,y,x+nWidth,y+nHeight); - - if( TRUE == _monitorBounds(hmMonitor,&rRM) ) - { - __normaRectPos(&rRW,rRW,rRM); - - IntersectRect(&rSect,&rRM,&rRW); - - if( TRUE == EqualRect(&rSect,&rRW) ) - { - x = rSect.left; - y = rSect.top; - nWidth = rSect.right - rSect.left; - nHeight = rSect.bottom - rSect.top; - retCode = CreateWindow( - lpClassName,lpWindowName, - dwStyle,x,y,nWidth, - nHeight,hWndParent,hMenu, - (HINSTANCE)hInstance,lpParam - ); - } else { - // A coisa indefinida. Nao tenho sabdoria o que - // fazer aqui mesmo - // E necessario perguntar Jeannette - } - } - } - - return retCode; -} -HWND __createWindow1( MHND hmMonitor,LPCTSTR lpClassName,LPCTSTR lpWindowName, - DWORD dwStyle,int x,int y,int nWidth, - int nHeight,HWND hWndParent,HMENU hMenu, - HANDLE hInstance,LPVOID lpParam ) -{ - HWND retCode = NULL; - - if( (NULL != hmMonitor) && (NULL != lpClassName) && - (NULL != lpWindowName) && (NULL != hInstance) ) - { - RECT rRM = {0,0,0,0}; - - if( TRUE == _monitorBounds(hmMonitor,&rRM) ) - { - HWND wW = NULL; - BOOL wasVisible = (0 != (dwStyle & WS_VISIBLE)); - - if( TRUE == wasVisible ) - { - dwStyle &= ~WS_VISIBLE; - } - - if( NULL != (wW = CreateWindow( - lpClassName,lpWindowName, - dwStyle,x,y,nWidth, - nHeight,hWndParent,hMenu, - (HINSTANCE)hInstance,lpParam - )) ) - { - RECT rRW = {0,0,0,0}; - RECT rSect = {0,0,0,0}; - - GetWindowRect(wW,&rRW); - - __normaRectPos(&rRW,rRW,rRM); - - IntersectRect(&rSect,&rRM,&rRW); - - if( TRUE == EqualRect(&rSect,&rRW) ) - { - x = rSect.left; - y = rSect.top; - nWidth = rSect.right - rSect.left; - nHeight = rSect.bottom - rSect.top; - - MoveWindow(wW,x,y,nWidth,nHeight,FALSE); - - if( TRUE == wasVisible ) - { - UpdateWindow(wW); - ShowWindow(wW,SW_SHOW); - } - - retCode = wW; - } else { - // A coisa indefinida. Nao sei o que - // fazer aqui. E necessario perguntar Jeannette - DestroyWindow(wW); - } - } - } - } - - return retCode; -} - -// Implementations -int WINAPI _countMonitors(void) -{ - g_nMonitorCounter = 0; - - _enumDisplayMonitors(NULL,NULL,clb_fCountMonitors,0L); - - return g_nMonitorCounter; - -} -int WINAPI _collectMonitors(MHND* hmpMonitors,int nNum) -{ - int retCode = 0; - - if( NULL != hmpMonitors ) - { - g_nMonitorCounter = 0; - g_nMonitorLimit = nNum; - g_hmpMonitors = hmpMonitors; - - _enumDisplayMonitors(NULL,NULL,clb_fCollectMonitors,0L); - - retCode = g_nMonitorCounter; - - g_nMonitorCounter = 0; - g_nMonitorLimit = 0; - g_hmpMonitors = NULL; - - } - return retCode; -} -BOOL WINAPI _monitorBounds(MHND hmMonitor,RECT* rpBounds) -{ - BOOL retCode = FALSE; - - if( (NULL != hmMonitor) && (NULL != rpBounds) ) - { - MONITOR_INFO miInfo; - - memset((void*)(&miInfo),0,sizeof(MONITOR_INFO)); - miInfo.dwSize = sizeof(MONITOR_INFO); - - if( TRUE == (retCode = _getMonitorInfo(hmMonitor,&(miInfo))) ) - { - (*rpBounds) = miInfo.rMonitor; - } - } - return retCode; -} - -HDC WINAPI _makeDCFromMonitor(MHND hmMonitor) { - HDC retCode = NULL; - - if( NULL != hmMonitor ) { - - MONITOR_INFO_EXTENDED mieInfo; - - memset((void*)(&mieInfo),0,sizeof(MONITOR_INFO_EXTENDED)); - mieInfo.dwSize = sizeof(MONITOR_INFO_EXTENDED); - - if( TRUE == _getMonitorInfo(hmMonitor,(PMONITOR_INFO)(&mieInfo)) ) { - HDC hDC = CreateDC(mieInfo.strDevice,NULL,NULL,NULL); - - if( NULL != hDC ) { - retCode = hDC; - } - } - } - return retCode; -} - -HWND WINAPI _createWindowOM( MHND hmMonitor,LPCTSTR lpClassName,LPCTSTR lpWindowName, - DWORD dwStyle,int x,int y,int nWidth, - int nHeight,HWND hWndParent,HMENU hMenu, - HANDLE hInstance,LPVOID lpParam ) -{ - if( (CW_USEDEFAULT == x) || (CW_USEDEFAULT == y) || - (CW_USEDEFAULT == nWidth) || (CW_USEDEFAULT == nHeight) ) - { - return __createWindow1 ( - hmMonitor,lpClassName,lpWindowName, - dwStyle,x,y,nWidth, - nHeight,hWndParent,hMenu, - hInstance,lpParam - ); - } - return __createWindow0 ( - hmMonitor,lpClassName,lpWindowName, - dwStyle,x,y,nWidth, - nHeight,hWndParent,hMenu, - hInstance,lpParam - ); -} diff --git a/jdk/src/windows/native/sun/windows/awt_MMStub.h b/jdk/src/windows/native/sun/windows/awt_MMStub.h deleted file mode 100644 index ec73dd74f37..00000000000 --- a/jdk/src/windows/native/sun/windows/awt_MMStub.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 1999-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. - */ -#ifndef _INC_MMSTUB -#define _INC_MMSTUB - -#ifndef _WINDOWS_ -#include "windows.h" -#endif - -#ifndef _AWT_H_ -#include "awt.h" -#endif - -#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) - -/* Cdecl for C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* Constants */ -#define SM_XVSCREEN 76 -#define SM_YVSCREEN 77 -#define SM_CXVSCREEN 78 -#define SM_CYVSCREEN 79 -#define SM_CMONITORS 80 -#define SM_SAMEDSPLFORMAT 81 - -#define MONITOR_DEFAULT_TO_NULL 0x00000000 -#define MONITOR_DEFAULT_TO_PRIMARY 0x00000001 -#define MONITOR_DEFAULT_TO_NEAR 0x00000002 - - - -#define MONITOR_INFO_FLAG_PRIMARY 0x00000001 - -#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 -#define DISPLAY_DEVICE_MULTY_DRIVER 0x00000002 -#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 -#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 - - -#define DISPLAY_DEVICE_VGA 0x00000010 - -#define ENUM_CURRENT_SETTINGS ((DWORD)-1) -#define ENUM_REGISTRY_SETTINGS ((DWORD)-2) - -#define PRIMARY_MONITOR ((MHND)0x42) - - -#define DEV_NAME_LEN 32 -#define DEV_STR_LEN 128 - - -// Datatypes -typedef HANDLE MHND; -typedef BOOL (CALLBACK* MON_ENUM_CALLBACK_PROC)(MHND,HDC,LPRECT,LPARAM); - -typedef struct tagMONITOR_INFO -{ - DWORD dwSize; - RECT rMonitor; - RECT rWork; - DWORD dwFlags; -} MONITOR_INFO, *PMONITOR_INFO; - -typedef struct tagMONITOR_INFO_EXTENDED -{ - DWORD dwSize; - RECT rMonitor; - RECT rWork; - DWORD dwFlags; - TCHAR strDevice[DEV_NAME_LEN]; -} MONITOR_INFO_EXTENDED, *PMONITOR_INFO_EXTENDED; - -typedef struct tagDISPLAY_DEVICE -{ - DWORD dwSize; - WCHAR strDevName[DEV_NAME_LEN]; - WCHAR strDevString[DEV_STR_LEN]; - DWORD dwFlags; - WCHAR deviceID[128]; - WCHAR deviceKey[128]; -} _DISPLAY_DEVICE, *P_DISPLAY_DEVICE; - -/* Basic API's */ -BOOL WINAPI _enumDisplayMonitors(HDC,LPCRECT,MON_ENUM_CALLBACK_PROC,LPARAM); -BOOL WINAPI _enumDisplayDevices (LPVOID,int,P_DISPLAY_DEVICE,DWORD); -BOOL WINAPI _getMonitorInfo (MHND,PMONITOR_INFO); -MHND WINAPI _monitorFromPoint (POINT,UINT); -MHND WINAPI _monitorFromWindow (HWND,UINT); -MHND WINAPI _monitorFromRect (LPCRECT,UINT); -int WINAPI _getSystemMetrics (int); - -/* Additional API's */ -int WINAPI _countMonitors (void); -int WINAPI _collectMonitors (MHND*,int); -BOOL WINAPI _monitorBounds (MHND,RECT*); -HDC WINAPI _makeDCFromMonitor (MHND); -HWND WINAPI _createWindowOM (MHND,LPCTSTR,LPCTSTR,DWORD,int,int,int, - int,HWND,HMENU,HANDLE,LPVOID); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) */ - -#endif /* _INC_MMSTUB */ diff --git a/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp b/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp index 626b3a31368..51fc47718cb 100644 --- a/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp +++ b/jdk/src/windows/native/sun/windows/awt_MenuItem.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -23,6 +23,7 @@ * have any questions. */ +#include "awt.h" #include "awt_MenuItem.h" #include "awt_Menu.h" #include "awt_MenuBar.h" @@ -70,7 +71,6 @@ jmethodID AwtMenuItem::getDefaultFontMID; LANGID AwtMenuItem::m_idLang = LOWORD(GetKeyboardLayout(0)); UINT AwtMenuItem::m_CodePage = AwtMenuItem::LangToCodePage(AwtMenuItem::m_idLang); -BOOL AwtMenuItem::m_isWin95 = IS_WIN95; BOOL AwtMenuItem::sm_rtl = PRIMARYLANGID(GetInputLanguage()) == LANG_ARABIC || PRIMARYLANGID(GetInputLanguage()) == LANG_HEBREW; BOOL AwtMenuItem::sm_rtlReadingOrder = @@ -150,7 +150,7 @@ BOOL AwtMenuItem::CheckMenuCreation(JNIEnv *env, jobject self, HMENU hMenu) jobject createError = NULL; if (dw == ERROR_OUTOFMEMORY) { - jstring errorMsg = env->NewStringUTF("too many menu handles"); + jstring errorMsg = JNU_NewStringPlatform(env, L"too many menu handles"); createError = JNU_NewObjectByName(env, "java/lang/OutOfMemoryError", "(Ljava/lang/String;)V", errorMsg); @@ -435,16 +435,7 @@ void AwtMenuItem::DrawItem(DRAWITEMSTRUCT& drawInfo) if (drawInfo.itemID != m_Id) return; - /* Fixed bug 4349969. Since the problem occurs on Windows 98 and not on - Windows NT, the fix is to check for Windows 95/98 and to check if the - handle to the menu of the item to be drawn is the same as the handle to the - menu of the menu object. If they're not the same, just return and don't do - the drawing. - */ - if ( IS_WIN95 && drawInfo.hwndItem != (HWND)this->m_menuContainer->GetHMenu()) { - return; - } else - DrawSelf(drawInfo); + DrawSelf(drawInfo); } void AwtMenuItem::MeasureSelf(HDC hDC, MEASUREITEMSTRUCT& measureInfo) @@ -802,8 +793,9 @@ BOOL AwtMenuItem::IsSeparator() { jobject jitem = GetTarget(env); jstring label = (jstring)(env)->GetObjectField(jitem, AwtMenuItem::labelID); - LPWSTR labelW = TO_WSTRING(label); + LPCWSTR labelW = JNU_GetStringPlatformChars(env, label, NULL); BOOL isSeparator = (labelW && (wcscmp(labelW, L"-") == 0)); + JNU_ReleaseStringPlatformChars(env, label, labelW); env->DeleteLocalRef(label); env->DeleteLocalRef(jitem); diff --git a/jdk/src/windows/native/sun/windows/awt_Multimon.h b/jdk/src/windows/native/sun/windows/awt_Multimon.h deleted file mode 100644 index f2b371e3499..00000000000 --- a/jdk/src/windows/native/sun/windows/awt_Multimon.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. - * 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 _INC_MULTIMON_ -#define _INC_MULTIMON_ -#endif -// -// build defines that replace the regular APIs with our versions -// -#undef GetMonitorInfo -#undef GetSystemMetrics -#undef MonitorFromWindow -#undef MonitorFromRect -#undef MonitorFromPoint -#undef EnumDisplayMonitors -#undef EnumDisplayDevices - -#include "awt_MMStub.h" - -#define GetSystemMetricsMM _getSystemMetrics -#define MonitorFromWindow _monitorFromWindow -#define MonitorFromRect _monitorFromRect -#define MonitorFromPoint _monitorFromPoint -#define GetMonitorInfo _getMonitorInfo -#define EnumDisplayMonitors _enumDisplayMonitors -#define EnumDisplayDevices _enumDisplayDevices - - -#define CountMonitors _countMonitors -#define CollectMonitors _collectMonitors -#define MonitorBounds _monitorBounds -#define MakeDCFromMonitor _makeDCFromMonitor -#define CreateWindowOnMonitor _createWindowOM diff --git a/jdk/src/windows/native/sun/windows/awt_Object.cpp b/jdk/src/windows/native/sun/windows/awt_Object.cpp index aab7e98b502..b6b999be2a7 100644 --- a/jdk/src/windows/native/sun/windows/awt_Object.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Object.cpp @@ -25,9 +25,6 @@ #include "awt_Object.h" #include "ObjectList.h" -#ifdef DEBUG -#include "awt_Unicode.h" -#endif #ifdef DEBUG static BOOL reportEvents = FALSE; @@ -116,8 +113,9 @@ AwtObject::DoCallback(const char* methodName, const char* methodSig, ...) "getName", "()Ljava/lang/String;").l; DASSERT(!safe_ExceptionOccurred(env)); - printf("Posting %s%s method to %S\n", methodName, methodSig, - TO_WSTRING(targetStr)); + LPCWSTR targetStrW = JNU_GetStringPlatformChars(env, targetStr, NULL); + printf("Posting %s%s method to %S\n", methodName, methodSig, targetStrW); + JNU_ReleaseStringPlatformChars(env, targetStr, targetStrW); } #endif /* caching would do much good here */ @@ -148,8 +146,11 @@ void AwtObject::SendEvent(jobject event) (jstring)JNU_CallMethodByName(env, NULL, GetTarget(env),"getName", "()Ljava/lang/String;").l; DASSERT(!safe_ExceptionOccurred(env)); - printf("Posting %S to %S\n", TO_WSTRING(eventStr), - TO_WSTRING(targetStr)); + LPCWSTR eventStrW = JNU_GetStringPlatformChars(env, eventStr, NULL); + LPCWSTR targetStrW = JNU_GetStringPlatformChars(env, targetStr, NULL); + printf("Posting %S to %S\n", eventStrW, targetStrW); + JNU_ReleaseStringPlatformChars(env, eventStr, eventStrW); + JNU_ReleaseStringPlatformChars(env, targetStr, targetStrW); } #endif /* Post event to the system EventQueue. */ diff --git a/jdk/src/windows/native/sun/windows/awt_Palette.cpp b/jdk/src/windows/native/sun/windows/awt_Palette.cpp index ea0488e816f..a567c246d86 100644 --- a/jdk/src/windows/native/sun/windows/awt_Palette.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Palette.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -23,7 +23,7 @@ * have any questions. */ -#include +#include "awt.h" #include "awt_Palette.h" #include "awt_Component.h" #include "img_util_md.h" diff --git a/jdk/src/windows/native/sun/windows/awt_PopupMenu.cpp b/jdk/src/windows/native/sun/windows/awt_PopupMenu.cpp index 8862b86bda7..794277eda24 100644 --- a/jdk/src/windows/native/sun/windows/awt_PopupMenu.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PopupMenu.cpp @@ -234,11 +234,13 @@ void AwtPopupMenu::Enable(BOOL isEnabled) jobject jitem = item->GetTarget(env); BOOL bItemEnabled = isEnabled && (jboolean)env->GetBooleanField(jitem, AwtMenuItem::enabledID); - LPWSTR labelW = TO_WSTRING((jstring)env->GetObjectField(jitem, - AwtMenuItem::labelID)); - if (labelW != NULL && wcscmp(labelW,L"-") != 0) { + jstring labelStr = static_cast(env->GetObjectField(jitem, AwtMenuItem::labelID)); + LPCWSTR labelStrW = JNU_GetStringPlatformChars(env, labelStr, NULL); + if (labelStrW && wcscmp(labelStrW, L"-") != 0) { item->Enable(bItemEnabled); } + JNU_ReleaseStringPlatformChars(env, labelStr, labelStrW); + env->DeleteLocalRef(labelStr); env->DeleteLocalRef(jitem); } env->DeleteLocalRef(target); diff --git a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp index 486d9f66950..cc562ec0056 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintControl.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -108,16 +108,13 @@ BOOL AwtPrintControl::FindPrinter(jstring printerName, LPBYTE pPrinterEnum, { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - BOOL nt = IS_NT; DWORD cReturned = 0; if (pPrinterEnum == NULL) { // Compute size of buffer DWORD cbNeeded = 0; - if (nt) { - ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, + ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 2, NULL, 0, &cbNeeded, &cReturned); - } ::EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 5, NULL, 0, pcbBuf, &cReturned); if (cbNeeded > (*pcbBuf)) { @@ -139,65 +136,63 @@ BOOL AwtPrintControl::FindPrinter(jstring printerName, LPBYTE pPrinterEnum, // doesn't support port searches. So, if the user has specified the // printer name as "LPT1:" (even though this is actually a port // name), we won't find the printer here. - if (nt) { - if (!::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, - NULL, 4, pPrinterEnum, cbBuf, &dummyWord, &cReturned)) { - return FALSE; - } + if (!::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, + NULL, 4, pPrinterEnum, cbBuf, &dummyWord, &cReturned)) { + return FALSE; + } - for (DWORD i = 0; i < cReturned; i++) { - PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *) - (pPrinterEnum + i * sizeof(PRINTER_INFO_4)); - if (info4->pPrinterName != NULL && - _tcsicmp(lpcPrinterName, info4->pPrinterName) == 0) { + for (DWORD i = 0; i < cReturned; i++) { + PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *) + (pPrinterEnum + i * sizeof(PRINTER_INFO_4)); + if (info4->pPrinterName != NULL && + _tcsicmp(lpcPrinterName, info4->pPrinterName) == 0) { - // Fix for BugTraq Id 4281380. - // Get the port name since some drivers may require - // this name to be passed to ::DeviceCapabilities(). - HANDLE hPrinter = NULL; - if (::OpenPrinter(info4->pPrinterName, &hPrinter, NULL)) { - // Fix for BugTraq Id 4286812. - // Some drivers don't support PRINTER_INFO_5. - // In this case we try PRINTER_INFO_2, and if that - // isn't supported as well return NULL port name. - try { - if (AwtPrintControl::IsSupportedLevel(hPrinter, 5)) { - VERIFY(::GetPrinter(hPrinter, 5, pPrinterEnum, cbBuf, - &dummyWord)); - PRINTER_INFO_5 *info5 = (PRINTER_INFO_5 *)pPrinterEnum; - *foundPrinter = info5->pPrinterName; - // pPortName may specify multiple ports. We only want one. - *foundPort = (info5->pPortName != NULL) - ? _tcstok(info5->pPortName, TEXT(",")) : NULL; - } else if (AwtPrintControl::IsSupportedLevel(hPrinter, 2)) { - VERIFY(::GetPrinter(hPrinter, 2, pPrinterEnum, cbBuf, - &dummyWord)); - PRINTER_INFO_2 *info2 = (PRINTER_INFO_2 *)pPrinterEnum; - *foundPrinter = info2->pPrinterName; - // pPortName may specify multiple ports. We only want one. - *foundPort = (info2->pPortName != NULL) - ? _tcstok(info2->pPortName, TEXT(",")) : NULL; - } else { - *foundPrinter = info4->pPrinterName; - // We failed to determine port name for the found printer. - *foundPort = NULL; - } - } catch (std::bad_alloc&) { - VERIFY(::ClosePrinter(hPrinter)); - throw; + // Fix for BugTraq Id 4281380. + // Get the port name since some drivers may require + // this name to be passed to ::DeviceCapabilities(). + HANDLE hPrinter = NULL; + if (::OpenPrinter(info4->pPrinterName, &hPrinter, NULL)) { + // Fix for BugTraq Id 4286812. + // Some drivers don't support PRINTER_INFO_5. + // In this case we try PRINTER_INFO_2, and if that + // isn't supported as well return NULL port name. + try { + if (AwtPrintControl::IsSupportedLevel(hPrinter, 5)) { + VERIFY(::GetPrinter(hPrinter, 5, pPrinterEnum, cbBuf, + &dummyWord)); + PRINTER_INFO_5 *info5 = (PRINTER_INFO_5 *)pPrinterEnum; + *foundPrinter = info5->pPrinterName; + // pPortName may specify multiple ports. We only want one. + *foundPort = (info5->pPortName != NULL) + ? _tcstok(info5->pPortName, TEXT(",")) : NULL; + } else if (AwtPrintControl::IsSupportedLevel(hPrinter, 2)) { + VERIFY(::GetPrinter(hPrinter, 2, pPrinterEnum, cbBuf, + &dummyWord)); + PRINTER_INFO_2 *info2 = (PRINTER_INFO_2 *)pPrinterEnum; + *foundPrinter = info2->pPrinterName; + // pPortName may specify multiple ports. We only want one. + *foundPort = (info2->pPortName != NULL) + ? _tcstok(info2->pPortName, TEXT(",")) : NULL; + } else { + *foundPrinter = info4->pPrinterName; + // We failed to determine port name for the found printer. + *foundPort = NULL; } - + } catch (std::bad_alloc&) { VERIFY(::ClosePrinter(hPrinter)); - - return TRUE; + throw; } - return FALSE; + VERIFY(::ClosePrinter(hPrinter)); + + return TRUE; } + + return FALSE; } } - // We still haven't found the printer, or we're using 95/98. + // We still haven't found the printer, /* or we're using 95/98. */ // PRINTER_INFO_5 supports both printer name and port name, so // we'll test both. On NT, PRINTER_ENUM_LOCAL means just local // printers. This is what we want, because we already tested all @@ -213,28 +208,17 @@ BOOL AwtPrintControl::FindPrinter(jstring printerName, LPBYTE pPrinterEnum, for (DWORD i = 0; i < cReturned; i++) { PRINTER_INFO_5 *info5 = (PRINTER_INFO_5 *) (pPrinterEnum + i * sizeof(PRINTER_INFO_5)); - if (nt) { - // pPortName can specify multiple ports. Test them one at - // a time. - if (info5->pPortName != NULL) { - LPTSTR port = _tcstok(info5->pPortName, TEXT(",")); - while (port != NULL) { - if (_tcsicmp(lpcPrinterName, port) == 0) { - *foundPrinter = info5->pPrinterName; - *foundPort = port; - return TRUE; - } - port = _tcstok(NULL, TEXT(",")); + // pPortName can specify multiple ports. Test them one at + // a time. + if (info5->pPortName != NULL) { + LPTSTR port = _tcstok(info5->pPortName, TEXT(",")); + while (port != NULL) { + if (_tcsicmp(lpcPrinterName, port) == 0) { + *foundPrinter = info5->pPrinterName; + *foundPort = port; + return TRUE; } - } - } else { - if ((info5->pPrinterName != NULL && - _tcsicmp(lpcPrinterName, info5->pPrinterName) == 0) || - (info5->pPortName != NULL && - _tcsicmp(lpcPrinterName, info5->pPortName) == 0)) { - *foundPrinter = info5->pPrinterName; - *foundPort = info5->pPortName; - return TRUE; + port = _tcstok(NULL, TEXT(",")); } } } @@ -400,13 +384,11 @@ BOOL AwtPrintControl::CreateDevModeAndDevNames(PRINTDLG *ppd, } // Create DEVNAMES. - if (IS_NT) { - if (pPortName != NULL) { - info2->pPortName = pPortName; - } else if (info2->pPortName != NULL) { - // pPortName may specify multiple ports. We only want one. - info2->pPortName = _tcstok(info2->pPortName, TEXT(",")); - } + if (pPortName != NULL) { + info2->pPortName = pPortName; + } else if (info2->pPortName != NULL) { + // pPortName may specify multiple ports. We only want one. + info2->pPortName = _tcstok(info2->pPortName, TEXT(",")); } size_t lenDriverName = ((info2->pDriverName != NULL) diff --git a/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp b/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp index d9e738411ae..762ae2673eb 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintDialog.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -23,10 +23,10 @@ * have any questions. */ +#include "awt.h" #include "awt_PrintDialog.h" #include "awt_Dialog.h" #include "awt_PrintControl.h" -#include "awt_dlls.h" #include "awt_Window.h" #include "ComCtl32Util.h" #include @@ -39,11 +39,9 @@ jmethodID AwtPrintDialog::setHWndMID; BOOL AwtPrintDialog::PrintDlg(LPPRINTDLG data) { - AwtCommDialog::load_comdlg_procs(); return static_cast(reinterpret_cast( AwtToolkit::GetInstance().InvokeFunction( - reinterpret_cast(AwtCommDialog::PrintDlgWrapper), - data))); + reinterpret_cast(::PrintDlg), data))); } LRESULT CALLBACK PrintDialogWndProc(HWND hWnd, UINT message, diff --git a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp index 5d15e72540a..9136b786412 100644 --- a/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp +++ b/jdk/src/windows/native/sun/windows/awt_PrintJob.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -23,6 +23,7 @@ * have any questions. */ +#include "awt.h" #include #include #include @@ -30,10 +31,9 @@ #include #include -#include "awt.h" -#include "awt_dlls.h" #include "awt_Toolkit.h" #include "awt_Component.h" +#include "awt_Dialog.h" #include "awt_Font.h" #include "awt_PrintDialog.h" #include "awt_PrintControl.h" @@ -422,7 +422,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer) */ if (AwtPrintControl::getPrintHDMode(env, self) == NULL || AwtPrintControl::getPrintHDName(env,self) == NULL) { - (void)AwtCommDialog::PageSetupDlg(&setup); + (void)::PageSetupDlg(&setup); /* check if hDevMode and hDevNames are set. * If both are null, then there is no default printer. */ @@ -460,7 +460,7 @@ Java_sun_awt_windows_WPageDialogPeer__1show(JNIEnv *env, jobject peer) AwtDialog::CheckInstallModalHook(); - BOOL ret = AwtCommDialog::PageSetupDlg(&setup); + BOOL ret = ::PageSetupDlg(&setup); if (ret) { jobject paper = getPaper(env, page); @@ -632,7 +632,9 @@ Java_sun_awt_windows_WPrinterJob_getDefaultPage(JNIEnv *env, jobject self, return ; } - if (pDevMode->dmFields & DM_PAPERSIZE) { + if ((pDevMode->dmFields & DM_PAPERSIZE) || + (pDevMode->dmFields & DM_PAPERWIDTH) || + (pDevMode->dmFields & DM_PAPERLENGTH)) { POINT paperSize; RECT margins; jint orientation = PAGEFORMAT_PORTRAIT; @@ -731,7 +733,7 @@ Java_sun_awt_windows_WPrinterJob_validatePaper(JNIEnv *env, jobject self, pd.lStructSize = sizeof(PRINTDLG); pd.Flags = PD_RETURNDEFAULT | PD_RETURNDC; - if (AwtCommDialog::PrintDlg(&pd)) { + if (::PrintDlg(&pd)) { printDC = pd.hDC; hDevMode = pd.hDevMode; hDevNames = pd.hDevNames; @@ -1836,10 +1838,6 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WPrinterJob_selectStylePen (JNIEnv *env, jobject self, jlong printDC, jlong cap, jlong join, jfloat width, jint red, jint green, jint blue) { - /* End cap and line join styles are not supported in Win 9x. */ - if (IS_WIN95) - return JNI_FALSE; - TRY; LOGBRUSH logBrush; @@ -1877,23 +1875,13 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_windows_WPrinterJob_setFont { jboolean didSetFont = JNI_FALSE; - if (IS_NT) { - didSetFont = jFontToWFontW(env, (HDC)printDC, + didSetFont = jFontToWFontW(env, (HDC)printDC, fontName, fontSize, isBold, isItalic, rotation, awScale); - } else { - didSetFont = jFontToWFontA(env, (HDC)printDC, - fontName, - fontSize, - isBold, - isItalic, - rotation, - awScale); - } return didSetFont; } @@ -1917,7 +1905,7 @@ static jboolean jFontToWFontA(JNIEnv *env, HDC printDC, jstring fontName, memset(&matchedLogFont, 0, sizeof(matchedLogFont)); - WCHAR* name = TO_WSTRING(fontName); + LPCWSTR fontNameW = JNU_GetStringPlatformChars(env, fontName, NULL); /* Some fontnames of Non-ASCII fonts like 'MS Minchou' are themselves @@ -1926,14 +1914,14 @@ static jboolean jFontToWFontA(JNIEnv *env, HDC printDC, jstring fontName, */ int maxlen = static_cast(sizeof(lf.lfFaceName)) - 1; // maxlen is int due to cbMultiByte parameter is int - int destLen = WideCharToMultiByte(CP_ACP, // convert to ASCII code page - 0, // flags - name, // Unicode string - -1, // Unicode length is calculated automatically + int destLen = WideCharToMultiByte(CP_ACP, // convert to ASCII code page + 0, // flags + fontNameW, // Unicode string + -1, // Unicode length is calculated automatically lf.lfFaceName, // Put ASCII string here - maxlen, // max len - NULL, // default handling of unmappables - NULL);// do not care if def char is used + maxlen, // max len + NULL, // default handling of unmappables + NULL); // do not care if def char is used /* If WideCharToMultiByte succeeded then the number * of bytes it copied into the face name buffer will @@ -2016,9 +2004,10 @@ static jboolean jFontToWFontA(JNIEnv *env, HDC printDC, jstring fontName, } else { foundFont = false; } - } + JNU_ReleaseStringPlatformChars(env, fontName, fontNameW); + return foundFont ? JNI_TRUE : JNI_FALSE; } @@ -2041,27 +2030,29 @@ static jboolean jFontToWFontW(JNIEnv *env, HDC printDC, jstring fontName, memset(&matchedLogFont, 0, sizeof(matchedLogFont)); + LPCWSTR fontNameW = JNU_GetStringPlatformChars(env, fontName, NULL); + /* Describe the GDI fonts we want enumerated. We * simply supply the java font name and let GDI * do the matching. If the java font name is * longer than the GDI maximum font lenght then * we can't convert the font. */ - WCHAR* name = TO_WSTRING(fontName); - size_t nameLen = wcslen(name); - + size_t nameLen = wcslen(fontNameW); if (nameLen < (sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]))) { - wcscpy(lf.lfFaceName, name); + wcscpy(lf.lfFaceName, fontNameW); lf.lfCharSet = DEFAULT_CHARSET; lf.lfPitchAndFamily = 0; - foundFont = !EnumFontFamiliesExW((HDC)printDC, &lf, + foundFont = !::EnumFontFamiliesEx((HDC)printDC, &lf, (FONTENUMPROCW) fontEnumProcW, (LPARAM) &matchedLogFont, 0); } + JNU_ReleaseStringPlatformChars(env, fontName, fontNameW); + if (!foundFont) { return JNI_FALSE; } @@ -2098,7 +2089,7 @@ static jboolean jFontToWFontW(JNIEnv *env, HDC printDC, jstring fontName, //Debug: dumpLogFont(&matchedLogFont); - HFONT font = CreateFontIndirectW(&matchedLogFont); + HFONT font = ::CreateFontIndirect(&matchedLogFont); if (font == NULL) { return JNI_FALSE; } @@ -2121,7 +2112,7 @@ static jboolean jFontToWFontW(JNIEnv *env, HDC printDC, jstring fontName, GetTextMetrics(printDC, &tm); avgWidth = tm.tmAveCharWidth; matchedLogFont.lfWidth = (LONG)((fabs)(avgWidth*awScale)); - font = CreateFontIndirectW(&matchedLogFont); + font = ::CreateFontIndirect(&matchedLogFont); if (font == NULL) { return JNI_FALSE; } @@ -2228,14 +2219,11 @@ JNIEXPORT jint JNICALL Java_sun_awt_windows_WPrinterJob_getGDIAdvance (JNIEnv *env, jobject self, jlong printDC, jstring text) { SIZE size; - LPWSTR wText = TO_WSTRING(text); + LPCWSTR wText = JNU_GetStringPlatformChars(env, text, NULL); size_t strLen = wcslen(wText); BOOL ok = GetTextExtentPoint32((HDC)printDC, wText, (int)strLen, &size); - if (ok) { - return size.cx; - } else { - return 0; - } + JNU_ReleaseStringPlatformChars(env, text, wText); + return ok ? size.cx : 0; } @@ -2286,7 +2274,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut long posX = ROUND_TO_LONG(x); long posY = ROUND_TO_LONG(y); int flags = (glyphCodes !=0) ? ETO_GLYPH_INDEX : 0; - LPWSTR wText = TO_WSTRING(text); + LPCWSTR wText = JNU_GetStringPlatformChars(env, text, NULL); int *advances = NULL, *xadvances = NULL, *xyadvances = NULL; BOOL useYAdvances = FALSE; @@ -2357,7 +2345,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut *inxyAdvances = 0; } - if (useYAdvances && IS_WIN2000) { + if (useYAdvances) { advances = xyadvances; flags |= J2D_ETO_PDY; } else { @@ -2369,7 +2357,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut env->ReleaseFloatArrayElements(positions, glyphPos, JNI_ABORT); } - BOOL drawn = ::ExtTextOutW( (HDC)printDC, + BOOL drawn = ::ExtTextOut((HDC)printDC, posX, posY, // starting position for the text flags, // glyphCodes?, y advances? NULL, // optional clipping-opaquing rectangle @@ -2383,6 +2371,8 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WPrinterJob_textOut if (xyadvances != NULL) { free(xyadvances); } + + JNU_ReleaseStringPlatformChars(env, text, wText); } /** @@ -2966,7 +2956,7 @@ static HDC getDefaultPrinterDC(JNIEnv *env, jobject printerJob) { pd.lStructSize = sizeof(PRINTDLG); pd.Flags = PD_RETURNDEFAULT | PD_RETURNDC; - if (AwtCommDialog::PrintDlg(&pd)) { + if (::PrintDlg(&pd)) { printDC = pd.hDC; /* Find out how many copies the driver can do, and use driver's diff --git a/jdk/src/windows/native/sun/windows/awt_Robot.cpp b/jdk/src/windows/native/sun/windows/awt_Robot.cpp index 15a9a243fd1..e774f5160db 100644 --- a/jdk/src/windows/native/sun/windows/awt_Robot.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Robot.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -23,6 +23,7 @@ * have any questions. */ +#include "awt.h" #include "awt_Toolkit.h" #include "awt_Component.h" #include "awt_Robot.h" @@ -30,8 +31,6 @@ #include "java_awt_event_InputEvent.h" #include -static const int MOUSE_MAX = 65535; - AwtRobot::AwtRobot( jobject peer ) { JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); @@ -44,11 +43,11 @@ AwtRobot::~AwtRobot() } #ifndef SPI_GETMOUSESPEED -#define SPI_GETMOUSESPEED 112 +#define SPI_GETMOUSESPEED 112 #endif #ifndef SPI_SETMOUSESPEED -#define SPI_SETMOUSESPEED 113 +#define SPI_SETMOUSESPEED 113 #endif void AwtRobot::MouseMove( jint x, jint y) @@ -102,19 +101,38 @@ void AwtRobot::MousePress( jint buttonMask ) // left handed mouse setup BOOL bSwap = ::GetSystemMetrics(SM_SWAPBUTTON); - if ( buttonMask & java_awt_event_InputEvent_BUTTON1_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON1_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON1_DOWN_MASK) + { dwFlags |= !bSwap ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_RIGHTDOWN; } - if ( buttonMask & java_awt_event_InputEvent_BUTTON3_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON3_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON3_DOWN_MASK) + { dwFlags |= !bSwap ? MOUSEEVENTF_RIGHTDOWN : MOUSEEVENTF_LEFTDOWN; } - if ( buttonMask & java_awt_event_InputEvent_BUTTON2_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON2_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON2_DOWN_MASK) + { dwFlags |= MOUSEEVENTF_MIDDLEDOWN; } - mouse_event(dwFlags, 0, 0, 0, 0 ); + INPUT mouseInput = {0}; + mouseInput.type = INPUT_MOUSE; + mouseInput.mi.time = 0; + mouseInput.mi.dwFlags = dwFlags; + if ( buttonMask & AwtComponent::masks[3] ) { + mouseInput.mi.dwFlags = mouseInput.mi.dwFlags | MOUSEEVENTF_XDOWN; + mouseInput.mi.mouseData = XBUTTON1; + } + + if ( buttonMask & AwtComponent::masks[4] ) { + mouseInput.mi.dwFlags = mouseInput.mi.dwFlags | MOUSEEVENTF_XDOWN; + mouseInput.mi.mouseData = XBUTTON2; + } + ::SendInput(1, &mouseInput, sizeof(mouseInput)); } void AwtRobot::MouseRelease( jint buttonMask ) @@ -125,61 +143,43 @@ void AwtRobot::MouseRelease( jint buttonMask ) // left handed mouse setup BOOL bSwap = ::GetSystemMetrics(SM_SWAPBUTTON); - if ( buttonMask & java_awt_event_InputEvent_BUTTON1_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON1_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON1_DOWN_MASK) + { dwFlags |= !bSwap ? MOUSEEVENTF_LEFTUP : MOUSEEVENTF_RIGHTUP; } - if ( buttonMask & java_awt_event_InputEvent_BUTTON3_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON3_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON3_DOWN_MASK) + { dwFlags |= !bSwap ? MOUSEEVENTF_RIGHTUP : MOUSEEVENTF_LEFTUP; } - if ( buttonMask & java_awt_event_InputEvent_BUTTON2_MASK ) { + if ( buttonMask & java_awt_event_InputEvent_BUTTON2_MASK || + buttonMask & java_awt_event_InputEvent_BUTTON2_DOWN_MASK) + { dwFlags |= MOUSEEVENTF_MIDDLEUP; } - mouse_event(dwFlags, 0, 0, 0, 0 ); + INPUT mouseInput = {0}; + mouseInput.type = INPUT_MOUSE; + mouseInput.mi.time = 0; + mouseInput.mi.dwFlags = dwFlags; + + if ( buttonMask & AwtComponent::masks[3] ) { + mouseInput.mi.dwFlags = mouseInput.mi.dwFlags | MOUSEEVENTF_XUP; + mouseInput.mi.mouseData = XBUTTON1; + } + + if ( buttonMask & AwtComponent::masks[4] ) { + mouseInput.mi.dwFlags = mouseInput.mi.dwFlags | MOUSEEVENTF_XUP; + mouseInput.mi.mouseData = XBUTTON2; + } + ::SendInput(1, &mouseInput, sizeof(mouseInput)); } void AwtRobot::MouseWheel (jint wheelAmt) { - if (IS_WIN95 && !IS_WIN98) { - // Other win32 platforms do nothing for mouse_event(0), so - // do nothing on 95, too. - if (wheelAmt == 0) { - return; - } - - // Win95 doesn't understand MOUSEEVENTF_WHEEL, so use PostEvent - POINT curPos; - HWND mouseOver = NULL; - HWND topLevel = NULL; - UINT wheelMsg = NULL; - - if (::GetCursorPos((LPPOINT)&curPos) == 0) { - return; - } - // get hwnd of top-level container - mouseOver = ::WindowFromPoint(curPos); - DASSERT(mouseOver); - topLevel = AwtComponent::GetTopLevelParentForWindow(mouseOver); - DASSERT(topLevel); - - if (::ScreenToClient(topLevel, (LPPOINT)&curPos) == 0) { - return; - } - wheelMsg = AwtComponent::Wheel95GetMsg(); - - if (wheelMsg == NULL) { - return; - } - - ::PostMessage(topLevel, - wheelMsg, - wheelAmt * -1 * WHEEL_DELTA, - MAKELPARAM((WORD)curPos.x, (WORD)curPos.y)); - } - else { - mouse_event(MOUSEEVENTF_WHEEL, 0, 0, wheelAmt * -1 * WHEEL_DELTA, 0); - } + mouse_event(MOUSEEVENTF_WHEEL, 0, 0, wheelAmt * -1 * WHEEL_DELTA, 0); } inline jint AwtRobot::WinToJavaPixel(USHORT r, USHORT g, USHORT b) @@ -437,3 +437,9 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WRobotPeer_keyRelease( CATCH_BAD_ALLOC; } + +JNIEXPORT jint JNICALL Java_sun_awt_windows_WRobotPeer_getNumberOfButtons( + JNIEnv *, jobject self) +{ + return GetSystemMetrics(SM_CMOUSEBUTTONS); +} diff --git a/jdk/src/windows/native/sun/windows/awt_Robot.h b/jdk/src/windows/native/sun/windows/awt_Robot.h index ec25746e7b3..ba532c74821 100644 --- a/jdk/src/windows/native/sun/windows/awt_Robot.h +++ b/jdk/src/windows/native/sun/windows/awt_Robot.h @@ -1,5 +1,5 @@ /* - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -42,13 +42,13 @@ class AwtRobot : public AwtObject void MouseRelease( jint buttonMask ); void MouseWheel(jint wheelAmt); + jint getNumberOfButtons(); jint GetRGBPixel( jint x, jint y); void GetRGBPixels(jint x, jint y, jint width, jint height, jintArray pixelArray); void KeyPress( jint key ); void KeyRelease( jint key ); - static AwtRobot * GetRobot( jobject self ); private: diff --git a/jdk/src/windows/native/sun/windows/awt_ScrollPane.cpp b/jdk/src/windows/native/sun/windows/awt_ScrollPane.cpp index 3975a3fd8d5..4d41e0b0cbe 100644 --- a/jdk/src/windows/native/sun/windows/awt_ScrollPane.cpp +++ b/jdk/src/windows/native/sun/windows/awt_ScrollPane.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -108,13 +108,6 @@ AwtScrollPane* AwtScrollPane::Create(jobject self, jobject parent) { DWORD style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; - if (!IS_WIN4X) { - /* - * It's been decided by the UI folks that 3.X ScrollPanes - * should have borders... - */ - style |= WS_BORDER; - } jint scrollbarDisplayPolicy = env->GetIntField(target, scrollbarDisplayPolicyID); @@ -122,7 +115,7 @@ AwtScrollPane* AwtScrollPane::Create(jobject self, jobject parent) == java_awt_ScrollPane_SCROLLBARS_ALWAYS) { style |= WS_HSCROLL | WS_VSCROLL; } - DWORD exStyle = IS_WIN4X ? WS_EX_CLIENTEDGE : 0; + DWORD exStyle = WS_EX_CLIENTEDGE; if (GetRTL()) { exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR; @@ -225,15 +218,8 @@ void AwtScrollPane::RecalcSizes(int parentWidth, int parentHeight, } /* Determine border width without scrollbars. */ - int horzBorder; - int vertBorder; - if (IS_WIN4X) { - horzBorder = ::GetSystemMetrics(SM_CXEDGE); - vertBorder = ::GetSystemMetrics(SM_CYEDGE); - } else { - horzBorder = ::GetSystemMetrics(SM_CXBORDER); - vertBorder = ::GetSystemMetrics(SM_CYBORDER); - } + int horzBorder = ::GetSystemMetrics(SM_CXEDGE);; + int vertBorder = ::GetSystemMetrics(SM_CYEDGE);; parentWidth -= (horzBorder * 2); parentHeight -= (vertBorder * 2); diff --git a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp index 3c42ce494fc..e0d4c6158c2 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextArea.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextArea.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -26,10 +26,8 @@ #include "awt_Toolkit.h" #include "awt_TextArea.h" #include "awt_TextComponent.h" -#include "awt_dlls.h" #include "awt_KeyboardFocusManager.h" #include "awt_Canvas.h" -#include "awt_Unicode.h" #include "awt_Window.h" /* IMPORTANT! Read the README.JNI file for notes on JNI converted AWT code. @@ -50,7 +48,6 @@ struct ReplaceTextStruct { jfieldID AwtTextArea::scrollbarVisibilityID; WNDPROC AwtTextArea::sm_pDefWindowProc = NULL; -BOOL AwtTextArea::sm_RichEdit20 = (IS_WIN98 || IS_NT); /************************************************************************ * AwtTextArea methods @@ -78,8 +75,12 @@ void AwtTextArea::Dispose() } LPCTSTR AwtTextArea::GetClassName() { - load_rich_edit_library(); - return sm_RichEdit20 ? RICHEDIT_CLASS : TEXT("RICHEDIT"); + static BOOL richedLibraryLoaded = FALSE; + if (!richedLibraryLoaded) { + ::LoadLibrary(TEXT("RICHED20.DLL")); + richedLibraryLoaded = TRUE; + } + return RICHEDIT_CLASS; } /* Create a new AwtTextArea object and window. */ @@ -134,9 +135,8 @@ AwtTextArea* AwtTextArea::Create(jobject peer, jobject parent) * scrollbars instead of hiding them when not needed. */ DWORD style = WS_CHILD | WS_CLIPSIBLINGS | ES_LEFT | ES_MULTILINE | - ES_WANTRETURN | scroll_style | - (IS_WIN4X ? 0 : WS_BORDER) | ES_DISABLENOSCROLL; - DWORD exStyle = IS_WIN4X ? WS_EX_CLIENTEDGE : 0; + ES_WANTRETURN | scroll_style | ES_DISABLENOSCROLL; + DWORD exStyle = WS_EX_CLIENTEDGE; if (GetRTL()) { exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR; if (GetRTLReadingOrder()) @@ -169,9 +169,7 @@ AwtTextArea* AwtTextArea::Create(jobject peer, jobject parent) // end-of-document marker or carriage return, // to format paragraphs. // kdm@sparc.spb.su - if (sm_RichEdit20) { - c->SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0); - } + c->SendMessage(EM_SETTEXTMODE, TM_PLAINTEXT, 0); c->m_backgroundColorSet = TRUE; /* suppress inheriting parent's color. */ @@ -242,7 +240,7 @@ size_t AwtTextArea::CountNewLines(JNIEnv *env, jstring jStr, size_t maxlen) */ size_t length = env->GetStringLength(jStr) + 1; WCHAR *string = new WCHAR[length]; - env->GetStringRegion(jStr, 0, static_cast(length - 1), string); + env->GetStringRegion(jStr, 0, static_cast(length - 1), reinterpret_cast(string)); string[length-1] = '\0'; for (size_t i = 0; i < maxlen && i < length - 1; i++) { if (string[i] == L'\n') { @@ -461,12 +459,7 @@ AwtTextArea::WmContextMenu(HWND hCtrl, UINT xPos, UINT yPos) { /* Check if all the text is selected. */ if (cr.cpMin == 0) { - int len = 0; - if (m_isWin95) { - len = ::GetWindowTextLengthA(GetHWnd()); - } else { - len = ::GetWindowTextLengthW(GetHWnd()); - } + int len = ::GetWindowTextLength(GetHWnd()); if (cr.cpMin == 0 && cr.cpMax >= len) { /* * All the text is selected in RichEdit - select all the @@ -738,14 +731,8 @@ AwtTextArea::HandleEvent(MSG *msg, BOOL synthetic) // kdm@sparc.spb.su UINT platfScrollLines = 3; // Retrieve a number of scroll lines. - if (!sm_RichEdit20) { - // 95 doesn't understand the SPI_GETWHEELSCROLLLINES - get the user - // preference by other means - platfScrollLines = Wheel95GetScrLines(); - } else { - ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, - &platfScrollLines, 0); - } + ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, + &platfScrollLines, 0); if (platfScrollLines > 0) { HWND hWnd = GetHWnd(); @@ -838,23 +825,6 @@ AwtTextArea::HandleEvent(MSG *msg, BOOL synthetic) return returnVal; } -int AwtTextArea::GetText(LPTSTR buffer, int size) -{ - // Due to a known limitation of the MSLU, GetWindowText cannot be - // issued for the Unicode RichEdit control on Win9x. Use EM_GETTEXTEX instead. - if (sm_RichEdit20 && !IS_NT) { - GETTEXTEX gte; - gte.cb = size * sizeof(TCHAR); - gte.flags = GT_USECRLF; - gte.codepage = 1200; // implies Unicode - gte.lpDefaultChar = NULL; - gte.lpUsedDefChar = NULL; - return (int)SendMessage(EM_GETTEXTEX, (WPARAM)>e, (LPARAM)buffer); - } else { - return ::GetWindowText(GetHWnd(), buffer, size); - } -} - /* * WM_CTLCOLOR is not sent by rich edit controls. * Use EM_SETCHARFORMAT and EM_SETBKGNDCOLOR to set @@ -984,16 +954,16 @@ void AwtTextArea::_ReplaceText(void *param) jsize length = env->GetStringLength(text) + 1; // Bugid 4141477 - Can't use TO_WSTRING here because it uses alloca // WCHAR* buffer = TO_WSTRING(text); - WCHAR *buffer = new WCHAR[length]; - env->GetStringRegion(text, 0, length-1, buffer); + TCHAR *buffer = new TCHAR[length]; + env->GetStringRegion(text, 0, length-1, reinterpret_cast(buffer)); buffer[length-1] = '\0'; c->CheckLineSeparator(buffer); c->RemoveCR(buffer); // Fix for 5003402: added restoring/hiding selection to enable automatic scrolling c->SendMessage(EM_HIDESELECTION, FALSE, TRUE); - c->SendMessageW(EM_SETSEL, start, end); - c->SendMessageW(EM_REPLACESEL, FALSE, (LPARAM)buffer); + c->SendMessage(EM_SETSEL, start, end); + c->SendMessage(EM_REPLACESEL, FALSE, (LPARAM)buffer); c->SendMessage(EM_HIDESELECTION, TRUE, TRUE); delete[] buffer; @@ -1187,12 +1157,11 @@ AwtTextArea::OleCallback::QueryAcceptData(LPDATAOBJECT pdataobj, HGLOBAL hMetaPict) { if (reco == RECO_PASTE) { // If CF_TEXT format is available edit controls will select it, - // otherwise if it is WinNT or Win2000 and CF_UNICODETEXT is - // available it will be selected, otherwise if CF_OEMTEXT is - // available it will be selected. + // otherwise if it is CF_UNICODETEXT is available it will be + // selected, otherwise if CF_OEMTEXT is available it will be selected. if (::IsClipboardFormatAvailable(CF_TEXT)) { *pcfFormat = CF_TEXT; - } else if (!m_isWin95 && ::IsClipboardFormatAvailable(CF_UNICODETEXT)) { + } else if (::IsClipboardFormatAvailable(CF_UNICODETEXT)) { *pcfFormat = CF_UNICODETEXT; } else if (::IsClipboardFormatAvailable(CF_OEMTEXT)) { *pcfFormat = CF_OEMTEXT; diff --git a/jdk/src/windows/native/sun/windows/awt_TextArea.h b/jdk/src/windows/native/sun/windows/awt_TextArea.h index 7e054f61079..12ba0baa658 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextArea.h +++ b/jdk/src/windows/native/sun/windows/awt_TextArea.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -73,8 +73,6 @@ public: MsgRouting WmNcHitTest(UINT x, UINT y, LRESULT &retVal); MsgRouting HandleEvent(MSG *msg, BOOL synthetic); - INLINE virtual int GetText(LPTSTR buffer, int size); - INLINE void SetIgnoreEnChange(BOOL b) { m_bIgnoreEnChange = b; } virtual void SetColor(COLORREF c); @@ -96,10 +94,6 @@ protected: void EditGetSel(CHARRANGE &cr); LONG EditGetCharFromPos(POINT& pt); private: - - // TRUE if the rich edit version is 2.0 - static BOOL sm_RichEdit20; - // RichEdit 1.0 control generates EN_CHANGE notifications not only // on text changes, but also on any character formatting change. // This flag is true when the latter case is detected. diff --git a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp index 1be6d9f1450..9920b925254 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -326,7 +326,7 @@ jstring AwtTextComponent::_GetText(void *param) WCHAR* buf = new WCHAR[len + 1]; c->GetText(buf, len + 1); c->RemoveCR(buf); - result = env->NewString(buf, static_cast(wcslen(buf))); + result = JNU_NewStringPlatform(env, buf); delete [] buf; } } @@ -362,7 +362,7 @@ void AwtTextComponent::_SetText(void *param) { int length = env->GetStringLength(text); WCHAR* buffer = new WCHAR[length + 1]; - env->GetStringRegion(text, 0, length, buffer); + env->GetStringRegion(text, 0, length, reinterpret_cast(buffer)); buffer[length] = 0; c->CheckLineSeparator(buffer); c->RemoveCR(buffer); diff --git a/jdk/src/windows/native/sun/windows/awt_TextComponent.h b/jdk/src/windows/native/sun/windows/awt_TextComponent.h index 2eff0505715..32a430baf38 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextComponent.h +++ b/jdk/src/windows/native/sun/windows/awt_TextComponent.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -70,15 +70,6 @@ public: static jstring _GetText(void *param); BOOL ActMouseMessage(MSG* pMsg); - /* - * For TextComponents that contains WCHAR strings or messages with - * WCHAR parameters. - */ - INLINE LRESULT SendMessageW(UINT msg, WPARAM wParam = 0, LPARAM lParam = 0) - { - DASSERT(GetHWnd()); - return ::SendMessageW(GetHWnd(), msg, wParam, lParam); - } void SetFont(AwtFont* font); diff --git a/jdk/src/windows/native/sun/windows/awt_TextField.cpp b/jdk/src/windows/native/sun/windows/awt_TextField.cpp index 5b95495d067..975fd20bc0b 100644 --- a/jdk/src/windows/native/sun/windows/awt_TextField.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TextField.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -26,7 +26,6 @@ #include "awt_Toolkit.h" #include "awt_TextField.h" #include "awt_TextComponent.h" -#include "awt_dlls.h" #include "awt_KeyboardFocusManager.h" #include "awt_Canvas.h" @@ -69,9 +68,8 @@ AwtTextField* AwtTextField::Create(jobject peer, jobject parent) { DWORD style = WS_CHILD | WS_CLIPSIBLINGS | - ES_LEFT | ES_AUTOHSCROLL | - (IS_WIN4X ? 0 : WS_BORDER); - DWORD exStyle = IS_WIN4X ? WS_EX_CLIENTEDGE : 0; + ES_LEFT | ES_AUTOHSCROLL; + DWORD exStyle = WS_EX_CLIENTEDGE; if (GetRTL()) { exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR; if (GetRTLReadingOrder()) diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp index 958ca8d871d..c4292826a8e 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.cpp @@ -23,15 +23,16 @@ * have any questions. */ +#include "awt.h" #include #include -#if defined(_DEBUG) && defined(_MSC_VER) && _MSC_VER >= 1000 -#include -#endif +//#if defined(_DEBUG) && defined(_MSC_VER) && _MSC_VER >= 1000 +//#include +//#endif #define _JNI_IMPLEMENTATION_ -#include "stdhdrs.h" + #include "awt_DrawingSurface.h" #include "awt_AWTEvent.h" #include "awt_Component.h" @@ -51,13 +52,13 @@ #include "awt_FileDialog.h" #include "CmdIDList.h" #include "awt_new.h" -#include "awt_Unicode.h" -#include "ddrawUtils.h" #include "debug_trace.h" #include "debug_mem.h" #include "ComCtl32Util.h" +#include "D3DPipelineManager.h" + #include #include @@ -78,11 +79,12 @@ extern BOOL windowMoveLockHeld; extern jclass jawtVImgClass; extern jclass jawtVSMgrClass; extern jclass jawtComponentClass; -extern jclass jawtW32ossdClass; extern jfieldID jawtPDataID; extern jfieldID jawtSDataID; extern jfieldID jawtSMgrID; +extern void DWMResetCompositionEnabled(); + /************************************************************************ * Utilities */ @@ -223,8 +225,7 @@ BOOL AwtToolkit::activateKeyboardLayout(HKL hkl) { HKL prev = ::ActivateKeyboardLayout(hkl, 0); // If the above call fails, try loading the layout in case of NT - if ((prev == 0) && IS_NT) { - + if (!prev) { // create input locale string, e.g., "00000409", from hkl. TCHAR inputLocale[9]; TCHAR buf[9]; @@ -268,20 +269,6 @@ extern "C" BOOL APIENTRY DllMain(HANDLE hInstance, DWORD ul_reason_for_call, DTrace_DisableMutex(); DMem_DisableMutex(); #endif DEBUG - // Release any resources that have not yet been released - // Note that releasing DirectX objects is necessary for some - // failure situations on win9x (such as the primary remaining - // locked on application exit) but cannot be done during - // PROCESS_DETACH on XP. On NT and win2k calling this ends up - // in a catch() clause in the calling function, but on XP - // the process simply hangs during the release of the ddraw - // device object. Thus we check for NT here and do not bother - // with the release on any NT flavored OS. Note that XP is - // based on NT, so the IS_NT check is valid for NT4, win2k, - // XP, and presumably XP follow-ons. - if (!IS_NT) { - DDRelease(); - } break; } return TRUE; @@ -309,7 +296,7 @@ JavaStringBuffer::JavaStringBuffer(JNIEnv *env, jstring jstr) { if (jstr != NULL) { int length = env->GetStringLength(jstr); buffer = new TCHAR[length + 1]; - LPCTSTR tmp = (LPCTSTR)JNU_GetStringPlatformChars(env, jstr, NULL); + LPCTSTR tmp = JNU_GetStringPlatformChars(env, jstr, NULL); _tcscpy(buffer, tmp); JNU_ReleaseStringPlatformChars(env, jstr, tmp); } else { @@ -335,6 +322,7 @@ AwtToolkit::AwtToolkit() { m_vmSignalled = FALSE; m_isDynamicLayoutSet = FALSE; + m_areExtraMouseButtonsEnabled = TRUE; m_verifyComponents = FALSE; m_breakOnError = FALSE; @@ -465,6 +453,11 @@ BOOL AwtToolkit::Dispose() { awt_dnd_uninitialize(); awt_clipboard_uninitialize((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2)); + // dispose Direct3D-related resources. This should be done + // before AwtObjectList::Cleanup() as the d3d will attempt to + // shutdown when the last of its windows is disposed of + D3DPipelineManager::DeleteInstance(); + AwtObjectList::Cleanup(); AwtFont::Cleanup(); @@ -497,8 +490,6 @@ BOOL AwtToolkit::Dispose() { ::CloseHandle(m_waitEvent); - ComCtl32Util::GetInstance().FreeLibraries(); - tk.m_isDisposed = TRUE; return TRUE; @@ -697,20 +688,6 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message, AwtObjectList::Cleanup(); return 0; } - case WM_AWT_D3D_CREATE_DEVICE: { - DDraw *ddObject = (DDraw*)wParam; - if (ddObject != NULL) { - ddObject->InitD3DContext(); - } - return 0; - } - case WM_AWT_D3D_RELEASE_DEVICE: { - DDraw *ddObject = (DDraw*)wParam; - if (ddObject != NULL) { - ddObject->ReleaseD3DContext(); - } - return 0; - } case WM_SYSCOLORCHANGE: { jclass systemColorClass = env->FindClass("java/awt/SystemColor"); @@ -745,6 +722,17 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message, } return 0; } +#ifndef WM_DWMCOMPOSITIONCHANGED +#define WM_DWMCOMPOSITIONCHANGED 0x031E +#define WM_DWMNCRENDERINGCHANGED 0x031F +#define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 +#define WM_DWMWINDOWMAXIMIZEDCHANGED 0x0321 +#endif // WM_DWMCOMPOSITIONCHANGED + case WM_DWMCOMPOSITIONCHANGED: { + DWMResetCompositionEnabled(); + return 0; + } + case WM_TIMER: { // 6479820. Should check if a window is in manual resizing process: skip // sending any MouseExit/Enter events while inside resize-loop. @@ -896,22 +884,9 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message, return (DWORD)ImmGetOpenStatus((HIMC)wParam); } case WM_DISPLAYCHANGE: { - AwtCursor::DirtyAllCustomCursors(); - // Reinitialize screens initScreens(env); - // Invalidate current DDraw object; the object must be recreated - // when we first try to create a new DDraw surface. Note that we - // don't recreate the ddraw object directly here because of - // multi-threading issues; we'll just leave that to the first - // time an object tries to create a DDraw surface under the new - // display depth (which will happen after the displayChange event - // propagation at the end of this case). - if (DDCanReplaceSurfaces(NULL)) { - DDInvalidateDDInstance(NULL); - } - // Notify Java side - call WToolkit.displayChanged() jclass clazz = env->FindClass("sun/awt/windows/WToolkit"); env->CallStaticVoidMethod(clazz, AwtToolkit::displayChangeMID); @@ -1182,9 +1157,7 @@ BOOL AwtToolkit::PreProcessMsg(MSG& msg) if (p && p->PreProcessMsg(msg) == mrConsume) return TRUE; - if ((msg.message >= WM_MOUSEFIRST && msg.message <= WM_AWT_MOUSELAST) || - (IS_WIN95 && !IS_WIN98 && - msg.message == AwtComponent::Wheel95GetMsg()) || + if ((msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) || (msg.message >= WM_NCMOUSEMOVE && msg.message <= WM_NCMBUTTONDBLCLK)) { if (PreProcessMouseMsg(p, msg)) { return TRUE; @@ -1211,9 +1184,7 @@ BOOL AwtToolkit::PreProcessMouseMsg(AwtComponent* p, MSG& msg) return FALSE; } - if (msg.message >= WM_MOUSEFIRST && msg.message <= WM_AWT_MOUSELAST || - (IS_WIN95 && !IS_WIN98 && msg.message == AwtComponent::Wheel95GetMsg())) - { + if (msg.message >= WM_MOUSEFIRST && msg.message <= WM_MOUSELAST) { mouseWParam = msg.wParam; mouseLParam = msg.lParam; } else { @@ -1308,21 +1279,6 @@ BOOL AwtToolkit::PreProcessMouseMsg(AwtComponent* p, MSG& msg) //window msg.hwnd = hWndForWheel; } - else if (IS_WIN95 && !IS_WIN98 && - msg.message == AwtComponent::Wheel95GetMsg() && - mouseWheelComp != NULL) { - - // On Win95, mouse wheels are _always_ delivered to the top level - // Frame. Default behavior only takes place if the message's hwnd - // remains that of the Frame. We only want to change the hwnd if - // we're changing it to a Component that DOESN'T handle the - // mousewheel natively. - - if (!mouseWheelComp->InheritsNativeMouseWheelBehavior()) { - DTRACE_PRINTLN("AwtT::PPMM: changing hwnd on 95"); - msg.hwnd = hWndForWheel; - } - } /* * Make sure we get at least one last chance to check for transitions @@ -1545,9 +1501,6 @@ Java_sun_awt_windows_WToolkit_initIDs(JNIEnv *env, jclass cls) DASSERT(vSMgrClassLocal != 0); jclass componentClassLocal = env->FindClass("java/awt/Component"); DASSERT(componentClassLocal != 0); - jclass w32ossdClassLocal = - env->FindClass("sun/java2d/windows/Win32OffScreenSurfaceData"); - DASSERT(w32ossdClassLocal != 0); jawtSMgrID = env->GetFieldID(vImgClassLocal, "volSurfaceManager", "Lsun/awt/image/VolatileSurfaceManager;"); DASSERT(jawtSMgrID != 0); @@ -1560,7 +1513,6 @@ Java_sun_awt_windows_WToolkit_initIDs(JNIEnv *env, jclass cls) // Save these classes in global references for later use jawtVImgClass = (jclass)env->NewGlobalRef(vImgClassLocal); jawtComponentClass = (jclass)env->NewGlobalRef(componentClassLocal); - jawtW32ossdClass = (jclass)env->NewGlobalRef(w32ossdClassLocal); CATCH_BAD_ALLOC; } @@ -1817,7 +1769,7 @@ Java_sun_awt_windows_WToolkit_getScreenInsets(JNIEnv *env, { jobject insets = NULL; RECT rRW; - MONITOR_INFO *miInfo; + LPMONITORINFO miInfo; TRY; @@ -1839,10 +1791,10 @@ Java_sun_awt_windows_WToolkit_getScreenInsets(JNIEnv *env, if (miInfo) { insets = env->NewObject(env->FindClass("java/awt/Insets"), AwtToolkit::insetsMID, - miInfo->rWork.top - miInfo->rMonitor.top, - miInfo->rWork.left - miInfo->rMonitor.left, - miInfo->rMonitor.bottom - miInfo->rWork.bottom, - miInfo->rMonitor.right - miInfo->rWork.right); + miInfo->rcWork.top - miInfo->rcMonitor.top, + miInfo->rcWork.left - miInfo->rcMonitor.left, + miInfo->rcMonitor.bottom - miInfo->rcWork.bottom, + miInfo->rcMonitor.right - miInfo->rcWork.right); } } @@ -1867,7 +1819,6 @@ Java_sun_awt_windows_WToolkit_nativeSync(JNIEnv *env, jobject self) // Synchronize both GDI and DDraw VERIFY(::GdiFlush()); - DDSync(); CATCH_BAD_ALLOC; } @@ -2083,29 +2034,15 @@ Java_sun_awt_windows_WToolkit_getWindowsVersion(JNIEnv *env, jclass cls) swprintf(szVer, L"0x%x = %ld", version, version); int l = lstrlen(szVer); - if (IS_WIN95) { - if (IS_WIN98) { - if (IS_WINME) { - swprintf(szVer + l, L" (Windows ME)"); + if (IS_WIN2000) { + if (IS_WINXP) { + if (IS_WINVISTA) { + swprintf(szVer + l, L" (Windows Vista)"); } else { - swprintf(szVer + l, L" (Windows 98)"); + swprintf(szVer + l, L" (Windows XP)"); } } else { - swprintf(szVer + l, L" (Windows 95)"); - } - } else if (IS_NT) { - if (IS_WIN2000) { - if (IS_WINXP) { - if (IS_WINVISTA) { - swprintf(szVer + l, L" (Windows Vista)"); - } else { - swprintf(szVer + l, L" (Windows XP)"); - } - } else { - swprintf(szVer + l, L" (Windows 2000)"); - } - } else { - swprintf(szVer + l, L" (Windows NT)"); + swprintf(szVer + l, L" (Windows 2000)"); } } else { swprintf(szVer + l, L" (Unknown)"); @@ -2156,3 +2093,26 @@ Java_sun_awt_SunToolkit_closeSplashScreen(JNIEnv *env, jclass cls) splashClose(); } } + +/* + * accessible from awt_Component + */ +BOOL AwtToolkit::areExtraMouseButtonsEnabled() { + return m_areExtraMouseButtonsEnabled; +} + +/* + * Class: sun_awt_windows_WToolkit + * Method: setExtraMouseButtonsEnabledNative + * Signature: (Z)V + */ +extern "C" JNIEXPORT void JNICALL Java_sun_awt_windows_WToolkit_setExtraMouseButtonsEnabledNative +(JNIEnv *env, jclass self, jboolean enable){ + TRY; + AwtToolkit::GetInstance().setExtraMouseButtonsEnabled(enable); + CATCH_BAD_ALLOC; +} + +void AwtToolkit::setExtraMouseButtonsEnabled(BOOL enable) { + m_areExtraMouseButtonsEnabled = enable; +} diff --git a/jdk/src/windows/native/sun/windows/awt_Toolkit.h b/jdk/src/windows/native/sun/windows/awt_Toolkit.h index fcee2d4ad5c..d76546fa4eb 100644 --- a/jdk/src/windows/native/sun/windows/awt_Toolkit.h +++ b/jdk/src/windows/native/sun/windows/awt_Toolkit.h @@ -50,7 +50,6 @@ #include "awt.h" #include "awtmsg.h" -#include "awt_Multimon.h" #include "Trace.h" #include "sun_awt_windows_WToolkit.h" @@ -89,11 +88,8 @@ class JNILocalFrame { */ class CriticalSection { public: - INLINE CriticalSection() { ::InitializeCriticalSection(&rep); - ::InitializeCriticalSection(&tryrep); - tryEntered = 0; } - INLINE ~CriticalSection() { ::DeleteCriticalSection(&rep); - ::DeleteCriticalSection(&tryrep); } + INLINE CriticalSection() { ::InitializeCriticalSection(&rep); } + INLINE ~CriticalSection() { ::DeleteCriticalSection(&rep); } class Lock { public: @@ -111,50 +107,18 @@ class CriticalSection { private: CRITICAL_SECTION rep; - CRITICAL_SECTION tryrep; - long tryEntered; - CriticalSection(const CriticalSection&); const CriticalSection& operator =(const CriticalSection&); public: - virtual void Enter (void) - { - ::EnterCriticalSection(&tryrep); - tryEntered++; - if (tryEntered == 1) { - ::EnterCriticalSection(&rep); - ::LeaveCriticalSection(&tryrep); - } else { - ::LeaveCriticalSection(&tryrep); - ::EnterCriticalSection(&rep); - } + virtual void Enter() { + ::EnterCriticalSection(&rep); } - // we cannot use ::TryEnterCriticalSection as it is not supported on Win9x/Me - virtual BOOL TryEnter (void) - { - BOOL result = FALSE; - ::EnterCriticalSection(&tryrep); - if (tryEntered == 0) { - ::EnterCriticalSection(&rep); - tryEntered++; - result = TRUE; - } - ::LeaveCriticalSection(&tryrep); - return result; + virtual BOOL TryEnter() { + return ::TryEnterCriticalSection(&rep); } - virtual void Leave (void) - { - ::EnterCriticalSection(&tryrep); - if (tryEntered > 0) { - tryEntered--; - } else { - // this may happen only if we call to Leave() before - // Enter() so this is definitely a bug - DASSERT(FALSE); - } + virtual void Leave() { ::LeaveCriticalSection(&rep); - ::LeaveCriticalSection(&tryrep); } }; @@ -211,6 +175,8 @@ public: BOOL IsDynamicLayoutSet(); BOOL IsDynamicLayoutSupported(); BOOL IsDynamicLayoutActive(); + BOOL areExtraMouseButtonsEnabled(); + void setExtraMouseButtonsEnabled(BOOL enable); INLINE BOOL localPump() { return m_localPump; } INLINE BOOL VerifyComponents() { return FALSE; } // TODO: Use new DebugHelper class to set this flag @@ -387,6 +353,7 @@ private: BOOL m_verbose; BOOL m_isActive; // set to FALSE at beginning of Dispose BOOL m_isDisposed; // set to TRUE at end of Dispose + BOOL m_areExtraMouseButtonsEnabled; BOOL m_vmSignalled; // set to TRUE if QUERYENDSESSION has successfully // raised SIGTERM diff --git a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp index b8e7bddabbd..9165314bbc5 100644 --- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp +++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -23,9 +23,10 @@ * have any questions. */ -#include +#include "awt.h" #include #include +#include #include "awt_Toolkit.h" #include "awt_TrayIcon.h" @@ -173,27 +174,20 @@ AwtTrayIcon* AwtTrayIcon::Create(jobject self, jobject parent) env->DeleteLocalRef(target); return awtTrayIcon; } -typedef struct _SDLLVERSIONINFO -{ - DWORD cbSize; - DWORD dwMajorVersion; // Major version - DWORD dwMinorVersion; // Minor version - DWORD dwBuildNumber; // Build number - DWORD dwPlatformID; // DLLVER_PLATFORM_* -} SDLLVERSIONINFO; -typedef HRESULT (CALLBACK* SDLLGETVERSIONPROC)(SDLLVERSIONINFO *); void AwtTrayIcon::InitNID(UINT uID) { // fix for 6271589: we MUST set the size of the structure to match // the shell version, otherwise some errors may occur (like missing // balloon messages on win2k) - SDLLVERSIONINFO dllVersionInfo; - dllVersionInfo.cbSize = sizeof(SDLLVERSIONINFO); - int shellVersion = 4; // WIN_98 + DLLVERSIONINFO dllVersionInfo; + dllVersionInfo.cbSize = sizeof(DLLVERSIONINFO); + int shellVersion = 5; // WIN_2000 + // MSDN: DllGetVersion should not be implicitly called, but rather + // loaded using GetProcAddress HMODULE hShell = LoadLibrary(TEXT("Shell32.dll")); if (hShell != NULL) { - SDLLGETVERSIONPROC proc = (SDLLGETVERSIONPROC)GetProcAddress(hShell, "DllGetVersion"); + DLLGETVERSIONPROC proc = (DLLGETVERSIONPROC)GetProcAddress(hShell, "DllGetVersion"); if (proc != NULL) { if (proc(&dllVersionInfo) == NOERROR) { shellVersion = dllVersionInfo.dwMajorVersion; @@ -202,14 +196,16 @@ void AwtTrayIcon::InitNID(UINT uID) } FreeLibrary(hShell); switch (shellVersion) { - case 5: // WIN_2000, WIN_ME + case 5: // WIN_2000 m_nid.cbSize = (BYTE *)(&m_nid.guidItem) - (BYTE *)(&m_nid.cbSize); break; case 6: // WIN_XP + // Uncomment these two lines when moving to VS2008 +// m_nid.cbSize = (BYTE *)(&m_nid.hBalloonIcon) - (BYTE *)(&m_nid.cbSize); +// break; + default: // WIN_VISTA? m_nid.cbSize = sizeof(m_nid); break; - default: // WIN_98, WIN_NT - m_nid.cbSize = (BYTE *)(&m_nid.szTip) - (BYTE *)(&m_nid.cbSize) + sizeof(m_nid.szTip) / 2; } m_nid.hWnd = AwtTrayIcon::sm_msgWindow; m_nid.uID = uID; @@ -217,7 +213,7 @@ void AwtTrayIcon::InitNID(UINT uID) m_nid.uCallbackMessage = WM_AWT_TRAY_NOTIFY; m_nid.hIcon = AwtToolkit::GetInstance().GetAwtIcon(); m_nid.szTip[0] = '\0'; - m_nid.uVersion = IS_WIN2000 ? AWT_NOTIFYICON_VERSION : 0; + m_nid.uVersion = NOTIFYICON_VERSION; } BOOL AwtTrayIcon::SendTrayMessage(DWORD dwMessage) @@ -304,13 +300,13 @@ MsgRouting AwtTrayIcon::WmAwtTrayNotify(WPARAM wParam, LPARAM lParam) case WM_CONTEXTMENU: mr = WmContextMenu(0, pos.x, pos.y); break; - case AWT_NIN_KEYSELECT: + case NIN_KEYSELECT: mr = WmKeySelect(0, pos.x, pos.y); break; - case AWT_NIN_SELECT: + case NIN_SELECT: mr = WmSelect(0, pos.x, pos.y); break; - case AWT_NIN_BALLOONUSERCLICK: + case NIN_BALLOONUSERCLICK: mr = WmBalloonUserClick(0, pos.x, pos.y); break; } @@ -371,7 +367,7 @@ MsgRouting AwtTrayIcon::WmMouseUp(UINT flags, int x, int y, int button) (AwtComponent::GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ? TRUE : FALSE), AwtComponent::GetButton(button), &msg); - if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 1) { // No up-button in the drag-state + if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 0) { // No up-button in the drag-state SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED, TimeHelper::windowsToUTC(::GetTickCount()), x, y, AwtComponent::GetJavaModifiers(), clickCount, JNI_FALSE, AwtComponent::GetButton(button)); @@ -397,7 +393,7 @@ MsgRouting AwtTrayIcon::WmMouseMove(UINT flags, int x, int y) lastX = x; lastY = y; AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y); - if ((flags & AwtComponent::ALL_MK_BUTTONS) != 0) { + if ((flags & ALL_MK_BUTTONS) != 0) { m_mouseButtonClickAllowed = 0; } else { SendMouseEvent(java_awt_event_MouseEvent_MOUSE_MOVED, TimeHelper::windowsToUTC(::GetTickCount()), x, y, @@ -473,7 +469,7 @@ MsgRouting AwtTrayIcon::WmTaskbarCreated() { BOOL result = item->m_trayIcon->SendTrayMessage(NIM_ADD); // 6270114: Instructs the taskbar to behave according to the Shell version 5.0 if (result) { - item->m_trayIcon->SendTrayMessage(AWT_NIM_SETVERSION); + item->m_trayIcon->SendTrayMessage(NIM_SETVERSION); } } return mrDoDefault; @@ -733,9 +729,9 @@ void AwtTrayIcon::_SetToolTip(void *param) goto ret; } - tooltipStr = env->GetStringChars(jtooltip, (jboolean *)NULL); + tooltipStr = JNU_GetStringPlatformChars(env, jtooltip, (jboolean *)NULL); trayIcon->SetToolTip(tooltipStr); - env->ReleaseStringChars(jtooltip, tooltipStr); + JNU_ReleaseStringPlatformChars(env, jtooltip, tooltipStr); ret: env->DeleteGlobalRef(self); env->DeleteGlobalRef(jtooltip); @@ -782,7 +778,7 @@ void AwtTrayIcon::_UpdateIcon(void *param) BOOL result = trayIcon->SendTrayMessage(jupdate == JNI_TRUE ? NIM_MODIFY : NIM_ADD); // 6270114: Instructs the taskbar to behave according to the Shell version 5.0 if (result && jupdate == JNI_FALSE) { - trayIcon->SendTrayMessage(AWT_NIM_SETVERSION); + trayIcon->SendTrayMessage(NIM_SETVERSION); } ret: env->DeleteGlobalRef(self); @@ -791,22 +787,19 @@ ret: void AwtTrayIcon::DisplayMessage(LPCTSTR caption, LPCTSTR text, LPCTSTR msgType) { - if (!IS_WIN2000) - return; - - m_nid.uFlags |= AWT_NIF_INFO; + m_nid.uFlags |= NIF_INFO; m_nid.uTimeout = 10000; if (lstrcmp(msgType, TEXT("ERROR")) == 0) { - m_nid.dwInfoFlags = AWT_NIIF_ERROR; + m_nid.dwInfoFlags = NIIF_ERROR; } else if (lstrcmp(msgType, TEXT("WARNING")) == 0) { - m_nid.dwInfoFlags = AWT_NIIF_WARNING; + m_nid.dwInfoFlags = NIIF_WARNING; } else if (lstrcmp(msgType, TEXT("INFO")) == 0) { - m_nid.dwInfoFlags = AWT_NIIF_INFO; + m_nid.dwInfoFlags = NIIF_INFO; } else if (lstrcmp(msgType, TEXT("NONE")) == 0) { - m_nid.dwInfoFlags = AWT_NIIF_NONE; + m_nid.dwInfoFlags = NIIF_NONE; } else { - m_nid.dwInfoFlags = AWT_NIIF_NONE; + m_nid.dwInfoFlags = NIIF_NONE; } if (caption[0] == '\0') { @@ -835,7 +828,7 @@ void AwtTrayIcon::DisplayMessage(LPCTSTR caption, LPCTSTR text, LPCTSTR msgType) } SendTrayMessage(NIM_MODIFY); - m_nid.uFlags &= ~AWT_NIF_INFO; + m_nid.uFlags &= ~NIF_INFO; } void AwtTrayIcon::_DisplayMessage(void *param) @@ -855,15 +848,15 @@ void AwtTrayIcon::_DisplayMessage(void *param) JNI_CHECK_PEER_GOTO(self, ret); trayIcon = (AwtTrayIcon *)pData; - captionStr = env->GetStringChars(jcaption, (jboolean *)NULL); - textStr = env->GetStringChars(jtext, (jboolean *)NULL); - msgTypeStr = env->GetStringChars(jmsgType, (jboolean *)NULL); + captionStr = JNU_GetStringPlatformChars(env, jcaption, (jboolean *)NULL); + textStr = JNU_GetStringPlatformChars(env, jtext, (jboolean *)NULL); + msgTypeStr = JNU_GetStringPlatformChars(env, jmsgType, (jboolean *)NULL); trayIcon->DisplayMessage(captionStr, textStr, msgTypeStr); - env->ReleaseStringChars(jcaption, captionStr); - env->ReleaseStringChars(jtext, textStr); - env->ReleaseStringChars(jmsgType, msgTypeStr); + JNU_ReleaseStringPlatformChars(env, jcaption, captionStr); + JNU_ReleaseStringPlatformChars(env, jtext, textStr); + JNU_ReleaseStringPlatformChars(env, jmsgType, msgTypeStr); ret: env->DeleteGlobalRef(self); env->DeleteGlobalRef(jcaption); @@ -1057,16 +1050,14 @@ Java_sun_awt_windows_WTrayIconPeer__1displayMessage(JNIEnv *env, jobject self, { TRY; - if (IS_WIN2000) { - DisplayMessageStruct *dms = new DisplayMessageStruct; - dms->trayIcon = env->NewGlobalRef(self); - dms->caption = (jstring)env->NewGlobalRef(caption); - dms->text = (jstring)env->NewGlobalRef(text); - dms->msgType = (jstring)env->NewGlobalRef(msgType); + DisplayMessageStruct *dms = new DisplayMessageStruct; + dms->trayIcon = env->NewGlobalRef(self); + dms->caption = (jstring)env->NewGlobalRef(caption); + dms->text = (jstring)env->NewGlobalRef(text); + dms->msgType = (jstring)env->NewGlobalRef(msgType); - AwtToolkit::GetInstance().SyncCall(AwtTrayIcon::_DisplayMessage, dms); - // global ref is deleted in _DisplayMessage - } + AwtToolkit::GetInstance().SyncCall(AwtTrayIcon::_DisplayMessage, dms); + // global ref is deleted in _DisplayMessage CATCH_BAD_ALLOC(NULL); } diff --git a/jdk/src/windows/native/sun/windows/awt_TrayIcon.h b/jdk/src/windows/native/sun/windows/awt_TrayIcon.h index 2db1ab236cf..8ee418aa794 100644 --- a/jdk/src/windows/native/sun/windows/awt_TrayIcon.h +++ b/jdk/src/windows/native/sun/windows/awt_TrayIcon.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 @@ -36,57 +36,11 @@ #define TRAY_ICON_X_HOTSPOT 0 #define TRAY_ICON_Y_HOTSPOT 0 -#define TRAY_ICON_TOOLTIP_MAX_SIZE (IS_WIN2000 ? 128 : 64) +#define TRAY_ICON_TOOLTIP_MAX_SIZE 128 #define TRAY_ICON_BALLOON_TITLE_MAX_SIZE 64 #define TRAY_ICON_BALLOON_INFO_MAX_SIZE 256 -// ********************************************************************** -// The following definitions are duplicates for those from the shellapi.h -// ********************************************************************** - -#define AWT_NOTIFYICON_VERSION 3 - -#define AWT_NIM_SETVERSION 0x00000004 - -#define AWT_NIN_SELECT (WM_USER + 0) -#define AWT_NINF_KEY 0x1 -#define AWT_NIN_KEYSELECT (AWT_NIN_SELECT | AWT_NINF_KEY) -#define AWT_NIN_BALLOONSHOW (WM_USER + 2) -#define AWT_NIN_BALLOONHIDE (WM_USER + 3) -#define AWT_NIN_BALLOONTIMEOUT (WM_USER + 4) -#define AWT_NIN_BALLOONUSERCLICK (WM_USER + 5) - -#define AWT_NIIF_NONE 0x00000000 -#define AWT_NIIF_INFO 0x00000001 -#define AWT_NIIF_WARNING 0x00000002 -#define AWT_NIIF_ERROR 0x00000003 - -#define AWT_NIF_INFO 0x00000010 - -typedef struct _AWT_NOTIFYICONDATA { - DWORD cbSize; - HWND hWnd; - UINT uID; - UINT uFlags; - UINT uCallbackMessage; - HICON hIcon; - TCHAR szTip[128]; - - DWORD dwState; // _WIN32_IE >= 0x0500 - DWORD dwStateMask; - TCHAR szInfo[256]; - union { - UINT uTimeout; - UINT uVersion; - } DUMMYUNIONNAME; - TCHAR szInfoTitle[64]; - DWORD dwInfoFlags; - - GUID guidItem; // _WIN32_IE >= 0x600 -} AWT_NOTIFYICONDATA, *PAWT_NOTIFYICONDATA; - - /************************************************************************ * AwtTrayIcon class */ @@ -174,7 +128,7 @@ public: static int sm_instCount; private: - AWT_NOTIFYICONDATA m_nid; + NOTIFYICONDATA m_nid; /* A bitmask keeps the button's numbers as MK_LBUTTON, MK_MBUTTON, MK_RBUTTON * which are allowed to diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsConfig.cpp b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsConfig.cpp index 6f2f62c3154..2a23bfa9b3e 100644 --- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsConfig.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsConfig.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -23,12 +23,12 @@ * have any questions. */ -#include #include "awt.h" #include #include "awt_Win32GraphicsConfig.h" #include "awt_Canvas.h" #include "awt_Win32GraphicsDevice.h" +#include "Devices.h" //Info for building a ColorModel #include "java_awt_image_DataBuffer.h" @@ -93,8 +93,8 @@ JNIEXPORT jobject JNICALL clazz = env->FindClass("java/awt/Rectangle"); mid = env->GetMethodID(clazz, "", "(IIII)V"); if (mid != 0) { - RECT rRW = {0,0,0,0}; - if( TRUE == ::MonitorBounds(AwtWin32GraphicsDevice::GetMonitor(screen), &rRW) ) { + RECT rRW = {0, 0, 0, 0}; + if (TRUE == MonitorBounds(AwtWin32GraphicsDevice::GetMonitor(screen), &rRW)) { bounds = env->NewObject(clazz, mid, rRW.left, rRW.top, rRW.right - rRW.left, diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp index 6d59689cb0f..aba41a5a4cb 100644 --- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -37,20 +37,17 @@ * array index. */ -#include -#include #include #include #include "awt_Canvas.h" #include "awt_Win32GraphicsDevice.h" -#include "ddrawUtils.h" +#include "awt_Window.h" #include "java_awt_Transparency.h" #include "java_awt_color_ColorSpace.h" #include "sun_awt_Win32GraphicsDevice.h" #include "java_awt_image_DataBuffer.h" #include "dither.h" #include "img_util_md.h" -#include "awt_dlls.h" #include "Devices.h" uns_ordered_dither_array img_oda_alpha; @@ -60,7 +57,6 @@ jclass AwtWin32GraphicsDevice::wToolkitClass; jfieldID AwtWin32GraphicsDevice::dynamicColorModelID; jfieldID AwtWin32GraphicsDevice::indexCMrgbID; jfieldID AwtWin32GraphicsDevice::indexCMcacheID; -jfieldID AwtWin32GraphicsDevice::accelerationEnabledID; jmethodID AwtWin32GraphicsDevice::paletteChangedMID; BOOL AwtWin32GraphicsDevice::primaryPalettized; int AwtWin32GraphicsDevice::primaryIndex = 0; @@ -74,7 +70,7 @@ int AwtWin32GraphicsDevice::primaryIndex = 0; * device, and information on whether the primary device is palettized. */ AwtWin32GraphicsDevice::AwtWin32GraphicsDevice(int screen, - MHND mhnd, Devices *arr) + HMONITOR mhnd, Devices *arr) { this->screen = screen; this->devicesArray = arr; @@ -85,8 +81,8 @@ AwtWin32GraphicsDevice::AwtWin32GraphicsDevice(int screen, cData = NULL; gpBitmapInfo = NULL; monitor = mhnd; - pMonitorInfo = (PMONITOR_INFO)new MONITOR_INFO_EXTENDED; - pMonitorInfo->dwSize = sizeof(MONITOR_INFO_EXTENDED); + pMonitorInfo = new MONITORINFOEX; + pMonitorInfo->cbSize = sizeof(MONITORINFOEX); ::GetMonitorInfo(monitor, pMonitorInfo); // Set primary device info: other devices will need to know @@ -95,7 +91,7 @@ AwtWin32GraphicsDevice::AwtWin32GraphicsDevice(int screen, HDC hDC = this->GetDC(); colorData->bitsperpixel = ::GetDeviceCaps(hDC, BITSPIXEL); this->ReleaseDC(hDC); - if (MONITOR_INFO_FLAG_PRIMARY & pMonitorInfo->dwFlags) { + if (MONITORINFOF_PRIMARY & pMonitorInfo->dwFlags) { primaryIndex = screen; if (colorData->bitsperpixel > 8) { primaryPalettized = FALSE; @@ -126,6 +122,24 @@ AwtWin32GraphicsDevice::~AwtWin32GraphicsDevice() } } +HDC AwtWin32GraphicsDevice::MakeDCFromMonitor(HMONITOR hmMonitor) { + HDC retCode = NULL; + if (NULL != hmMonitor) { + MONITORINFOEX mieInfo; + + memset((void*)(&mieInfo), 0, sizeof(MONITORINFOEX)); + mieInfo.cbSize = sizeof(MONITORINFOEX); + + if (TRUE == ::GetMonitorInfo(hmMonitor, (LPMONITORINFOEX)(&mieInfo))) { + HDC hDC = CreateDC(mieInfo.szDevice, NULL, NULL, NULL); + if (NULL != hDC) { + retCode = hDC; + } + } + } + return retCode; +} + HDC AwtWin32GraphicsDevice::GetDC() { return MakeDCFromMonitor(monitor); @@ -166,7 +180,7 @@ void AwtWin32GraphicsDevice::Initialize() VERIFY(::GetDIBits(hBMDC, hBM, 0, 1, NULL, gpBitmapInfo, DIB_RGB_COLORS)); if (colorData->bitsperpixel > 8) { - if (MONITOR_INFO_FLAG_PRIMARY & pMonitorInfo->dwFlags) { + if (MONITORINFOF_PRIMARY & pMonitorInfo->dwFlags) { primaryPalettized = FALSE; } if (colorData->bitsperpixel != 24) { // 15, 16, or 32 bpp @@ -252,7 +266,7 @@ void AwtWin32GraphicsDevice::Initialize() ((int *)gpBitmapInfo->bmiColors)[2] = 0xff0000; } } else { - if (MONITOR_INFO_FLAG_PRIMARY & pMonitorInfo->dwFlags) { + if (MONITORINFOF_PRIMARY & pMonitorInfo->dwFlags) { primaryPalettized = TRUE; } gpBitmapInfo->bmiHeader.biBitCount = 8; @@ -455,7 +469,7 @@ void AwtWin32GraphicsDevice::SetGrayness(int grayValue) /** * Update our dynamic IndexedColorModel. This happens after * a change to the system palette. Any surfaces stored in vram - * (Win32OffScreenSurfaceData and Win32SurfaceData objects) + * (Win32OffScreenSurfaceData and GDIWindowSurfaceData objects) * refer to this colorModel and use its lookup table and inverse * lookup to calculate correct index values for rgb colors. So * the colorModel must always reflect the current state of the @@ -567,8 +581,8 @@ void AwtWin32GraphicsDevice::RealizePalette(HDC hDC) */ int AwtWin32GraphicsDevice::DeviceIndexForWindow(HWND hWnd) { - MHND mon = MonitorFromWindow(hWnd, MONITOR_DEFAULT_TO_NEAR); - int screen = AwtWin32GraphicsDevice::GetScreenFromMHND(mon); + HMONITOR mon = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST); + int screen = AwtWin32GraphicsDevice::GetScreenFromHMONITOR(mon); return screen; } @@ -602,14 +616,6 @@ void AwtWin32GraphicsDevice::Release() void AwtWin32GraphicsDevice::SetJavaDevice(JNIEnv *env, jobject objPtr) { javaDevice = env->NewWeakGlobalRef(objPtr); - // We may have discovered earlier that the device is not - // accelerated, but there were no way to notify the GraphicsDevice - // about it because the DirectDraw initialization happens before those - // are created (from the static initializer of Win32GraphicsEnvironment). - DDrawObjectStruct *tmpDdInstance = GetDDInstanceForDevice((HMONITOR)monitor); - if (tmpDdInstance == NULL || !tmpDdInstance->accelerated) { - DisableOffscreenAcceleration(); - } } /** @@ -619,10 +625,7 @@ void AwtWin32GraphicsDevice::SetJavaDevice(JNIEnv *env, jobject objPtr) */ void AwtWin32GraphicsDevice::DisableOffscreenAcceleration() { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - if (!JNU_IsNull(env, javaDevice)) { - env->SetBooleanField(javaDevice, accelerationEnabledID, JNI_FALSE); - } + // REMIND: noop for now } /** @@ -658,14 +661,14 @@ jobject AwtWin32GraphicsDevice::GetColorModel(JNIEnv *env, jboolean dynamic, return devices->GetDevice(deviceIndex)->GetColorModel(env, dynamic); } -MONITOR_INFO *AwtWin32GraphicsDevice::GetMonitorInfo(int deviceIndex) +LPMONITORINFO AwtWin32GraphicsDevice::GetMonitorInfo(int deviceIndex) { Devices::InstanceAccess devices; return devices->GetDevice(deviceIndex)->GetMonitorInfo(); } /** - * This function updates the data in the MONITOR_INFO structure pointed to by + * This function updates the data in the MONITORINFOEX structure pointed to by * pMonitorInfo for all monitors on the system. Added for 4654713. */ void AwtWin32GraphicsDevice::ResetAllMonitorInfo() @@ -673,14 +676,14 @@ void AwtWin32GraphicsDevice::ResetAllMonitorInfo() Devices::InstanceAccess devices; int devicesNum = devices->GetNumDevices(); for (int deviceIndex = 0; deviceIndex < devicesNum; deviceIndex++) { - MHND monitor = devices->GetDevice(deviceIndex)->GetMonitor(); + HMONITOR monitor = devices->GetDevice(deviceIndex)->GetMonitor(); ::GetMonitorInfo(monitor, devices->GetDevice(deviceIndex)->pMonitorInfo); } } void AwtWin32GraphicsDevice::DisableOffscreenAccelerationForDevice( - MHND hMonitor) + HMONITOR hMonitor) { Devices::InstanceAccess devices; if (hMonitor == NULL) { @@ -695,24 +698,7 @@ void AwtWin32GraphicsDevice::DisableOffscreenAccelerationForDevice( } } -DxCapabilities *AwtWin32GraphicsDevice::GetDxCapsForDevice(MHND hMonitor) -{ - Devices::InstanceAccess devices; - - if (hMonitor == NULL) { - return devices->GetDevice(0)->GetDxCaps(); - } else { - int devicesNum = devices->GetNumDevices(); - for (int i = 0; i < devicesNum; ++i) { - if (devices->GetDevice(i)->GetMonitor() == hMonitor) { - return devices->GetDevice(i)->GetDxCaps(); - } - } - } - return (DxCapabilities*)NULL; -} - -MHND AwtWin32GraphicsDevice::GetMonitor(int deviceIndex) +HMONITOR AwtWin32GraphicsDevice::GetMonitor(int deviceIndex) { Devices::InstanceAccess devices; return devices->GetDevice(deviceIndex)->GetMonitor(); @@ -771,30 +757,31 @@ HDC AwtWin32GraphicsDevice::GetDCFromScreen(int screen) { return MakeDCFromMonitor(dev->GetMonitor()); } -/** Compare elements of MONITOR_INFO structures for the given MHNDs. +/** Compare elements of MONITORINFOEX structures for the given HMONITORs. * If equal, return TRUE */ -BOOL AwtWin32GraphicsDevice::AreSameMonitors(MHND mon1, MHND mon2) { +BOOL AwtWin32GraphicsDevice::AreSameMonitors(HMONITOR mon1, HMONITOR mon2) { J2dTraceLn2(J2D_TRACE_INFO, "AwtWin32GraphicsDevice::AreSameMonitors mhnd1=%x mhnd2=%x", mon1, mon2); DASSERT(mon1 != NULL); DASSERT(mon2 != NULL); - MONITOR_INFO mi1; - MONITOR_INFO mi2; + MONITORINFOEX mi1; + MONITORINFOEX mi2; - memset((void*)(&mi1),0,sizeof(MONITOR_INFO)); - mi1.dwSize = sizeof(MONITOR_INFO); - memset((void*)(&mi2),0,sizeof(MONITOR_INFO)); - mi2.dwSize = sizeof(MONITOR_INFO); + memset((void*)(&mi1), 0, sizeof(MONITORINFOEX)); + mi1.cbSize = sizeof(MONITORINFOEX); + memset((void*)(&mi2), 0, sizeof(MONITORINFOEX)); + mi2.cbSize = sizeof(MONITORINFOEX); - if (::GetMonitorInfo(mon1,&mi1) != 0 && - ::GetMonitorInfo(mon2,&mi2) != 0 ) { - - if (::EqualRect(&mi1.rMonitor,&mi2.rMonitor) && - ::EqualRect(&mi1.rWork,&mi2.rWork) && - mi1.dwFlags == mi1.dwFlags) { + if (::GetMonitorInfo(mon1, &mi1) != 0 && + ::GetMonitorInfo(mon2, &mi2) != 0 ) + { + if (::EqualRect(&mi1.rcMonitor, &mi2.rcMonitor) && + ::EqualRect(&mi1.rcWork, &mi2.rcWork) && + (mi1.dwFlags == mi1.dwFlags)) + { J2dTraceLn(J2D_TRACE_VERBOSE, " the monitors are the same"); return TRUE; @@ -804,15 +791,15 @@ BOOL AwtWin32GraphicsDevice::AreSameMonitors(MHND mon1, MHND mon2) { return FALSE; } -int AwtWin32GraphicsDevice::GetScreenFromMHND(MHND mon) { +int AwtWin32GraphicsDevice::GetScreenFromHMONITOR(HMONITOR mon) { J2dTraceLn1(J2D_TRACE_INFO, - "AwtWin32GraphicsDevice::GetScreenFromMHND mhnd=%x", mon); + "AwtWin32GraphicsDevice::GetScreenFromHMONITOR mhnd=%x", mon); DASSERT(mon != NULL); Devices::InstanceAccess devices; for (int i = 0; i < devices->GetNumDevices(); i++) { - MHND mhnd = devices->GetDevice(i)->GetMonitor(); + HMONITOR mhnd = devices->GetDevice(i)->GetMonitor(); if (AreSameMonitors(mon, mhnd)) { J2dTraceLn1(J2D_TRACE_VERBOSE, " Found device: %d", i); return i; @@ -820,8 +807,8 @@ int AwtWin32GraphicsDevice::GetScreenFromMHND(MHND mon) { } J2dTraceLn1(J2D_TRACE_WARNING, - "AwtWin32GraphicsDevice::GetScreenFromMHND(): "\ - "couldn't find screen for MHND %x, returning default", mon); + "AwtWin32GraphicsDevice::GetScreenFromHMONITOR(): "\ + "couldn't find screen for HMONITOR %x, returning default", mon); return AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); } @@ -860,8 +847,6 @@ Java_sun_awt_Win32GraphicsDevice_initIDs(JNIEnv *env, jclass cls) AwtWin32GraphicsDevice::indexCMcacheID = env->GetFieldID(AwtWin32GraphicsDevice::indexCMClass, "lookupcache", "[I"); - AwtWin32GraphicsDevice::accelerationEnabledID = - env->GetFieldID(cls, "offscreenAccelerationEnabled", "Z"); /* method ids */ AwtWin32GraphicsDevice::paletteChangedMID = env->GetStaticMethodID( @@ -871,7 +856,6 @@ Java_sun_awt_Win32GraphicsDevice_initIDs(JNIEnv *env, jclass cls) DASSERT(AwtWin32GraphicsDevice::dynamicColorModelID); DASSERT(AwtWin32GraphicsDevice::indexCMrgbID); DASSERT(AwtWin32GraphicsDevice::indexCMcacheID); - DASSERT(AwtWin32GraphicsDevice::accelerationEnabledID); DASSERT(AwtWin32GraphicsDevice::paletteChangedMID); @@ -1012,7 +996,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_Win32GraphicsDevice_getDefaultPixIDImpl JNIEXPORT void JNICALL Java_sun_awt_Win32GraphicsDevice_enterFullScreenExclusive( JNIEnv* env, jobject graphicsDevice, - jboolean useDD, jint screen, jobject windowPeer) { + jint screen, jobject windowPeer) { TRY; @@ -1023,39 +1007,12 @@ Java_sun_awt_Win32GraphicsDevice_enterFullScreenExclusive( // with the WWindowPeer object HWND hWnd = window->GetHWnd(); - if (useDD) { - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - /** - * We call SendMessage with a timeout of 1000 ms because we would like - * this call to be synchronous, but we want to avoid any possibility - * of deadlocking here. - */ - DWORD_PTR eventResult; - LRESULT sendResult; - sendResult = ::SendMessageTimeout(hWnd, WM_AWT_DD_ENTER_FULLSCREEN, - (WPARAM)monitor, NULL, - SMTO_NORMAL, 1000, &eventResult); - if (sendResult == 0) { - // Not the end of the world, but we would like to know about - // it and fix the problem/deadlock if one exists - int error = GetLastError(); - if (error == 0) { - J2dTraceLn(J2D_TRACE_ERROR, - "SendMessage(ENTER_FULLSCREEN) timed out"); - } else { - J2dTraceLn1(J2D_TRACE_ERROR, - "SendMessage(ENTER_FULLSCREEN) failed with error %d", - error); - } - } - } else { - if (!::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE)) - { - J2dTraceLn1(J2D_TRACE_ERROR, - "Error %d setting topmost attribute to fs window", - ::GetLastError()); - } + if (!::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE)) + { + J2dTraceLn1(J2D_TRACE_ERROR, + "Error %d setting topmost attribute to fs window", + ::GetLastError()); } CATCH_BAD_ALLOC; @@ -1070,7 +1027,7 @@ Java_sun_awt_Win32GraphicsDevice_enterFullScreenExclusive( JNIEXPORT void JNICALL Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive( JNIEnv* env, jobject graphicsDevice, - jboolean useDD, jint screen, jobject windowPeer) { + jint screen, jobject windowPeer) { TRY; @@ -1081,52 +1038,25 @@ Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive( // with the WWindowPeer object HWND hWnd = window->GetHWnd(); - if (useDD) { - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - /** - * We call SendMessage with a timeout of 1000 ms because we would like - * this call to be synchronous, but we want to avoid any possibility - * of deadlocking here. - */ - DWORD_PTR eventResult; - LRESULT sendResult; - sendResult = ::SendMessageTimeout(hWnd, WM_AWT_DD_EXIT_FULLSCREEN, - (WPARAM)monitor, NULL, - SMTO_NORMAL, 1000, &eventResult); - if (sendResult == 0) { - // Not the end of the world, but we would like to know about - // it and fix the problem/deadlock if one exists - int error = GetLastError(); - if (error == 0) { - J2dTraceLn(J2D_TRACE_ERROR, - "SendMessage(EXIT_FULLSCREEN) timed out"); - } else { - J2dTraceLn1(J2D_TRACE_ERROR, - "SendMessage(EXIT_FULLSCREEN) failed with error %d", - error); - } - } - } else { - jobject target = env->GetObjectField(windowPeer, AwtObject::targetID); - jboolean alwaysOnTop = JNU_GetFieldByName(env, NULL, target, "alwaysOnTop", "Z").z; - env->DeleteLocalRef(target); + jobject target = env->GetObjectField(windowPeer, AwtObject::targetID); + jboolean alwaysOnTop = JNU_GetFieldByName(env, NULL, target, "alwaysOnTop", "Z").z; + env->DeleteLocalRef(target); - if (!::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, - SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE)) - { - J2dTraceLn1(J2D_TRACE_ERROR, - "Error %d unsetting topmost attribute to fs window", - ::GetLastError()); - } - - // We should restore alwaysOnTop state as it's anyway dropped here - Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, windowPeer, alwaysOnTop); + if (!::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, + SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE)) + { + J2dTraceLn1(J2D_TRACE_ERROR, + "Error %d unsetting topmost attribute to fs window", + ::GetLastError()); } + // We should restore alwaysOnTop state as it's anyway dropped here + Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, windowPeer, alwaysOnTop); + CATCH_BAD_ALLOC; } -static jobject CreateDisplayMode(JNIEnv* env, jint width, jint height, +jobject CreateDisplayMode(JNIEnv* env, jint width, jint height, jint bitDepth, jint refreshRate) { TRY; @@ -1153,24 +1083,6 @@ static jobject CreateDisplayMode(JNIEnv* env, jint width, jint height, CATCH_BAD_ALLOC_RET(NULL); } -/* - * Class: sun_awt_Win32GraphicsDevice - * Method: isDDEnabledOnDeviceNative - * Signature: (I)Z - */ -JNIEXPORT jboolean JNICALL -Java_sun_awt_Win32GraphicsDevice_isDDEnabledOnDeviceNative - (JNIEnv* env, jobject graphicsDevice, jint screen) -{ - TRY; - - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - return DeviceUseDDraw(monitor); - - CATCH_BAD_ALLOC_RET(FALSE); -} - - /** * A utility function which retrieves a DISPLAY_DEVICE information * given a screen number. @@ -1181,19 +1093,19 @@ Java_sun_awt_Win32GraphicsDevice_isDDEnabledOnDeviceNative * of the structure pointed to by lpDisplayDevice is undefined. */ static BOOL -GetAttachedDisplayDevice(int screen, _DISPLAY_DEVICE *lpDisplayDevice) +GetAttachedDisplayDevice(int screen, DISPLAY_DEVICE *lpDisplayDevice) { DWORD dwDeviceNum = 0; - lpDisplayDevice->dwSize = sizeof(_DISPLAY_DEVICE); + lpDisplayDevice->cb = sizeof(DISPLAY_DEVICE); while (EnumDisplayDevices(NULL, dwDeviceNum, lpDisplayDevice, 0) && dwDeviceNum < 20) // avoid infinite loop with buggy drivers { - if (lpDisplayDevice->dwFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) { + if (lpDisplayDevice->StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP) { Devices::InstanceAccess devices; - MONITOR_INFO_EXTENDED *pMonInfo = - (PMONITOR_INFO_EXTENDED) devices->GetDevice(screen)->GetMonitorInfo(); + MONITORINFOEX *pMonInfo = + (LPMONITORINFOEX)devices->GetDevice(screen)->GetMonitorInfo(); // make sure the device names match - if (wcscmp(pMonInfo->strDevice, lpDisplayDevice->strDevName) == 0) { + if (wcscmp(pMonInfo->szDevice, lpDisplayDevice->DeviceName) == 0) { return TRUE; } } @@ -1213,37 +1125,23 @@ Java_sun_awt_Win32GraphicsDevice_getCurrentDisplayMode { TRY; - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - if (DeviceUseDDraw(monitor)) { - DDrawDisplayMode dm; + DEVMODE dm; + LPTSTR pName = NULL; - if (!DDGetDisplayMode(monitor, dm)) { - JNU_ThrowInternalError(env, - "Could not get display mode"); - return NULL; - } + dm.dmSize = sizeof(dm); + dm.dmDriverExtra = 0; - return CreateDisplayMode(env, dm.width, - dm.height, dm.bitDepth, dm.refreshRate); - } else { - DEVMODE dm; - LPTSTR pName = NULL; - - dm.dmSize = sizeof(dm); - dm.dmDriverExtra = 0; - - _DISPLAY_DEVICE displayDevice; - if (GetAttachedDisplayDevice(screen, &displayDevice)) { - pName = displayDevice.strDevName; - } - if (!EnumDisplaySettings(pName, ENUM_CURRENT_SETTINGS, &dm)) - { - return NULL; - } - - return CreateDisplayMode(env, dm.dmPelsWidth, - dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency); + DISPLAY_DEVICE displayDevice; + if (GetAttachedDisplayDevice(screen, &displayDevice)) { + pName = displayDevice.DeviceName; } + if (!EnumDisplaySettings(pName, ENUM_CURRENT_SETTINGS, &dm)) + { + return NULL; + } + + return CreateDisplayMode(env, dm.dmPelsWidth, + dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency); CATCH_BAD_ALLOC_RET(NULL); } @@ -1260,96 +1158,37 @@ Java_sun_awt_Win32GraphicsDevice_configDisplayMode { TRY; - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - if (DeviceUseDDraw(monitor)) { - PDATA pData; - - JNI_CHECK_PEER_RETURN(windowPeer); - - AwtWindow * window = (AwtWindow * )pData; // safe cast; we are called - // with the WWindowPeer object - HWND hWnd = window->GetHWnd(); - - DDrawDisplayMode *dm = new DDrawDisplayMode(width, height, bitDepth, - refreshRate); - - /** - * We call SendMessage with a timeout of 1000 ms because we would like - * this call to be synchronous, but we want to avoid any possibility - * of deadlocking here. - * Also, note that we have to free the dm object in the message - * processing code since we may return from the SendMessageTimeout - * before that object has been used. - */ - DWORD_PTR eventResult; - LRESULT sendResult; - sendResult = ::SendMessageTimeout(hWnd, WM_AWT_DD_SET_DISPLAY_MODE, - (WPARAM)monitor, (LPARAM)dm, - SMTO_NORMAL, 1000, &eventResult); - if (sendResult == 0) { - // Not the end of the world, but we would like to know about - // it and fix the problem/deadlock if one exists - int error = GetLastError(); - if (error == 0) { - J2dTraceLn(J2D_TRACE_ERROR, - "SendMessage(SET_DISPLAY_MODE) timed out"); - } else { - J2dTraceLn1(J2D_TRACE_ERROR, - "SendMessage(SET_DISPLAY_MODE) failed with error %d", - error); - } - } else { - // see comment in awt_Window.cpp WmDDEnterFullScreenMode - // Since the event to reshape the window will come to the owner - // frame, we need to reshape the window by ourselves. - // Note that we do not need to reshape it on the exit - // from full screen mode, this is already handled in - // GraphicsDevice.setFullScreenWindow . - if (window->GetOwningFrameOrDialog() != NULL) { - RECT* r = new RECT; - ::SetRect(r, 0, 0, width, height); - window->SendMessage(WM_AWT_RESHAPE_COMPONENT, 0, (LPARAM)r); - } - } - } else { DEVMODE dm; - dm.dmSize = sizeof(dm); - dm.dmDriverExtra = 0; - dm.dmPelsWidth = width; - dm.dmPelsHeight = height; - dm.dmBitsPerPel = bitDepth; - dm.dmDisplayFrequency = refreshRate; - dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | - DM_BITSPERPEL | DM_DISPLAYFREQUENCY; + dm.dmSize = sizeof(dm); + dm.dmDriverExtra = 0; + dm.dmPelsWidth = width; + dm.dmPelsHeight = height; + dm.dmBitsPerPel = bitDepth; + dm.dmDisplayFrequency = refreshRate; + dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | + DM_BITSPERPEL | DM_DISPLAYFREQUENCY; - // ChangeDisplaySettings works only on the primary screen. - // ChangeDisplaySettingsEx is not available on NT, - // so it'd be nice not to break it if we can help it. - if (screen == AwtWin32GraphicsDevice::GetDefaultDeviceIndex()) { - if (ChangeDisplaySettings(&dm, CDS_FULLSCREEN) != - DISP_CHANGE_SUCCESSFUL) - { - JNU_ThrowInternalError(env, - "Could not set display mode"); - } - return; - } - - // make sure the function pointer for fn_change_display_settings_ex - // is initialized - load_user_procs(); - - _DISPLAY_DEVICE displayDevice; - if (fn_change_display_settings_ex == NULL || - !GetAttachedDisplayDevice(screen, &displayDevice) || - ((*fn_change_display_settings_ex) - (displayDevice.strDevName, &dm, NULL, CDS_FULLSCREEN, NULL) != - DISP_CHANGE_SUCCESSFUL)) + // ChangeDisplaySettings works only on the primary screen. + // ChangeDisplaySettingsEx is not available on NT, + // so it'd be nice not to break it if we can help it. + if (screen == AwtWin32GraphicsDevice::GetDefaultDeviceIndex()) { + if (::ChangeDisplaySettings(&dm, CDS_FULLSCREEN) != + DISP_CHANGE_SUCCESSFUL) { JNU_ThrowInternalError(env, "Could not set display mode"); } + return; + } + + DISPLAY_DEVICE displayDevice; + if (!GetAttachedDisplayDevice(screen, &displayDevice) || + (::ChangeDisplaySettingsEx(displayDevice.DeviceName, &dm, NULL, CDS_FULLSCREEN, NULL) != + DISP_CHANGE_SUCCESSFUL)) + { + JNU_ThrowInternalError(env, + "Could not set display mode"); } CATCH_BAD_ALLOC; @@ -1362,7 +1201,7 @@ public: jobject arrayList; }; -static void addDisplayMode(JNIEnv* env, jobject arrayList, jint width, +void addDisplayMode(JNIEnv* env, jobject arrayList, jint width, jint height, jint bitDepth, jint refreshRate) { TRY; @@ -1390,22 +1229,6 @@ static void addDisplayMode(JNIEnv* env, jobject arrayList, jint width, CATCH_BAD_ALLOC; } -static void enumDMCallback(DDrawDisplayMode& dm, void* pContext) { - - TRY; - - EnumDisplayModeParam* pParam = (EnumDisplayModeParam*)pContext; - JNIEnv* env = pParam->env; - jobject arrayList = pParam->arrayList; - - if (dm.bitDepth >= 8) { - addDisplayMode(env, arrayList, dm.width, dm.height, - dm.bitDepth, dm.refreshRate); - } - - CATCH_BAD_ALLOC; -} - /* * Class: sun_awt_Win32GraphicsDevice * Method: enumDisplayModes @@ -1417,72 +1240,30 @@ JNIEXPORT void JNICALL Java_sun_awt_Win32GraphicsDevice_enumDisplayModes TRY; - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - if (DeviceUseDDraw(monitor)) { - EnumDisplayModeParam param(env, arrayList); - - if (!DDEnumDisplayModes(monitor, NULL, enumDMCallback, ¶m)) { - JNU_ThrowInternalError(env, - "Could not get display modes"); - return; - } - } else { - DEVMODE dm; - LPTSTR pName = NULL; - _DISPLAY_DEVICE displayDevice; + DEVMODE dm; + LPTSTR pName = NULL; + DISPLAY_DEVICE displayDevice; - if (GetAttachedDisplayDevice(screen, &displayDevice)) { - pName = displayDevice.strDevName; - } + if (GetAttachedDisplayDevice(screen, &displayDevice)) { + pName = displayDevice.DeviceName; + } - dm.dmSize = sizeof(dm); - dm.dmDriverExtra = 0; + dm.dmSize = sizeof(dm); + dm.dmDriverExtra = 0; - BOOL bContinue = TRUE; - for (int i = 0; bContinue; i++) { - bContinue = EnumDisplaySettings(pName, i, &dm); - if (dm.dmBitsPerPel >= 8) { - addDisplayMode(env, arrayList, dm.dmPelsWidth, dm.dmPelsHeight, - dm.dmBitsPerPel, dm.dmDisplayFrequency); - } + BOOL bContinue = TRUE; + for (int i = 0; bContinue; i++) { + bContinue = EnumDisplaySettings(pName, i, &dm); + if (dm.dmBitsPerPel >= 8) { + addDisplayMode(env, arrayList, dm.dmPelsWidth, dm.dmPelsHeight, + dm.dmBitsPerPel, dm.dmDisplayFrequency); } } CATCH_BAD_ALLOC; } -void checkDMCallback(DDrawDisplayMode& dm, void* pContext) { - jboolean* isCalled = (jboolean*)pContext; - *isCalled = JNI_TRUE; -} - -/* - * Class: sun_awt_Win32GraphicsDevice - * Method: isDisplayModeAvailable - * Signature: (IIII)Z - */ -JNIEXPORT jboolean JNICALL Java_sun_awt_Win32GraphicsDevice_isDisplayModeAvailable - (JNIEnv* env, jobject graphicsDevice, jint screen, jint width, jint height, - jint bitDepth, jint refreshRate) { - - TRY; - - DDrawDisplayMode dm(width, height, bitDepth, refreshRate); - jboolean isCalled = JNI_FALSE; - HMONITOR monitor = (HMONITOR)AwtWin32GraphicsDevice::GetMonitor(screen); - - if (!DDEnumDisplayModes(monitor, &dm, checkDMCallback, &isCalled)) { - JNU_ThrowInternalError(env, - "Could not get display modes"); - return JNI_FALSE; - } - - return isCalled; - - CATCH_BAD_ALLOC_RET(JNI_FALSE); -} - /* * Class: sun_awt_Win32GraphicsDevice * Method: makeColorModel @@ -1509,17 +1290,3 @@ JNIEXPORT void JNICALL Devices::InstanceAccess devices; devices->GetDevice(screen)->SetJavaDevice(env, thisPtr); } - -/* - * Class: sun_awt_Win32GraphicsDevice - * Method: getDeviceMemoryNative - * Signature: (I)I - */ -JNIEXPORT jint JNICALL - Java_sun_awt_Win32GraphicsDevice_getDeviceMemoryNative - (JNIEnv *env, jobject thisPtr, jint screen) -{ - Devices::InstanceAccess devices; - return DDGetAvailableMemory( - (HMONITOR)devices->GetDevice(screen)->GetMonitor()); -} diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.h b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.h index 152dc9f5b34..42a7ff18029 100644 --- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.h +++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.h @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 @@ -32,16 +32,14 @@ extern "C" { } // extern "C" #include "colordata.h" #include "awt_Palette.h" -#include "awt_MMStub.h" #include "Devices.h" -#include "dxCapabilities.h" class AwtPalette; class Devices; class AwtWin32GraphicsDevice { public: - AwtWin32GraphicsDevice(int screen, MHND mhnd, Devices *arr); + AwtWin32GraphicsDevice(int screen, HMONITOR mhnd, Devices *arr); ~AwtWin32GraphicsDevice(); void UpdateDeviceColorState(); void SetGrayness(int grayValue); @@ -61,9 +59,8 @@ public: HPALETTE GetPalette(); ColorData *GetColorData() { return cData; } int GetBitDepth() { return colorData->bitsperpixel; } - MHND GetMonitor() { return monitor; } - MONITOR_INFO *GetMonitorInfo() { return pMonitorInfo; } - DxCapabilities *GetDxCaps() { return &dxCaps; } + HMONITOR GetMonitor() { return monitor; } + LPMONITORINFO GetMonitorInfo() { return pMonitorInfo; } jobject GetJavaDevice() { return javaDevice; } int GetDeviceIndex() { return screen; } void Release(); @@ -80,15 +77,14 @@ public: static void UpdateDynamicColorModel(int deviceIndex); static BOOL UpdateSystemPalette(int deviceIndex); static HPALETTE GetPalette(int deviceIndex); - static MHND GetMonitor(int deviceIndex); - static MONITOR_INFO *GetMonitorInfo(int deviceIndex); + static HMONITOR GetMonitor(int deviceIndex); + static LPMONITORINFO GetMonitorInfo(int deviceIndex); static void ResetAllMonitorInfo(); static BOOL IsPrimaryPalettized() { return primaryPalettized; } static int GetDefaultDeviceIndex() { return primaryIndex; } - static void DisableOffscreenAccelerationForDevice(MHND hMonitor); - static DxCapabilities *GetDxCapsForDevice(MHND hMonitor); + static void DisableOffscreenAccelerationForDevice(HMONITOR hMonitor); static HDC GetDCFromScreen(int screen); - static int GetScreenFromMHND(MHND mon); + static int GetScreenFromHMONITOR(HMONITOR mon); static int primaryIndex; static BOOL primaryPalettized; @@ -97,22 +93,22 @@ public: static jfieldID dynamicColorModelID; static jfieldID indexCMrgbID; static jfieldID indexCMcacheID; - static jfieldID accelerationEnabledID; static jmethodID paletteChangedMID; private: - static BOOL AreSameMonitors(MHND mon1, MHND mon2); + static BOOL AreSameMonitors(HMONITOR mon1, HMONITOR mon2); ImgColorData *colorData; AwtPalette *palette; ColorData *cData; // Could be static, but may sometime // have per-device info in this structure BITMAPINFO *gpBitmapInfo; int screen; - MHND monitor; - MONITOR_INFO *pMonitorInfo; + HMONITOR monitor; + LPMONITORINFO pMonitorInfo; jobject javaDevice; Devices *devicesArray; - DxCapabilities dxCaps; + + static HDC MakeDCFromMonitor(HMONITOR); }; #endif AWT_WIN32GRAPHICSDEVICE_H diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp index 89e488c3324..1617d54e657 100644 --- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -23,15 +23,14 @@ * have any questions. */ -#include -#include #include #include #include "awt_Canvas.h" #include "awt_Win32GraphicsDevice.h" #include "Devices.h" #include "WindowsFlags.h" -#include "dxInit.h" + +BOOL DWMIsCompositionEnabled(); void initScreens(JNIEnv *env) { @@ -39,8 +38,6 @@ void initScreens(JNIEnv *env) { JNU_ThrowInternalError(env, "Could not update the devices array."); return; } - - InitDirectX(); } /** @@ -54,7 +51,7 @@ void initScreens(JNIEnv *env) { static void SetProcessDPIAwareProperty() { - typedef BOOL SetProcessDPIAwareFunc(void); + typedef BOOL (WINAPI SetProcessDPIAwareFunc)(void); static BOOL bAlreadySet = FALSE; // setHighDPIAware is set in WindowsFlags.cpp @@ -64,7 +61,7 @@ SetProcessDPIAwareProperty() bAlreadySet = TRUE; - HINSTANCE hLibUser32Dll = ::LoadLibrary(TEXT("user32.dll")); + HMODULE hLibUser32Dll = ::LoadLibrary(TEXT("user32.dll")); if (hLibUser32Dll != NULL) { SetProcessDPIAwareFunc *lpSetProcessDPIAware = @@ -77,6 +74,76 @@ SetProcessDPIAwareProperty() } } +#define DWM_COMP_UNDEFINED (~(TRUE|FALSE)) +static int dwmIsCompositionEnabled = DWM_COMP_UNDEFINED; + +/** + * This function is called from toolkit event handling code when + * WM_DWMCOMPOSITIONCHANGED event is received + */ +void DWMResetCompositionEnabled() { + dwmIsCompositionEnabled = DWM_COMP_UNDEFINED; + (void)DWMIsCompositionEnabled(); +} + +/** + * Returns true if dwm composition is enabled, false if it is not applicable + * (if the OS is not Vista) or dwm composition is disabled. + * + * Note: since DWM composition state changes are very rare we load/unload the + * dll on every change. + */ +BOOL DWMIsCompositionEnabled() { + typedef HRESULT (WINAPI DwmIsCompositionEnabledFunc)(BOOL*); + + // cheaper to check than whether it's vista or not + if (dwmIsCompositionEnabled != DWM_COMP_UNDEFINED) { + return (BOOL)dwmIsCompositionEnabled; + } + + if (!IS_WINVISTA) { + dwmIsCompositionEnabled = FALSE; + return FALSE; + } + + BOOL bRes = FALSE; + HMODULE hDwmApiDll = ::LoadLibrary(TEXT("dwmapi.dll")); + + if (hDwmApiDll != NULL) { + DwmIsCompositionEnabledFunc *lpDwmIsCompEnabled = + (DwmIsCompositionEnabledFunc*) + GetProcAddress(hDwmApiDll, "DwmIsCompositionEnabled"); + if (lpDwmIsCompEnabled != NULL) { + BOOL bEnabled; + HRESULT res = lpDwmIsCompEnabled(&bEnabled); + if (SUCCEEDED(res)) { + bRes = bEnabled; + J2dTraceLn1(J2D_TRACE_VERBOSE, " composition enabled: %d",bRes); + } else { + J2dTraceLn1(J2D_TRACE_ERROR, + "IsDWMCompositionEnabled: error %x when detecting"\ + "if composition is enabled", res); + } + } else { + J2dTraceLn(J2D_TRACE_ERROR, + "IsDWMCompositionEnabled: no DwmIsCompositionEnabled() "\ + "in dwmapi.dll"); + } + ::FreeLibrary(hDwmApiDll); + } else { + J2dTraceLn(J2D_TRACE_ERROR, + "IsDWMCompositionEnabled: error opening dwmapi.dll"); + } + + dwmIsCompositionEnabled = bRes; + + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + JNU_CallStaticMethodByName(env, NULL, + "sun/awt/Win32GraphicsEnvironment", + "dwmCompositionChanged", "(Z)V", (jboolean)bRes); + return bRes; +} + /* * Class: sun_awt_Win32GraphicsEnvironment * Method: initDisplay @@ -89,6 +156,8 @@ Java_sun_awt_Win32GraphicsEnvironment_initDisplay(JNIEnv *env, // This method needs to be called prior to any display-related activity SetProcessDPIAwareProperty(); + DWMIsCompositionEnabled(); + initScreens(env); } @@ -117,44 +186,6 @@ Java_sun_awt_Win32GraphicsEnvironment_getDefaultScreen(JNIEnv *env, return AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); } -#define FR_PRIVATE 0x10 /* from wingdi.h */ -typedef int (WINAPI *AddFontResourceExType)(LPCTSTR,DWORD,VOID*); -typedef int (WINAPI *RemoveFontResourceExType)(LPCTSTR,DWORD,VOID*); - -static AddFontResourceExType procAddFontResourceEx = NULL; -static RemoveFontResourceExType procRemoveFontResourceEx = NULL; - -static int winVer = -1; - -static int getWinVer() { - if (winVer == -1) { - OSVERSIONINFO osvi; - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - winVer = osvi.dwMajorVersion; - if (winVer >= 5) { - // REMIND verify on 64 bit windows - HMODULE hGDI = LoadLibrary(TEXT("gdi32.dll")); - if (hGDI != NULL) { - procAddFontResourceEx = - (AddFontResourceExType)GetProcAddress(hGDI,"AddFontResourceExW"); - if (procAddFontResourceEx == NULL) { - winVer = 0; - } - procRemoveFontResourceEx = - (RemoveFontResourceExType)GetProcAddress(hGDI, - "RemoveFontResourceExW"); - if (procRemoveFontResourceEx == NULL) { - winVer = 0; - } - FreeLibrary(hGDI); - } - } - } - - return winVer; -} - /* * Class: sun_awt_Win32GraphicsEnvironment * Method: registerFontWithPlatform @@ -165,9 +196,10 @@ Java_sun_awt_Win32GraphicsEnvironment_registerFontWithPlatform(JNIEnv *env, jclass cl, jstring fontName) { - if (getWinVer() >= 5 && procAddFontResourceEx != NULL) { - LPTSTR file = (LPTSTR)JNU_GetStringPlatformChars(env, fontName, NULL); - (*procAddFontResourceEx)(file, FR_PRIVATE, NULL); + LPTSTR file = (LPTSTR)JNU_GetStringPlatformChars(env, fontName, JNI_FALSE); + if (file) { + ::AddFontResourceEx(file, FR_PRIVATE, NULL); + JNU_ReleaseStringPlatformChars(env, fontName, file); } } @@ -184,9 +216,10 @@ Java_sun_awt_Win32GraphicsEnvironment_deRegisterFontWithPlatform(JNIEnv *env, jclass cl, jstring fontName) { - if (getWinVer() >= 5 && procRemoveFontResourceEx != NULL) { - LPTSTR file = (LPTSTR)JNU_GetStringPlatformChars(env, fontName, NULL); - (*procRemoveFontResourceEx)(file, FR_PRIVATE, NULL); + LPTSTR file = (LPTSTR)JNU_GetStringPlatformChars(env, fontName, JNI_FALSE); + if (file) { + ::RemoveFontResourceEx(file, FR_PRIVATE, NULL); + JNU_ReleaseStringPlatformChars(env, fontName, file); } } @@ -306,3 +339,14 @@ Java_sun_awt_Win32GraphicsEnvironment_getYResolution(JNIEnv *env, jobject wge) CATCH_BAD_ALLOC_RET(0); } + +/* + * Class: sun_awt_Win32GraphicsEnvironment + * Method: isVistaOS + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_sun_awt_Win32GraphicsEnvironment_isVistaOS + (JNIEnv *env, jclass wgeclass) +{ + return IS_WINVISTA; +} diff --git a/jdk/src/windows/native/sun/windows/awt_Window.cpp b/jdk/src/windows/native/sun/windows/awt_Window.cpp index 2d94c779309..0c9bce1210d 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Window.cpp @@ -23,7 +23,7 @@ * have any questions. */ -#include +#include "awt.h" #include "awt_Component.h" #include "awt_Container.h" @@ -32,8 +32,6 @@ #include "awt_Panel.h" #include "awt_Toolkit.h" #include "awt_Window.h" -#include "awt_dlls.h" -#include "ddrawUtils.h" #include "awt_Win32GraphicsDevice.h" #include "awt_BitmapUtil.h" #include "awt_IconCursor.h" @@ -43,6 +41,8 @@ #include #include "sun_awt_windows_WCanvasPeer.h" +#include + #if !defined(__int3264) typedef __int32 LONG_PTR; #endif // __int3264 @@ -502,8 +502,7 @@ void AwtWindow::Show() // which might involve tagging java.awt.Window instances with a semantic // property so platforms can animate/decorate/etc accordingly. // - if ((IS_WIN98 || IS_WIN2000) && - JNU_IsInstanceOfByName(env, target, "com/sun/java/swing/plaf/windows/WindowsPopupWindow") > 0) + if (JNU_IsInstanceOfByName(env, target, "com/sun/java/swing/plaf/windows/WindowsPopupWindow") > 0) { // need this global ref to make the class unloadable (see 6500204) static jclass windowsPopupWindowCls; @@ -536,13 +535,8 @@ void AwtWindow::Show() windowType = env->GetIntField(target, windowTypeFID); if (windowType == windowTYPES[TOOLTIP]) { - if (IS_WIN2000) { - SystemParametersInfo(SPI_GETTOOLTIPANIMATION, 0, &animateflag, 0); - SystemParametersInfo(SPI_GETTOOLTIPFADE, 0, &fadeflag, 0); - } else { - // use same setting as menus - SystemParametersInfo(SPI_GETMENUANIMATION, 0, &animateflag, 0); - } + SystemParametersInfo(SPI_GETTOOLTIPANIMATION, 0, &animateflag, 0); + SystemParametersInfo(SPI_GETTOOLTIPFADE, 0, &fadeflag, 0); if (animateflag) { // AW_BLEND currently produces runtime parameter error // animateStyle = fadeflag? AW_BLEND : AW_SLIDE | AW_VER_POSITIVE; @@ -552,13 +546,10 @@ void AwtWindow::Show() windowType == windowTYPES[POPUPMENU]) { SystemParametersInfo(SPI_GETMENUANIMATION, 0, &animateflag, 0); if (animateflag) { - - if (IS_WIN2000) { - SystemParametersInfo(SPI_GETMENUFADE, 0, &fadeflag, 0); - if (fadeflag) { - // AW_BLEND currently produces runtime parameter error - //animateStyle = AW_BLEND; - } + SystemParametersInfo(SPI_GETMENUFADE, 0, &fadeflag, 0); + if (fadeflag) { + // AW_BLEND currently produces runtime parameter error + //animateStyle = AW_BLEND; } if (animateStyle == 0 && !fadeflag) { animateStyle = AW_SLIDE; @@ -579,38 +570,18 @@ void AwtWindow::Show() } if (animateStyle != 0) { - load_user_procs(); - - if (fn_animate_window != NULL) { - BOOL result = (*fn_animate_window)(hWnd, (DWORD)200, animateStyle); - if (result == 0) { - LPTSTR msgBuffer = NULL; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&msgBuffer, // it's an output parameter when allocate buffer is used - 0, - NULL); - - if (msgBuffer == NULL) { - msgBuffer = TEXT(""); - } - _ftprintf(stderr,TEXT("AwtWindow::Show: AnimateWindow: ")); - _ftprintf(stderr,msgBuffer); - LocalFree(msgBuffer); - } else { - // WM_PAINT is not automatically sent when invoking AnimateWindow, - // so force an expose event - RECT rect; - ::GetWindowRect(hWnd,&rect); - ::ScreenToClient(hWnd, (LPPOINT)&rect); - ::InvalidateRect(hWnd,&rect,TRUE); - ::UpdateWindow(hWnd); - done = TRUE; - } + BOOL result = ::AnimateWindow(hWnd, (DWORD)200, animateStyle); + if (!result) { + // TODO: log message + } else { + // WM_PAINT is not automatically sent when invoking AnimateWindow, + // so force an expose event + RECT rect; + ::GetWindowRect(hWnd,&rect); + ::ScreenToClient(hWnd, (LPPOINT)&rect); + ::InvalidateRect(hWnd, &rect, TRUE); + ::UpdateWindow(hWnd); + done = TRUE; } } } @@ -742,7 +713,7 @@ BOOL AwtWindow::UpdateInsets(jobject insets) insetsChanged = !::EqualRect( &m_old_insets, &m_insets ); ::CopyRect( &m_old_insets, &m_insets ); - if (insetsChanged && DDCanReplaceSurfaces(GetHWnd())) { + if (insetsChanged) { // Since insets are changed we need to update the surfaceData object // to reflect that change env->CallVoidMethod(peer, AwtComponent::replaceSurfaceDataLaterMID); @@ -931,50 +902,6 @@ void AwtWindow::BounceActivation(void *self) { } } -MsgRouting AwtWindow::WmDDEnterFullScreen(HMONITOR monitor) { - /** - * DirectDraw expects to receive a top-level window. This object may - * be an AwtWindow instance, which has an owning AwtFrame window, or - * an AwtFrame object which does not have an owner. - * What we want is the top-level Frame hWnd, whether we were handed a - * top-level AwtFrame, or some owned AwtWindow. We get this by calling - * GetTopLevelHWnd(), which returns the hwnd of a top-level AwtFrame - * object (if this window has an owner) which we then pass - * into DirectDraw. - */ - HWND hWnd = GetTopLevelHWnd(); - if (!::IsWindowVisible(hWnd)) { - // Sometimes there are problems going into fullscreen on an owner frame - // that is not yet visible; make sure the FS window is visible first - ::ShowWindow(hWnd, SW_SHOWNA); - } - /* - * Fix for 6225472. - * Non-focusable window should be set alwaysOnTop to overlap the taskbar. - */ - AwtWindow* window = (AwtWindow *)AwtComponent::GetComponent(GetHWnd()); - if (window != NULL && !window->IsFocusableWindow()) { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, GetPeer(env), (jboolean)TRUE); - } - - DDEnterFullScreen(monitor, GetHWnd(), hWnd); - return mrDoDefault; -} - -MsgRouting AwtWindow::WmDDExitFullScreen(HMONITOR monitor) { - HWND hWnd = GetTopLevelHWnd(); - DDExitFullScreen(monitor, hWnd); - - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - jboolean alwaysOnTop = JNU_CallMethodByName(env, NULL, GetTarget(env), - "isAlwaysOnTop", "()Z").z; - - // We should restore alwaysOnTop state as it's anyway dropped here. - Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, GetPeer(env), alwaysOnTop); - return mrDoDefault; -} - MsgRouting AwtWindow::WmCreate() { return mrDoDefault; @@ -1250,16 +1177,17 @@ MsgRouting AwtWindow::WmNcPaint(HRGN hrgn) } /* draw warning text */ - LPWSTR text = TO_WSTRING(warningString); + LPCWSTR text = JNU_GetStringPlatformChars(env, warningString, NULL); VERIFY(::SetBkColor(hDC, ::GetSysColor(COLOR_BTNFACE)) != CLR_INVALID); VERIFY(::SetTextColor(hDC, ::GetSysColor(COLOR_BTNTEXT)) != CLR_INVALID); VERIFY(::SelectObject(hDC, ::GetStockObject(DEFAULT_GUI_FONT)) != NULL); VERIFY(::SetTextAlign(hDC, TA_LEFT | TA_BOTTOM) != GDI_ERROR); - VERIFY(::ExtTextOutW(hDC, r.left+2, r.bottom-1, + VERIFY(::ExtTextOut(hDC, r.left+2, r.bottom-1, ETO_CLIPPED | ETO_OPAQUE, &r, text, static_cast(wcslen(text)), NULL)); VERIFY(::RestoreDC(hDC, iSaveDC)); ::ReleaseDC(GetHWnd(), hDC); + JNU_ReleaseStringPlatformChars(env, warningString, text); } env->DeleteLocalRef(target); @@ -1333,10 +1261,8 @@ void AwtWindow::WindowResized() SendComponentEvent(java_awt_event_ComponentEvent_COMPONENT_RESIZED); // Need to replace surfaceData on resize to catch changes to // various component-related values, such as insets - if (DDCanReplaceSurfaces(GetHWnd())) { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - env->CallVoidMethod(m_peerObject, AwtComponent::replaceSurfaceDataLaterMID); - } + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); + env->CallVoidMethod(m_peerObject, AwtComponent::replaceSurfaceDataLaterMID); } BOOL CALLBACK InvalidateChildRect(HWND hWnd, LPARAM) @@ -1407,13 +1333,13 @@ void AwtWindow::RedrawNonClient() } int AwtWindow::GetScreenImOn() { - MHND hmon; + HMONITOR hmon; int scrnNum; - hmon = ::MonitorFromWindow(GetHWnd(), MONITOR_DEFAULT_TO_PRIMARY); + hmon = ::MonitorFromWindow(GetHWnd(), MONITOR_DEFAULTTOPRIMARY); DASSERT(hmon != NULL); - scrnNum = AwtWin32GraphicsDevice::GetScreenFromMHND(hmon); + scrnNum = AwtWin32GraphicsDevice::GetScreenFromHMONITOR(hmon); DASSERT(scrnNum > -1); return scrnNum; @@ -1666,10 +1592,10 @@ void AwtWindow::_SetTitle(void *param) if (::IsWindow(w->GetHWnd())) { int length = env->GetStringLength(title); - WCHAR *buffer = new WCHAR[length + 1]; - env->GetStringRegion(title, 0, length, buffer); + TCHAR *buffer = new TCHAR[length + 1]; + env->GetStringRegion(title, 0, length, reinterpret_cast(buffer)); buffer[length] = L'\0'; - VERIFY(::SetWindowTextW(w->GetHWnd(), buffer)); + VERIFY(::SetWindowText(w->GetHWnd(), buffer)); delete[] buffer; } ret: @@ -2014,13 +1940,11 @@ void AwtWindow::_SetFocusableWindow(void *param) window->m_isFocusableWindow = isFocusableWindow; - if (IS_WIN2000) { - if (!window->m_isFocusableWindow) { - LONG isPopup = window->GetStyle() & WS_POPUP; - window->SetStyleEx(window->GetStyleEx() | (isPopup ? 0 : WS_EX_APPWINDOW) | AWT_WS_EX_NOACTIVATE); - } else { - window->SetStyleEx(window->GetStyleEx() & ~WS_EX_APPWINDOW & ~AWT_WS_EX_NOACTIVATE); - } + if (!window->m_isFocusableWindow) { + LONG isPopup = window->GetStyle() & WS_POPUP; + window->SetStyleEx(window->GetStyleEx() | (isPopup ? 0 : WS_EX_APPWINDOW) | AWT_WS_EX_NOACTIVATE); + } else { + window->SetStyleEx(window->GetStyleEx() & ~WS_EX_APPWINDOW & ~AWT_WS_EX_NOACTIVATE); } ret: diff --git a/jdk/src/windows/native/sun/windows/awt_Window.h b/jdk/src/windows/native/sun/windows/awt_Window.h index bc706d97aeb..9a252a25ce1 100644 --- a/jdk/src/windows/native/sun/windows/awt_Window.h +++ b/jdk/src/windows/native/sun/windows/awt_Window.h @@ -161,8 +161,6 @@ public: virtual MsgRouting WmClose(); virtual MsgRouting WmDestroy(); virtual MsgRouting WmShowWindow(BOOL show, UINT status); - virtual MsgRouting WmDDEnterFullScreen(HMONITOR monitor); - virtual MsgRouting WmDDExitFullScreen(HMONITOR monitor); virtual MsgRouting WmGetMinMaxInfo(LPMINMAXINFO lpmmi); virtual MsgRouting WmMove(int x, int y); virtual MsgRouting WmSize(UINT type, int w, int h); diff --git a/jdk/src/windows/native/sun/windows/awt_dlls.cpp b/jdk/src/windows/native/sun/windows/awt_dlls.cpp deleted file mode 100644 index 26af4196dd9..00000000000 --- a/jdk/src/windows/native/sun/windows/awt_dlls.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright 1999-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. - */ - -#include "awt.h" -#include "awt_dlls.h" - -/* - * To reduce memory footprint we don't statically link to COMDLG32.DLL - * and SHELL32. Instead we programatically load them only when they are - * needed. - */ - -PrintDlgType AwtCommDialog::do_print_dlg; -PageSetupDlgType AwtCommDialog::do_page_setup_dlg; -GetOpenFileNameType AwtCommDialog::get_open_file_name; -GetSaveFileNameType AwtCommDialog::get_save_file_name; -GetExtendedErrorType AwtCommDialog::get_dlg_extended_error; - -/***********************************************************************/ - -DWORD -AwtCommDialog::CommDlgExtendedError(VOID) { - AwtCommDialog::load_comdlg_procs(); - return static_cast(reinterpret_cast( - AwtToolkit::GetInstance(). - InvokeFunction(reinterpret_cast - (AwtCommDialog::GetExtendedErrorWrapper)))); -} - -BOOL -AwtCommDialog::PrintDlg(LPPRINTDLG data) { - AwtCommDialog::load_comdlg_procs(); - return static_cast(reinterpret_cast( - AwtToolkit::GetInstance(). - InvokeFunction(reinterpret_cast - (AwtCommDialog::PrintDlgWrapper), data))); -} - -BOOL -AwtCommDialog::PageSetupDlg(LPPAGESETUPDLG data) { - AwtCommDialog::load_comdlg_procs(); - return static_cast(reinterpret_cast( - AwtToolkit::GetInstance(). - InvokeFunction(reinterpret_cast - (AwtCommDialog::PageSetupDlgWrapper), data))); -} - -/* - * Load the COMDLG32.dll and get pointers to various procedures. - */ - -void -AwtCommDialog::load_comdlg_procs() -{ - static int initialized = 0; - HMODULE lib = NULL; - if (initialized) { - return; - } - lib = LoadLibrary(TEXT("COMDLG32.DLL")); - HMODULE libUnicows = UnicowsLoader::GetModuleHandle(); - do_print_dlg = (PrintDlgType)GetProcAddress(IS_WIN95 ? libUnicows : lib, "PrintDlgW"); - do_page_setup_dlg = (PageSetupDlgType)GetProcAddress(IS_WIN95 ? libUnicows : lib, "PageSetupDlgW"); - get_open_file_name = (GetOpenFileNameType)GetProcAddress(IS_WIN95 ? libUnicows : lib, "GetOpenFileNameW"); - get_save_file_name = (GetSaveFileNameType)GetProcAddress(IS_WIN95 ? libUnicows : lib, "GetSaveFileNameW"); - get_dlg_extended_error = (GetExtendedErrorType)GetProcAddress(lib, "CommDlgExtendedError"); - initialized = 1; -} - -/***********************************************************************/ - -DragQueryFileType do_drag_query_file; -GetPathFromIDListType get_path_from_idlist; - -/* - * Load the SHELL32.dll and get pointers to various procedures. - */ - -void -load_shell_procs() -{ - static int initialized = 0; - HMODULE lib = NULL; - if (initialized) { - return; - } - - if (IS_WIN95) { - lib = UnicowsLoader::GetModuleHandle(); - } else { - lib = LoadLibrary(TEXT("SHELL32.DLL")); - } - - do_drag_query_file = (DragQueryFileType)GetProcAddress(lib, "DragQueryFileW"); - get_path_from_idlist = (GetPathFromIDListType)GetProcAddress(lib, - "SHGetPathFromIDListW"); - initialized = 1; -} - -/***********************************************************************/ - -AnimateWindowType fn_animate_window; -ChangeDisplaySettingsExType fn_change_display_settings_ex; - -/* - * Load the USER32.dll and get pointers to various procedures. - */ - -void -load_user_procs() -{ - static int initialized = 0; - HMODULE lib = NULL; - if (initialized) { - return; - } - lib = LoadLibrary(TEXT("USER32.DLL")); - HMODULE libUnicows = UnicowsLoader::GetModuleHandle(); - fn_animate_window = (AnimateWindowType)GetProcAddress(lib, "AnimateWindow"); - fn_change_display_settings_ex = (ChangeDisplaySettingsExType) - GetProcAddress(IS_WIN95 ? libUnicows : lib, "ChangeDisplaySettingsExW"); - initialized = 1; -} - -/***********************************************************************/ - -GetFileVersionInfoSizeType get_file_version_info_size; -GetFileVersionInfoType get_file_version_info; -VerQueryValueType do_ver_query_value; - -/* - * Load the VERSION.dll and get pointers to various procedures. - */ - -void -load_version_procs() -{ - static int initialized = 0; - HMODULE lib = NULL; - if (initialized) { - return; - } - - if (IS_WIN95) { - lib = UnicowsLoader::GetModuleHandle(); - } else { - lib = LoadLibrary(TEXT("VERSION.DLL")); - } - - get_file_version_info_size = - (GetFileVersionInfoSizeType)GetProcAddress(lib, "GetFileVersionInfoSizeW"); - get_file_version_info = - (GetFileVersionInfoType)GetProcAddress(lib, "GetFileVersionInfoW"); - do_ver_query_value = - (VerQueryValueType)GetProcAddress(lib, "VerQueryValueW"); - initialized = 1; -} - -/***********************************************************************/ - -#define MAX_KNOWN_VERSION 4 - -/* - * We are going to use an undocumented procedure RSRC32.DLL. - * The safest will be to use it only for a finite set of known versions. - */ - -DWORD known_versions[MAX_KNOWN_VERSION][2] = { - { 0x00040000, 0x000003B6 }, // WIN95\RETAIL - // WIN95\RETAIL\UPGRADE - // WIN95\OSR2 - // WIN95\OSR25 - // WIN95\international\RETAIL - // WIN95\international\OSR2 - - { 0x0004000A, 0x00000672 }, // WIN98\international\win98beta3 - - { 0x0004000A, 0x000007CE }, // WIN98\RETAIL - // WIN98\international\RETAIL - // WIN98\SE - - { 0x0004005A, 0x00000BB8 } // WIN98ME -}; - -GetFreeSystemResourcesType get_free_system_resources = NULL; - -/* - * Load the RSRC32.dll, check that it is a known version - * and get the pointer to the undocumented procedure. - */ - -void -load_rsrc32_procs() -{ - static int initialized = 0; - if (initialized) { - return; - } - if (IS_NT) { - // 4310028: Only load library on non-NT systems. The load - // will always fail anyways. However, if a Win 9x OS is - // also installed on the system, and the user's path - // includes C:\WINDOWS\SYSTEM, or the equivalent, a really - // ugly and annoying warning dialog will appear. - initialized = 1; - return; - } - HMODULE lib = LoadLibrary(TEXT("RSRC32.DLL")); - if (lib != NULL) { - TCHAR szFullPath[_MAX_PATH]; - DWORD dwVerHnd = 0; - DWORD dwVersionInfoSize; - LPBYTE lpVersionInfo; - LPVOID lpBuffer; - UINT uLength = 0; - - /* - * We use undocumented procedure exported by RSRC32.DLL, so the - * safest will be to check the library's version and only attempt - * to get the procedure address if it's a known version. - */ - if (::GetModuleFileName(lib, szFullPath, sizeof(szFullPath))) { - load_version_procs(); - dwVersionInfoSize = (*get_file_version_info_size)(szFullPath, &dwVerHnd); - if (dwVersionInfoSize) { - lpVersionInfo = new BYTE[dwVersionInfoSize]; - (*get_file_version_info)(szFullPath, dwVerHnd, - dwVersionInfoSize, lpVersionInfo); - if ((*do_ver_query_value)(lpVersionInfo, TEXT("\\"), &lpBuffer, &uLength)) { - VS_FIXEDFILEINFO *lpvsFixedFileInfo = (VS_FIXEDFILEINFO *)lpBuffer; - DWORD dwFileVersionMS = lpvsFixedFileInfo->dwFileVersionMS; - DWORD dwFileVersionLS = lpvsFixedFileInfo->dwFileVersionLS; - for (int i = 0; i < MAX_KNOWN_VERSION; i++) { - if ((known_versions[i][0] == dwFileVersionMS) && - (known_versions[i][1] == dwFileVersionLS)) { - get_free_system_resources = - (GetFreeSystemResourcesType) - ::GetProcAddress(lib, "_MyGetFreeSystemResources32@4"); - break; - } - } - } - delete[] lpVersionInfo; - } - } - } - initialized = 1; -} - -void -load_rich_edit_library() { - static int initialized = 0; - BOOL isRichEdit32Needed = IS_WIN95 && !IS_WIN98; - - if (initialized) { - return; - } - - HMODULE lib = NULL; - if (isRichEdit32Needed) { - lib = ::LoadLibrary(TEXT("RICHED32.DLL")); - } else { - lib = ::LoadLibrary(TEXT("RICHED20.DLL")); - } - if (lib == NULL) { - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - JNU_ThrowInternalError(env, "Can't load a rich edit DLL"); - } else if (isRichEdit32Needed) { - // Richedit language checking logic is needed for RICHED32.DLL only. - LPTSTR szFullPath = new TCHAR[_MAX_PATH]; - DWORD dwVerHnd = 0; - DWORD dwVersionInfoSize; - LPVOID lpVersionInfo; - UINT uLength = 0; - struct LANGANDCODEPAGE { - WORD wLanguage; - WORD wCodePage; - } *lpTranslate; - - try { - if (!IS_WIN2000 && ::GetModuleFileName(lib, szFullPath, _MAX_PATH)) { - load_version_procs(); - dwVersionInfoSize = (*get_file_version_info_size)(szFullPath, &dwVerHnd); - if (dwVersionInfoSize) { - lpVersionInfo = new BYTE[dwVersionInfoSize]; - try { - if ((*get_file_version_info)(szFullPath, - dwVerHnd, - dwVersionInfoSize, - lpVersionInfo) - && (*do_ver_query_value)(lpVersionInfo, - TEXT("\\VarFileInfo\\Translation"), - (LPVOID*)&lpTranslate, - &uLength)) { - - if (::GetSystemMetrics(SM_DBCSENABLED) - && LANGIDFROMLCID(::GetThreadLocale()) != lpTranslate[0].wLanguage) { - - JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); - if (env->PushLocalFrame(6) >= 0) { - jstring keystr = env->NewStringUTF("AWT.InconsistentDLLsWarning"); - jstring defstr = env->NewStringUTF( -"Text based operations may not work correctly due to \ -an inconsistent set of dynamic linking libraries (DLLs) installed on your \ -system. For more information on this problem and a suggested workaround \ -please see the Java(TM) 2 SDK, Standard Edition Release Notes \ -on java.sun.com."); - - jstring retstr = - (jstring) JNU_CallStaticMethodByName( - env, - NULL, - "java/awt/Toolkit", - "getProperty", - "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", - keystr, - defstr).l; - - jboolean exception; - jstring pkgstr = env->NewStringUTF("java.awt"); - jobject logger = - (jobject) JNU_CallStaticMethodByName( - env, - &exception, - "java/util/logging/Logger", - "getLogger", - "(Ljava/lang/String;)Ljava/util/logging/Logger;", - pkgstr).l; - - jstring msgstr = (retstr) ? retstr : defstr; - if (!exception) { - JNU_CallMethodByName( - env, - NULL, - logger, - "warning", - "(Ljava/lang/String;)V", - msgstr); - } else { - LPCTSTR outstr = JNU_GetStringPlatformChars(env, msgstr, NULL); - _ftprintf(stdout, TEXT("\nWARNING: %s\n"), outstr); - fflush(stdout); - JNU_ReleaseStringPlatformChars(env, msgstr, outstr); - } - - env->PopLocalFrame(NULL); - } - } - } - } catch (...) { - delete[] lpVersionInfo; - throw; - } - delete[] lpVersionInfo; - } - } - } catch (...) { - delete[] szFullPath; - throw; - } - delete[] szFullPath; - } - initialized = 1; -} - -/***********************************************************************/ - -bool AwtWinMM::initialized = false; -AwtWinMM::PlaySoundWFunc* AwtWinMM::playSoundFunc = NULL; - -BOOL AwtWinMM::PlaySoundWrapper(LPCTSTR pszSound, HMODULE hmod, DWORD fdwSound) { - load_winmm_procs(); - if (playSoundFunc == NULL) { - return FALSE; - } - return (*playSoundFunc)(pszSound, hmod, fdwSound); -} - -void AwtWinMM::load_winmm_procs() { - if (initialized) { - return; - } - HMODULE dll = NULL; - - if (IS_WIN95) { - dll = UnicowsLoader::GetModuleHandle(); - } else { - dll = ::LoadLibrary(TEXT("winmm.dll")); - } - - if (dll == NULL) { - return; - } - playSoundFunc = - (PlaySoundWFunc*) GetProcAddress(dll, "PlaySoundW"); - if (playSoundFunc == NULL) { - return; - } - initialized = true; -} diff --git a/jdk/src/windows/native/sun/windows/awt_dlls.h b/jdk/src/windows/native/sun/windows/awt_dlls.h deleted file mode 100644 index b7e08980226..00000000000 --- a/jdk/src/windows/native/sun/windows/awt_dlls.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 1999-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. - */ - -#ifndef AWT_DLLS_H -#define AWT_DLLS_H - -#include -#include -#include -#include "awt_FileDialog.h" -#include "awt_PrintDialog.h" - -/* - * To reduce memory footprint we don't statically link to COMDLG32.DLL - * and SHELL32. Instead we programatically load them only when they are - * needed. - */ - -//--------------------------------------------------------------------------- - -typedef BOOL (APIENTRY *PrintDlgType)(LPPRINTDLGW); -typedef BOOL (APIENTRY *PageSetupDlgType)(LPPAGESETUPDLGW); -typedef BOOL (APIENTRY *GetOpenFileNameType)(LPOPENFILENAMEW); -typedef BOOL (APIENTRY *GetSaveFileNameType)(LPOPENFILENAMEW); -typedef DWORD (APIENTRY *GetExtendedErrorType)(VOID); - -class AwtCommDialog { -public: - static DWORD CommDlgExtendedError(VOID); - - static BOOL PrintDlg(LPPRINTDLG data); - - static BOOL PageSetupDlg(LPPAGESETUPDLG data); - -private: - static void load_comdlg_procs(); - - // Use wrapper functions with default calling convention. If the - // default isn't __stdcall, accessing the Win32 functions directly - // will cause stack corruption if we cast away __stdcall. - static BOOL PrintDlgWrapper(LPPRINTDLG data) { - return (*do_print_dlg)(data); - } - static BOOL PageSetupDlgWrapper(LPPAGESETUPDLG data) { - return (*do_page_setup_dlg)(data); - } - static BOOL GetOpenFileNameWrapper(LPOPENFILENAME data) { - return (*get_open_file_name)(data); - } - static BOOL GetSaveFileNameWrapper(LPOPENFILENAME data) { - return (*get_save_file_name)(data); - } - static DWORD GetExtendedErrorWrapper(VOID) { - return (*get_dlg_extended_error)(); - } - - friend BOOL AwtFileDialog::GetOpenFileName(LPAWTOPENFILENAME); - friend BOOL AwtFileDialog::GetSaveFileName(LPAWTOPENFILENAME); - friend BOOL AwtPrintDialog::PrintDlg(LPPRINTDLG); - - static PrintDlgType do_print_dlg; - static PageSetupDlgType do_page_setup_dlg; - static GetOpenFileNameType get_open_file_name; - static GetSaveFileNameType get_save_file_name; - static GetExtendedErrorType get_dlg_extended_error; -}; - -//--------------------------------------------------------------------------- - -// Dynamically load in SHELL32.DLL and define the procedure pointers listed below. -extern void load_shell_procs(); - -// Procedure pointers obtained from SHELL32.DLL -// You must call load_shell_procs() before using any of these. -typedef UINT (APIENTRY *DragQueryFileType)(HDROP,UINT,LPTSTR,UINT); -typedef BOOL (APIENTRY *GetPathFromIDListType)(LPCITEMIDLIST,LPTSTR); -extern DragQueryFileType do_drag_query_file; -extern GetPathFromIDListType get_path_from_idlist; - -//--------------------------------------------------------------------------- - -// Dynamically load in USER32.DLL and define the procedure pointers listed below. -extern void load_user_procs(); - -// Procedure pointers obtained from USER32.DLL -// You must call load_user_procs() before using any of these. -typedef BOOL (WINAPI *AnimateWindowType)(HWND,DWORD,DWORD); -typedef LONG (WINAPI *ChangeDisplaySettingsExType)(LPCTSTR,LPDEVMODE,HWND,DWORD,LPVOID lParam); -extern AnimateWindowType fn_animate_window; -extern ChangeDisplaySettingsExType fn_change_display_settings_ex; - -//--------------------------------------------------------------------------- - -// Dynamically load in VERSION.DLL and define the procedure pointers listed below. -extern void load_version_procs(); - -// Procedure pointers obtained from VERSION.DLL -// You must call load_version_procs() before using any of these. -typedef DWORD (APIENTRY *GetFileVersionInfoSizeType)(LPTSTR,LPDWORD); -typedef BOOL (APIENTRY *GetFileVersionInfoType)(LPTSTR,DWORD,DWORD,LPVOID); -typedef BOOL (APIENTRY *VerQueryValueType)(const LPVOID,LPTSTR,LPVOID*,PUINT); -extern GetFileVersionInfoSizeType get_file_version_info_size; -extern GetFileVersionInfoType get_file_version_info; -extern VerQueryValueType do_ver_query_value; - -//--------------------------------------------------------------------------- - -// Dynamically load in RSRC32.DLL and define the procedure pointers listed below. -extern void load_rsrc32_procs(); - -// Procedure pointers obtained from RSRC32.DLL -// You must call load_rsrc32_procs() before using this procedure. - -/* - * NOTE: even after load_rsrc32_procs() you must check that - * the function pointer is valid before use. - * It will be NULL in three cases: - * 1.RSRC32.DLL not found. This means that Resource Meter - * isn't installed. - * 2.RSRC32.DLL can't be loaded. This happens on WinNT. - * 3.Unknown version of RSRC32.DLL. This is undocumented - * procedure, so the safest will be to use it only for - * a finite set of known versions. - */ -typedef UINT (APIENTRY *GetFreeSystemResourcesType)(UINT); - -extern GetFreeSystemResourcesType get_free_system_resources; - -extern void load_rich_edit_library(); - -//--------------------------------------------------------------------------- - -/* - * Loading WINMM.DLL (the Windows MultiMedia library) is extremely - * expensive. The AWT only uses it to play certain Windows sounds - * (which are off by default) so we dynamically load it upon demand - * instead of statically linking to it. - */ - -class AwtWinMM { -public: - static BOOL PlaySoundWrapper(LPCTSTR pszSound, HMODULE hmod, DWORD fdwSound); - -private: - static void load_winmm_procs(); - static bool initialized; - typedef BOOL WINAPI PlaySoundWFunc(LPCTSTR pszSound, HMODULE hmod, DWORD fdwSound); - static PlaySoundWFunc* playSoundFunc; -}; - -#endif /* AWT_DLLS_H */ diff --git a/jdk/src/windows/native/sun/windows/awtmsg.h b/jdk/src/windows/native/sun/windows/awtmsg.h index 6ac2746c2d5..35e436b53e7 100644 --- a/jdk/src/windows/native/sun/windows/awtmsg.h +++ b/jdk/src/windows/native/sun/windows/awtmsg.h @@ -1,5 +1,5 @@ /* - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. + * 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 @@ -182,18 +182,6 @@ extern const UINT SYSCOMMAND_IMM; #endif //AW_BLEND - - -// WM_MOUSEWHEEL should be WM_MOUSELAST, but -// is not being defined. See winuser.h -#ifdef WM_MOUSELAST -#if WM_MOUSELAST <= 0x020A -#define WM_AWT_MOUSELAST 0x020A -#else -#error Unexpected value of WM_MOUSELAST -#endif //WM_MOUSELAST <= 0x0209 -#endif //WM_MOUSELAST - // AwtComponent messages enum { // 6427323: unfortunately WM_APP+nnn conflicts with edit control messages @@ -252,17 +240,6 @@ enum { WM_AWT_HIDECURSOR, WM_AWT_CREATE_PRINTED_PIXELS, - /* Synchronize ddraw fullscreen events on Windows event thread */ - WM_AWT_DD_CREATE_SURFACE, - WM_AWT_DD_ENTER_FULLSCREEN, - WM_AWT_DD_EXIT_FULLSCREEN, - WM_AWT_DD_SET_DISPLAY_MODE, - WM_AWT_DD_RESTORE_DISPLAY_MODE, - - /* Synchronize D3D device creation on Windows event thread */ - WM_AWT_D3D_CREATE_DEVICE, - WM_AWT_D3D_RELEASE_DEVICE, - // Tray messages WM_AWT_TRAY_NOTIFY, diff --git a/jdk/src/windows/native/sun/windows/jawt.cpp b/jdk/src/windows/native/sun/windows/jawt.cpp index 91de38a9fd5..ae2d09dd4d9 100644 --- a/jdk/src/windows/native/sun/windows/jawt.cpp +++ b/jdk/src/windows/native/sun/windows/jawt.cpp @@ -1,5 +1,5 @@ /* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 @@ -26,6 +26,7 @@ #define _JNI_IMPLEMENTATION_ #include +#include "awt.h" #include "awt_DrawingSurface.h" /* diff --git a/jdk/src/windows/transport/socket/socket_md.c b/jdk/src/windows/transport/socket/socket_md.c index b24b2d4c84a..622b9e2da38 100644 --- a/jdk/src/windows/transport/socket/socket_md.c +++ b/jdk/src/windows/transport/socket/socket_md.c @@ -120,8 +120,8 @@ DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved) * function pointer table, but our pointer should still be good. */ int -dbgsysListen(int fd, INT32 count) { - return listen(fd, (int)count); +dbgsysListen(int fd, int backlog) { + return listen(fd, backlog); } int @@ -172,7 +172,7 @@ int dbgsysFinishConnect(int fd, long timeout) { int dbgsysAccept(int fd, struct sockaddr *name, int *namelen) { - return accept(fd, name, namelen); + return (int)accept(fd, name, namelen); } int @@ -209,7 +209,7 @@ dbgsysHostToNetworkShort(unsigned short hostshort) { int dbgsysSocket(int domain, int type, int protocol) { - int fd = socket(domain, type, protocol); + int fd = (int)socket(domain, type, protocol); if (fd != SOCKET_ERROR) { SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE); } @@ -229,12 +229,6 @@ dbgsysSocketClose(int fd) { return closesocket(fd); } -INT32 -dbgsysSocketAvailable(int fd, INT32 *pbytes) { - u_long arg = (u_long)*pbytes; - return (INT32)ioctlsocket(fd, FIONREAD, &arg); -} - /* Additions to original follow */ int @@ -243,14 +237,14 @@ dbgsysBind(int fd, struct sockaddr *name, int namelen) { } -UINT32 +uint32_t dbgsysInetAddr(const char* cp) { - return (UINT32)inet_addr(cp); + return (uint32_t)inet_addr(cp); } -UINT32 -dbgsysHostToNetworkLong(UINT32 hostlong) { - return (UINT32)htonl((u_long)hostlong); +uint32_t +dbgsysHostToNetworkLong(uint32_t hostlong) { + return (uint32_t)htonl((u_long)hostlong); } unsigned short @@ -263,9 +257,9 @@ dbgsysGetSocketName(int fd, struct sockaddr *name, int *namelen) { return getsockname(fd, name, namelen); } -UINT32 -dbgsysNetworkToHostLong(UINT32 netlong) { - return (UINT32)ntohl((u_long)netlong); +uint32_t +dbgsysNetworkToHostLong(uint32_t netlong) { + return (uint32_t)ntohl((u_long)netlong); } /* diff --git a/jdk/src/windows/transport/socket/socket_md.h b/jdk/src/windows/transport/socket/socket_md.h index 53eba1eeae4..bbf9b3439b2 100644 --- a/jdk/src/windows/transport/socket/socket_md.h +++ b/jdk/src/windows/transport/socket/socket_md.h @@ -25,3 +25,6 @@ /* Use its data structures and constants; don't make direct calls */ #include + +#define uint32_t UINT32 + diff --git a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java index 6fe480cb6e0..369947fc510 100644 --- a/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java +++ b/jdk/test/com/sun/crypto/provider/KeyFactory/TestProviderLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/com/sun/jdi/MonitorFrameInfo.java b/jdk/test/com/sun/jdi/MonitorFrameInfo.java index e93fa3390d2..056428da20d 100644 --- a/jdk/test/com/sun/jdi/MonitorFrameInfo.java +++ b/jdk/test/com/sun/jdi/MonitorFrameInfo.java @@ -25,7 +25,8 @@ * @test * @bug 6230699 * @summary Test ThreadReference.ownedMonitorsAndFrames() - * + * @bug 6701700 + * @summary MonitorInfo objects aren't invalidated when the owning thread is resumed * @author Swamy Venkataramanappa * * @run build TestScaffold VMConnection TargetListener TargetAdapter @@ -48,6 +49,7 @@ class MonitorTestTarg { static void foo2() { Object l1 = new Object(); synchronized(l1) { + System.out.println("executing foo2 " + l1); foo3(); } } @@ -58,6 +60,7 @@ class MonitorTestTarg { System.out.println("Howdy!"); Object l1 = new Object(); synchronized(l1) { + System.out.println("executing main" + l1); foo1(); } } @@ -100,15 +103,15 @@ public class MonitorFrameInfo extends TestScaffold { if (!mainThread.frame(0).location().method().name() .equals("foo3")) { - failure("frame failed"); + failure("FAILED: frame failed"); } if (mainThread.frames().size() != (initialSize + 3)) { - failure("frames size failed"); + failure("FAILED: frames size failed"); } if (mainThread.frames().size() != mainThread.frameCount()) { - failure("frames size not equal to frameCount"); + failure("FAILED: frames size not equal to frameCount"); } /* Test monitor frame info. @@ -119,13 +122,32 @@ public class MonitorFrameInfo extends TestScaffold { if (monitors.size() != expectedCount) { failure("monitors count is not equal to expected count"); } + MonitorInfo mon = null; for (int j=0; j < monitors.size(); j++) { - MonitorInfo mon = (MonitorInfo)monitors.get(j); + mon = (MonitorInfo)monitors.get(j); System.out.println("Monitor obj " + mon.monitor() + "depth =" +mon.stackDepth()); if (mon.stackDepth() != expectedDepth[j]) { - failure("monitor stack depth is not equal to expected depth"); + failure("FAILED: monitor stack depth is not equal to expected depth"); } } + + // The last gotten monInfo is in mon. When we resume the thread, + // it should become invalid. We will step out of the top frame + // so that the frame depth in this mon object will no longer be correct. + // That is why the monInfo's have to become invalid when the thread is + // resumed. + stepOut(mainThread); + boolean ok = false; + try { + System.out.println("*** Saved Monitor obj " + mon.monitor() + "depth =" +mon.stackDepth()); + } catch(InvalidStackFrameException ee) { + // ok + ok = true; + System.out.println("Got expected InvalidStackFrameException after a resume"); + } + if (!ok) { + failure("FAILED: MonitorInfo object was not invalidated by a resume"); + } } else { System.out.println("can not get monitors frame info"); } diff --git a/jdk/test/com/sun/jdi/ResumeOneThreadTest.java b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java new file mode 100644 index 00000000000..aec4c0d7cca --- /dev/null +++ b/jdk/test/com/sun/jdi/ResumeOneThreadTest.java @@ -0,0 +1,233 @@ +/* + * Copyright 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. + * + * 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 6700889 + * @summary Thread resume invalidates all stack frames, even from other threads + * + * @author jjh + * + * @run build TestScaffold VMConnection TargetListener TargetAdapter + * @run compile -g ResumeOneThreadTest.java + * @run main ResumeOneThreadTest + */ +import com.sun.jdi.*; +import com.sun.jdi.event.*; +import com.sun.jdi.request.*; + +import java.util.*; + +class ResumeOneThreadTarg extends Thread { + static String name1 = "Thread 1"; + static String name2 = "Thread 2"; + + public ResumeOneThreadTarg(String name) { + super(name); + } + + public static void main(String[] args) { + System.out.println(" Debuggee: Howdy!"); + ResumeOneThreadTarg t1 = new ResumeOneThreadTarg(name1); + ResumeOneThreadTarg t2 = new ResumeOneThreadTarg(name2); + + t1.start(); + t2.start(); + } + + // This just starts two threads. Each runs to a bkpt. + public void run() { + if (getName().equals(name1)) { + run1(); + } else { + run2(); + } + } + + public void bkpt1(String p1) { + System.out.println(" Debuggee: bkpt 1"); + } + + public void run1() { + bkpt1("Hello Alviso!"); + } + + + + public void bkpt2() { + System.out.println(" Debuggee: bkpt 2"); + } + + public void run2() { + bkpt2(); + } +} + +/********** test program **********/ + +public class ResumeOneThreadTest extends TestScaffold { + ReferenceType targetClass; + ThreadReference mainThread; + + BreakpointRequest request1; + BreakpointRequest request2; + + ThreadReference thread1 = null; + ThreadReference thread2 = null;; + boolean theVMisDead = false; + + ResumeOneThreadTest (String args[]) { + super(args); + } + + public static void main(String[] args) throws Exception { + new ResumeOneThreadTest(args).startTests(); + } + + + synchronized public void breakpointReached(BreakpointEvent event) { + println("-- Got bkpt at: " + event.location()); + ThreadReference eventThread = event.thread(); + + if (eventThread.name().equals(ResumeOneThreadTarg.name1)) { + thread1 = eventThread; + } + + if (eventThread.name().equals(ResumeOneThreadTarg.name2)) { + thread2 = eventThread; + } + } + + public void vmDied(VMDeathEvent event) { + theVMisDead = true; + } + + synchronized public void eventSetComplete(EventSet set) { + if (theVMisDead) { + return; + } + if (thread1 == null || thread2 == null) { + // Don't do a set.resume(), just let the other thread + // keep running until it hits its bkpt. + return; + } + + // Both threads are stopped at their bkpts. Get a StackFrame from + // Thread 1 then resume Thread 2 and verify that the saved StackFrame is + // still valid. + + // suspend everything. + println("-- All threads suspended"); + vm().suspend(); + + StackFrame t1sf0 = null; + try { + t1sf0 = thread1.frame(0); + } catch (IncompatibleThreadStateException ee) { + failure("FAILED: Exception: " + ee); + } + + println("-- t1sf0 args: " + t1sf0.getArgumentValues()); + + // Ok, we have a StackFrame for thread 1. Resume just thread 2 + // Note that thread 2 has been suspended twice - by the SUSPEND_ALL + // bkpt, and by the above vm().suspend(), so we have to resume + // it twice. + request2.disable(); + + thread2.resume(); + thread2.resume(); + println("-- Did Resume on thread 2"); + + // Can we get frames for thread1? + try { + StackFrame t1sf0_1 = thread1.frame(0); + if (!t1sf0.equals(t1sf0_1)) { + failure("FAILED: Got a different frame 0 for thread 1 after resuming thread 2"); + } + } catch (IncompatibleThreadStateException ee) { + failure("FAILED: Could not get frames for thread 1: Exception: " + ee); + } catch (Exception ee) { + failure("FAILED: Could not get frames for thread 1: Exception: " + ee); + } + + + try { + println("-- t1sf0 args: " + t1sf0.getArgumentValues()); + } catch (InvalidStackFrameException ee) { + // This is the failure. + failure("FAILED Got InvalidStackFrameException"); + vm().dispose(); + throw(ee); + } + + // Let the debuggee finish + request1.disable(); + thread1.resume(); + vm().resume(); + println("--------------"); + } + + /********** test core **********/ + + protected void runTests() throws Exception { + + /* + * Get to the top of main() + * to determine targetClass and mainThread + */ + BreakpointEvent bpe = startToMain("ResumeOneThreadTarg"); + targetClass = bpe.location().declaringType(); + mainThread = bpe.thread(); + EventRequestManager erm = vm().eventRequestManager(); + final Thread mainThread = Thread.currentThread(); + + /* + * Set event requests + */ + + Location loc1 = findMethod(targetClass, "bkpt1", "(Ljava/lang/String;)V").location(); + request1 = erm.createBreakpointRequest(loc1); + request1.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD); + request1.enable(); + + Location loc2 = findMethod(targetClass, "bkpt2", "()V").location(); + request2 = erm.createBreakpointRequest(loc2); + request2.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD); + request2.enable(); + + /* + * resume the target, listening for events + */ + listenUntilVMDisconnect(); + /* + * deal with results of test + * if anything has called failure("foo") testFailed will be true + */ + if (!testFailed) { + println("ResumeOneThreadTest: passed"); + } else { + throw new Exception("ResumeOneThreadTest: failed"); + } + } +} diff --git a/jdk/test/com/sun/jdi/SourceNameFilterTest.java b/jdk/test/com/sun/jdi/SourceNameFilterTest.java index 1565a8886a8..cb8260646f0 100644 --- a/jdk/test/com/sun/jdi/SourceNameFilterTest.java +++ b/jdk/test/com/sun/jdi/SourceNameFilterTest.java @@ -23,7 +23,7 @@ /** * @test - * @bug 4836939 + * @bug 4836939 6646613 * @summary JDI add addSourceNameFilter to ClassPrepareRequest * * @author jjh @@ -31,7 +31,11 @@ * @run build TestScaffold VMConnection TargetListener TargetAdapter * @run compile -g SourceNameFilterTest.java * @run main SourceNameFilterTest + * @run compile -g:none SourceNameFilterTest.java + * @run main SourceNameFilterTest */ +// The compile -g:none suppresses the lineNumber table to trigger bug 6646613. + import com.sun.jdi.*; import com.sun.jdi.event.*; import com.sun.jdi.request.*; @@ -84,7 +88,6 @@ public class SourceNameFilterTest extends TestScaffold { boolean gotEvent1 = false; boolean gotEvent2 = false; boolean gotEvent3 = false; - ClassPrepareRequest cpReq; boolean shouldResume = false; SourceNameFilterTest (String args[]) { @@ -151,6 +154,18 @@ public class SourceNameFilterTest extends TestScaffold { */ BreakpointEvent bpe = startToMain("SourceNameFilterTarg"); targetClass = bpe.location().declaringType(); + boolean noSourceName = false; + try { + targetClass.sourceName(); + } catch (AbsentInformationException ee) { + noSourceName = true; + } + if (noSourceName) { + println("-- Running with no source names"); + } else { + println("-- Running with source names"); + } + mainThread = bpe.thread(); EventRequestManager erm = vm().eventRequestManager(); addListener(this); @@ -175,7 +190,9 @@ public class SourceNameFilterTest extends TestScaffold { /* * This should cause us to get a class prepare event for - * LoadedLater3 + * LoadedLater3 except in the case where -g:none + * was used to compile so that there is no LineNumberTable + * and therefore, no source name for the class. */ cpReq = erm.createClassPrepareRequest(); cpReq.addSourceNameFilter("SourceNameFilterTest.java"); @@ -186,17 +203,21 @@ public class SourceNameFilterTest extends TestScaffold { if (!gotEvent1) { failure("failure: Did not get a class prepare request " + - "for Loadedlater1"); + "for LoadedLater1"); } if (gotEvent2) { failure("failure: Did get a class prepare request " + - "for Loadedlater2"); + "for LoadedLater2"); } - if (!gotEvent3) { + if (gotEvent3 && noSourceName) { + failure("failure: Did get a class prepare request " + + "for LoadedLater3"); + } + else if (!gotEvent3 && !noSourceName) { failure("failure: Did not get a class prepare request " + - "for Loadedlater3"); + "for LoadedLater3"); } /* diff --git a/jdk/test/com/sun/jdi/VMConnection.java b/jdk/test/com/sun/jdi/VMConnection.java index f370bf46b8a..c9cb83f7257 100644 --- a/jdk/test/com/sun/jdi/VMConnection.java +++ b/jdk/test/com/sun/jdi/VMConnection.java @@ -115,7 +115,7 @@ class VMConnection { return cmdLine; } // Insert the options at position 1. Blanks in args are not allowed! - String[] v1 = opts.split(" "); + String[] v1 = opts.split(" +"); String[] retVal = new String[cmdLine.length + v1.length]; retVal[0] = cmdLine[0]; System.arraycopy(v1, 0, retVal, 1, v1.length); diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java index 6ad2581e862..dc9d44afe6e 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/DumpHeap.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java index c71888bbaee..5c3b9b0bc10 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java index 1f835173ab0..3dfa60b81f4 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/GetVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java index 404a7373dfd..c3526fba182 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java b/jdk/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java index 37674dbdcf8..c44b0c081d3 100644 --- a/jdk/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java +++ b/jdk/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java b/jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java index ccdac15f8a6..20f6145e320 100644 --- a/jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java +++ b/jdk/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java b/jdk/test/java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java new file mode 100644 index 00000000000..3111b6e9c65 --- /dev/null +++ b/jdk/test/java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java @@ -0,0 +1,136 @@ +/* + @test + @bug 6304473 6727884 + @summary Tests that an exception on EDT is handled with ThreadGroup.uncaughtException() + @author artem.ananiev: area=awt.eventdispatching + @library ../../regtesthelpers + @build Util + @run main HandleExceptionOnEDT +*/ + +import java.awt.*; +import java.awt.event.*; + +import test.java.awt.regtesthelpers.Util; + +public class HandleExceptionOnEDT +{ + private final static String EXCEPTION_MESSAGE = "A1234567890"; + + private static volatile boolean exceptionHandled = false; + private static volatile boolean mousePressed = false; + + public static void main(String[] args) + { + final Thread.UncaughtExceptionHandler eh = new Thread.UncaughtExceptionHandler() + { + @Override + public void uncaughtException(Thread t, Throwable e) + { + if (e.getMessage().equals(EXCEPTION_MESSAGE)) + { + exceptionHandled = true; + } + } + }; + + Frame f = new Frame("F"); + f.setBounds(100, 100, 400, 300); + // set exception handler for EDT + f.addWindowListener(new WindowAdapter() + { + @Override + public void windowOpened(WindowEvent we) + { + Thread edt = Thread.currentThread(); + edt.setUncaughtExceptionHandler(eh); + } + }); + f.setVisible(true); + + Robot r = Util.createRobot(); + Util.waitForIdle(r); + + // check exception without modal dialog + MouseListener exceptionListener = new MouseAdapter() + { + @Override + public void mousePressed(MouseEvent me) + { + throw new RuntimeException(EXCEPTION_MESSAGE); + } + }; + f.addMouseListener(exceptionListener); + + exceptionHandled = false; + Point fp = f.getLocationOnScreen(); + r.mouseMove(fp.x + f.getWidth() / 2, fp.y + f.getHeight() / 2); + Util.waitForIdle(r); + r.mousePress(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + r.mouseRelease(InputEvent.BUTTON2_MASK); + f.removeMouseListener(exceptionListener); + + if (!exceptionHandled) + { + throw new RuntimeException("Test FAILED: exception is not handled for frame"); + } + + // check exception with modal dialog + final Dialog d = new Dialog(f, "D", true); + d.setBounds(fp.x + 100, fp.y + 100, 400, 300); + d.addMouseListener(exceptionListener); + EventQueue.invokeLater(new Runnable() + { + @Override + public void run() + { + d.setVisible(true); + } + }); + Util.waitForIdle(r); + + exceptionHandled = false; + Point dp = d.getLocationOnScreen(); + r.mouseMove(dp.x + d.getWidth() / 2, dp.y + d.getHeight() / 2); + Util.waitForIdle(r); + r.mousePress(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + r.mouseRelease(InputEvent.BUTTON2_MASK); + d.removeMouseListener(exceptionListener); + + if (!exceptionHandled) + { + throw new RuntimeException("Test FAILED: exception is not handled for modal dialog"); + } + + // check the dialog is still modal + MouseListener pressedListener = new MouseAdapter() + { + @Override + public void mousePressed(MouseEvent me) + { + mousePressed = true; + } + }; + f.addMouseListener(pressedListener); + + mousePressed = false; + r.mouseMove(fp.x + 50, fp.y + 50); + Util.waitForIdle(r); + r.mousePress(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + r.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(r); + f.removeMouseListener(pressedListener); + + if (mousePressed) + { + throw new RuntimeException("Test FAILED: modal dialog is not modal or visible after exception"); + } + + // test is passed + d.dispose(); + f.dispose(); + } +} diff --git a/jdk/test/java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java b/jdk/test/java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java index b813ce9599e..220ccaf6b00 100644 --- a/jdk/test/java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java +++ b/jdk/test/java/awt/Focus/RestoreFocusOnDisabledComponentTest/RestoreFocusOnDisabledComponentTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java b/jdk/test/java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java new file mode 100644 index 00000000000..b50cf59390c --- /dev/null +++ b/jdk/test/java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java @@ -0,0 +1,134 @@ +/* + * Copyright 2006-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. + * + * 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 6366813 6459844 + * @summary Tests that no exception is thrown if a frame is resized just + * before we create a bufferStrategy + * @author Dmitri.Trembovetski area=FullScreen/BufferStrategy + * @run main/othervm -Dsun.java2d.opengl=true BufferStrategyExceptionTest + * @run main/othervm BufferStrategyExceptionTest + */ + +import java.awt.AWTException; +import java.awt.BufferCapabilities; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.ImageCapabilities; +import java.awt.image.BufferStrategy; +import java.awt.image.BufferedImage; + +/** + * The purpose of this test is to make sure that we do not throw an + * IllegalStateException during the creation of BufferStrategy if + * a window has been resized just before our creation attempt. + * + * We test both windowed and fullscreen mode, although the exception has + * been observed in full screen mode only. + */ +public class BufferStrategyExceptionTest { + private static final int TEST_REPS = 20; + + public static void main(String[] args) { + GraphicsDevice gd = + GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice(); + + for (int i = 0; i < TEST_REPS; i++) { + TestFrame f = new TestFrame(); + f.pack(); + f.setSize(400, 400); + f.setVisible(true); + if (i % 2 == 0) { + gd.setFullScreenWindow(f); + } + // generate a resize event which will invalidate the peer's + // surface data and hopefully cause an exception during + // BufferStrategy creation in TestFrame.render() + Dimension d = f.getSize(); + d.width -= 5; d.height -= 5; + f.setSize(d); + + f.render(); + gd.setFullScreenWindow(null); + sleep(100); + f.dispose(); + } + System.out.println("Test passed."); + } + + private static void sleep(long msecs) { + try { + Thread.sleep(msecs); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + + private static final BufferedImage bi = + new BufferedImage(200, 200, BufferedImage.TYPE_INT_RGB); + + static class TestFrame extends Frame { + TestFrame() { + setUndecorated(true); + setIgnoreRepaint(true); + setSize(400, 400); + } + + public void render() { + ImageCapabilities imgBackBufCap = new ImageCapabilities(true); + ImageCapabilities imgFrontBufCap = new ImageCapabilities(true); + BufferCapabilities bufCap = + new BufferCapabilities(imgFrontBufCap, + imgBackBufCap, BufferCapabilities.FlipContents.COPIED); + try { + + createBufferStrategy(2, bufCap); + } catch (AWTException ex) { + createBufferStrategy(2); + } + + BufferStrategy bs = getBufferStrategy(); + do { + Graphics g = bs.getDrawGraphics(); + g.setColor(Color.green); + g.fillRect(0, 0, getWidth(), getHeight()); + + g.setColor(Color.red); + g.drawString("Rendering test", 20, 20); + + g.drawImage(bi, 50, 50, null); + + g.dispose(); + bs.show(); + } while (bs.contentsLost()||bs.contentsRestored()); + } + } + +} diff --git a/jdk/test/java/awt/FullScreen/MultimonFullscreenTest/MultimonFullscreenTest.java b/jdk/test/java/awt/FullScreen/MultimonFullscreenTest/MultimonFullscreenTest.java new file mode 100644 index 00000000000..7e615068c62 --- /dev/null +++ b/jdk/test/java/awt/FullScreen/MultimonFullscreenTest/MultimonFullscreenTest.java @@ -0,0 +1,387 @@ +/* + * Copyright 2005-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. + * + * 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 5041219 + * @bug 5101561 + * @bug 5035272 + * @bug 5096011 + * @bug 5101712 + * @bug 5098624 + * @summary Here are a few assertions worth verification: + * - the fullscreen window is positioned at 0,0 + * - the fs window appears on the correct screen + * - if the exclusive FS mode is supported, no other widndow should + * overlap the fs window (including the taskbar). + * You could, however, alt+tab out of a fullscreen window, or at least + * minimize it (if you've entered the fs mode with a Window, you'll need + * to minimize the owner frame). + * Note that there may be issues with FS exclusive mode with ddraw and + * multiple fullscreen windows (one per device). + * - if display mode is supported that it did change + * - that the original display mode is restored once + * the ws window is disposed + * All of the above should work with and w/o DirectDraw + * (-Dsun.java2d.noddraw=true) on windows, and w/ and w/o opengl on X11 + * (-Dsun.java2d.opengl=True). + * @run main/manual/othervm -Dsun.java2d.pmoffscreen=true MultimonFullscreenTest + * @run main/manual/othervm -Dsun.java2d.pmoffscreen=false MultimonFullscreenTest + * @run main/manual/othervm -Dsun.java2d.d3d=True MultimonFullscreenTest + * @run main/manual/othervm -Dsun.java2d.noddraw=true MultimonFullscreenTest + * @run main/manual/othervm -Dsun.java2d.opengl=True MultimonFullscreenTest + */ + +import java.awt.Button; +import java.awt.Checkbox; +import java.awt.CheckboxGroup; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.DisplayMode; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.GridLayout; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferStrategy; +import java.util.HashMap; +import java.util.Random; + +/** + */ + +public class MultimonFullscreenTest extends Frame implements ActionListener { + GraphicsDevice defDev = GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice(); + GraphicsDevice gd[] = GraphicsEnvironment.getLocalGraphicsEnvironment(). + getScreenDevices(); + HashMap deviceMap; + + private static boolean dmChange = false; + static boolean setNullOnDispose = false; + static boolean useFSFrame = true; + static boolean useFSWindow = false; + static boolean useFSDialog = false; + static boolean useBS = false; + static boolean runRenderLoop = false; + static boolean addHWChildren = false; + static volatile boolean done = true; + + public MultimonFullscreenTest(String title) { + super(title); + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + Panel p = new Panel(); + deviceMap = new HashMap(gd.length); + int num = 0; + for (GraphicsDevice dev : gd) { + Button b; + if (dev == defDev) { + b = new Button("Primary screen: " + num); + System.out.println("Primary Dev : " + dev + " Bounds: " + + dev.getDefaultConfiguration().getBounds()); + } else { + b = new Button("Secondary screen " + num); + System.out.println("Secondary Dev : " + dev + " Bounds: " + + dev.getDefaultConfiguration().getBounds()); + } + b.addActionListener(this); + p.add(b); + deviceMap.put(b, dev); + num++; + } + add("South", p); + Panel p1 = new Panel(); + p1.setLayout(new GridLayout(2,0)); + Checkbox cb = new Checkbox("Change DM on entering FS"); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + dmChange = ((Checkbox)e.getSource()).getState(); + } + }); + p1.add(cb); +// cb = new Checkbox("Exit FS on window dispose"); +// cb.addItemListener(new ItemListener() { +// public void itemStateChanged(ItemEvent e) { +// setNullOnDispose = ((Checkbox)e.getSource()).getState(); +// } +// }); +// p1.add(cb); + CheckboxGroup cbg = new CheckboxGroup(); + cb = new Checkbox("Use Frame to enter FS", cbg, true); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + useFSFrame = true; + useFSWindow = false; + useFSDialog = false; + } + }); + p1.add(cb); + cb = new Checkbox("Use Window to enter FS", cbg, false); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + useFSFrame = false; + useFSWindow = true; + useFSDialog = false; + } + }); + p1.add(cb); + cb = new Checkbox("Use Dialog to enter FS", cbg, false); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + useFSFrame = false; + useFSWindow = false; + useFSDialog = true; + } + }); + p1.add(cb); + cb = new Checkbox("Run render loop"); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + runRenderLoop = ((Checkbox)e.getSource()).getState(); + } + }); + p1.add(cb); + cb = new Checkbox("Use BufferStrategy in render loop"); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + useBS = ((Checkbox)e.getSource()).getState(); + } + }); + p1.add(cb); + cb = new Checkbox("Add Children to FS window"); + cb.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + addHWChildren = ((Checkbox)e.getSource()).getState(); + } + }); + p1.add(cb); + add("North", p1); + + pack(); + setVisible(true); + } + + Font f = new Font("Dialog", Font.BOLD, 24); + Random rnd = new Random(); + public void renderDimensions(Graphics g, Rectangle rectWndBounds, + GraphicsConfiguration gc) { + g.setColor(new Color(rnd.nextInt(0xffffff))); + g.fillRect(0, 0, rectWndBounds.width, rectWndBounds.height); + + g.setColor(new Color(rnd.nextInt(0xffffff))); + Rectangle rectStrBounds; + + g.setFont(f); + + rectStrBounds = g.getFontMetrics(). + getStringBounds(rectWndBounds.toString(), g).getBounds(); + rectStrBounds.height += 30; + g.drawString(rectWndBounds.toString(), 50, rectStrBounds.height); + int oldHeight = rectStrBounds.height; + String isFSupported = "Exclusive Fullscreen mode supported: " + + gc.getDevice().isFullScreenSupported(); + rectStrBounds = g.getFontMetrics(). + getStringBounds(isFSupported, g).getBounds(); + rectStrBounds.height += (10 + oldHeight); + g.drawString(isFSupported, 50, rectStrBounds.height); + + oldHeight = rectStrBounds.height; + String isDMChangeSupported = "Display Mode Change supported: " + + gc.getDevice().isDisplayChangeSupported(); + rectStrBounds = g.getFontMetrics(). + getStringBounds(isDMChangeSupported, g).getBounds(); + rectStrBounds.height += (10 + oldHeight); + g.drawString(isDMChangeSupported, 50, rectStrBounds.height); + + oldHeight = rectStrBounds.height; + String usingBS = "Using BufferStrategy: " + useBS; + rectStrBounds = g.getFontMetrics(). + getStringBounds(usingBS, g).getBounds(); + rectStrBounds.height += (10 + oldHeight); + g.drawString(usingBS, 50, rectStrBounds.height); + + final String m_strQuitMsg = "Double-click to dispose FullScreen Window"; + rectStrBounds = g.getFontMetrics(). + getStringBounds(m_strQuitMsg, g).getBounds(); + g.drawString(m_strQuitMsg, + (rectWndBounds.width - rectStrBounds.width) / 2, + (rectWndBounds.height - rectStrBounds.height) / 2); + + + } + + public void actionPerformed(ActionEvent ae) { + GraphicsDevice dev = deviceMap.get(ae.getSource()); + System.err.println("Setting FS on device:"+dev); + final Window fsWindow; + + if (useFSWindow) { + fsWindow = new Window(this, dev.getDefaultConfiguration()) { + public void paint(Graphics g) { + renderDimensions(g, getBounds(), + this.getGraphicsConfiguration()); + } + }; + } else if (useFSDialog) { + fsWindow = new Dialog((Frame)null, "FS Dialog on device "+dev, false, + dev.getDefaultConfiguration()); + fsWindow.add(new Component() { + public void paint(Graphics g) { + renderDimensions(g, getBounds(), + this.getGraphicsConfiguration()); + } + }); + } else { + fsWindow = new Frame("FS Frame on device "+dev, + dev.getDefaultConfiguration()) + { + public void paint(Graphics g) { + renderDimensions(g, getBounds(), + this.getGraphicsConfiguration()); + } + }; + if (addHWChildren) { + fsWindow.add("South", new Panel() { + public void paint(Graphics g) { + g.setColor(Color.red); + g.fillRect(0, 0, getWidth(), getHeight()); + } + }); + fsWindow.add("North", new Button("Button, sucka!")); + } + } + fsWindow.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() > 1) { + done = true; + fsWindow.dispose(); + } + } + }); + + fsWindow.addWindowListener(new WindowHandler()); + dev.setFullScreenWindow(fsWindow); + if (dmChange && dev.isDisplayChangeSupported()) { + DisplayMode dms[] = dev.getDisplayModes(); + DisplayMode myDM = null; + for (DisplayMode dm : dms) { + if (dm.getWidth() == 800 && dm.getHeight() == 600 && + (dm.getBitDepth() >= 16 || + dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) && + (dm.getRefreshRate() >= 60 || + dm.getRefreshRate() == DisplayMode.REFRESH_RATE_UNKNOWN)) + { + myDM = dm; + break; + } + } + if (myDM != null) { + System.err.println("Setting Display Mode: "+ + myDM.getWidth() + "x" + myDM.getHeight() + "x" + + myDM.getBitDepth() + "@" + myDM.getRefreshRate() + + "Hz on device" + dev); + dev.setDisplayMode(myDM); + } else { + System.err.println("Can't find suitable display mode."); + } + } + done = false; + if (runRenderLoop) { + Thread updateThread = new Thread(new Runnable() { + public void run() { + BufferStrategy bs = null; + if (useBS) { + fsWindow.createBufferStrategy(2); + bs = fsWindow.getBufferStrategy(); + } + while (!done) { + if (useBS) { + Graphics g = bs.getDrawGraphics(); + renderDimensions(g, fsWindow.getBounds(), + fsWindow.getGraphicsConfiguration()); + bs.show(); + } else { + fsWindow.repaint(); + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) {} + } + if (useBS) { + bs.dispose(); + } + } + }); + updateThread.start(); + } + } + + public static void main(String args[]) { + for (String s : args) { + if (s.equalsIgnoreCase("-dm")) { + System.err.println("Do Display Change after entering FS mode"); + dmChange = true; + } else if (s.equalsIgnoreCase("-usewindow")) { + System.err.println("Using Window to enter FS mode"); + useFSWindow = true; + } else if (s.equalsIgnoreCase("-setnull")) { + System.err.println("Setting null FS window on dispose"); + setNullOnDispose = true; + } else { + System.err.println("Usage: MultimonFullscreenTest " + + "[-dm][-usewindow][-setnull]"); + } + + } + MultimonFullscreenTest fs = + new MultimonFullscreenTest("Test Full Screen"); + } + class WindowHandler extends WindowAdapter { + public void windowClosing(WindowEvent we) { + done = true; + Window w = (Window)we.getSource(); + if (setNullOnDispose) { + w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null); + } + w.dispose(); + } + } +} diff --git a/jdk/test/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java b/jdk/test/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java new file mode 100644 index 00000000000..2e6ccdfb024 --- /dev/null +++ b/jdk/test/java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java @@ -0,0 +1,216 @@ +/* + * 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. + * + * 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 6646411 + * @summary Tests that full screen window and its children receive resize + event when display mode changes + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm NoResizeEventOnDMChangeTest + * @run main/othervm -Dsun.java2d.d3d=false NoResizeEventOnDMChangeTest + */ + +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.DisplayMode; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Window; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class NoResizeEventOnDMChangeTest { + public static void main(String[] args) { + final GraphicsDevice gd = GraphicsEnvironment. + getLocalGraphicsEnvironment().getDefaultScreenDevice(); + + if (!gd.isFullScreenSupported()) { + System.out.println("Full screen not supported, test passed"); + return; + } + + DisplayMode dm = gd.getDisplayMode(); + final DisplayMode dms[] = new DisplayMode[2]; + for (DisplayMode dm1 : gd.getDisplayModes()) { + if (dm1.getWidth() != dm.getWidth() || + dm1.getHeight() != dm.getHeight()) + { + dms[0] = dm1; + break; + } + } + if (dms[0] == null) { + System.out.println("Test Passed: all DMs have same dimensions"); + return; + } + dms[1] = dm; + + Frame f = new Frame() { + @Override + public void paint(Graphics g) { + g.setColor(Color.red); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.green); + g.drawRect(0, 0, getWidth()-1, getHeight()-1); + } + }; + f.setUndecorated(true); + testFSWindow(gd, dms, f); + + Window w = new Window(f) { + @Override + public void paint(Graphics g) { + g.setColor(Color.magenta); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.cyan); + g.drawRect(0, 0, getWidth()-1, getHeight()-1); + } + }; + testFSWindow(gd, dms, w); + System.out.println("Test Passed."); + } + + private static void testFSWindow(final GraphicsDevice gd, + final DisplayMode dms[], + final Window fsWin) + { + System.out.println("Testing FS window: "+fsWin); + Component c = new Canvas() { + @Override + public void paint(Graphics g) { + g.setColor(Color.blue); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.magenta); + g.drawRect(0, 0, getWidth()-1, getHeight()-1); + g.setColor(Color.red); + g.drawString("FS Window : " + fsWin, 50, 50); + DisplayMode dm = + getGraphicsConfiguration().getDevice().getDisplayMode(); + g.drawString("Display Mode: " + + dm.getWidth() + "x" + dm.getHeight(), 50, 75); + } + }; + fsWin.add("Center", c); + fsWin.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + fsWin.dispose(); + if (fsWin.getOwner() != null) { + fsWin.getOwner().dispose(); + } + } + }); + + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + gd.setFullScreenWindow(fsWin); + } + }); + } catch (Exception ex) {} + + sleep(1000); + + final ResizeEventChecker r1 = new ResizeEventChecker(); + final ResizeEventChecker r2 = new ResizeEventChecker(); + + if (gd.isDisplayChangeSupported()) { + fsWin.addComponentListener(r1); + c.addComponentListener(r2); + for (final DisplayMode dm1 : dms) { + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + System.err.printf("----------- Setting DM %dx%d:\n", + dm1.getWidth(), dm1.getHeight()); + try { + gd.setDisplayMode(dm1); + r1.incDmChanges(); + r2.incDmChanges(); + } catch (IllegalArgumentException iae) {} + } + }); + } catch (Exception ex) {} + for (int i = 0; i < 3; i++) { + fsWin.repaint(); + sleep(1000); + } + } + fsWin.removeComponentListener(r1); + c.removeComponentListener(r2); + } + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + gd.setFullScreenWindow(null); + fsWin.dispose(); + if (fsWin.getOwner() != null) { + fsWin.getOwner().dispose(); + } + } + }); + } catch (Exception ex) {} + + System.out.printf("FS Window: resizes=%d, dm changes=%d\n", + r1.getResizes(), r1.getDmChanges()); + System.out.printf("Component: resizes=%d, dm changes=%d\n", + r2.getResizes(), r2.getDmChanges()); + if (r1.getResizes() < r1.getDmChanges()) { + throw new RuntimeException("FS Window didn't receive all resizes!"); + } + if (r2.getResizes() < r2.getDmChanges()) { + throw new RuntimeException("Component didn't receive all resizes!"); + } + } + + static void sleep(long ms) { + try { + Thread.sleep(ms); + } catch (InterruptedException ex) {} + } + static class ResizeEventChecker extends ComponentAdapter { + int dmChanges; + int resizes; + + @Override + public synchronized void componentResized(ComponentEvent e) { + System.out.println("Received resize event for "+e.getSource()); + resizes++; + } + public synchronized int getResizes() { + return resizes; + } + public synchronized void incDmChanges() { + dmChanges++; + } + public synchronized int getDmChanges() { + return dmChanges; + } + } +} diff --git a/jdk/test/java/awt/FullScreen/SetFSWindow/FSFrame.java b/jdk/test/java/awt/FullScreen/SetFSWindow/FSFrame.java new file mode 100644 index 00000000000..c4d423114f7 --- /dev/null +++ b/jdk/test/java/awt/FullScreen/SetFSWindow/FSFrame.java @@ -0,0 +1,204 @@ +/* + * Copyright 2005-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. + * + * 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 6240507 6662642 + * @summary verify that isFullScreenSupported and getFullScreenWindow work + * correctly with and without a SecurityManager. Note that the test may fail + * on older Gnome versions (see bug 6500686). + * @run main FSFrame + * @run main/othervm -Dsun.java2d.noddraw=true FSFrame + * @author cheth + */ + +import java.awt.*; +import java.awt.image.*; +import java.applet.*; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import javax.imageio.ImageIO; + +public class FSFrame extends Frame implements Runnable { + + // Don't start the test until the window is visible + boolean visible = false; + Robot robot = null; + static volatile boolean done = false; + + public void paint(Graphics g) { + if (!visible && getWidth() != 0 && getHeight() != 0) { + visible = true; + try { + GraphicsDevice gd = getGraphicsConfiguration().getDevice(); + robot = new Robot(gd); + } catch (Exception e) { + System.out.println("Problem creating robot: cannot verify FS " + + "window display"); + } + } + g.setColor(Color.green); + g.fillRect(0, 0, getWidth(), getHeight()); + } + + @Override + public void update(Graphics g) { + paint(g); + } + + boolean checkColor(int x, int y, BufferedImage bImg) { + int pixelColor; + int correctColor = Color.green.getRGB(); + pixelColor = bImg.getRGB(x, y); + if (pixelColor != correctColor) { + System.out.println("FAILURE: pixelColor " + + Integer.toHexString(pixelColor) + + " != correctColor " + + Integer.toHexString(correctColor) + + " at coordinates (" + x + ", " + y + ")"); + return false; + } + return true; + } + + void checkFSDisplay(boolean fsSupported) { + GraphicsConfiguration gc = getGraphicsConfiguration(); + GraphicsDevice gd = gc.getDevice(); + Rectangle r = gc.getBounds(); + Insets in = null; + if (!fsSupported) { + in = Toolkit.getDefaultToolkit().getScreenInsets(gc); + r = new Rectangle(in.left, in.top, + r.width - (in.left + in.right), + r.height - (in.top + in.bottom)); + } + BufferedImage bImg = robot.createScreenCapture(r); + // Check that all four corners and middle pixel match the window's + // fill color + if (robot == null) { + return; + } + boolean colorCorrect = true; + colorCorrect &= checkColor(0, 0, bImg); + colorCorrect &= checkColor(0, bImg.getHeight() - 1, bImg); + colorCorrect &= checkColor(bImg.getWidth() - 1, 0, bImg); + colorCorrect &= checkColor(bImg.getWidth() - 1, bImg.getHeight() - 1, bImg); + colorCorrect &= checkColor(bImg.getWidth() / 2, bImg.getHeight() / 2, bImg); + if (!colorCorrect) { + System.err.println("Test failed for mode: fsSupported="+fsSupported); + if (in != null) { + System.err.println("screen insets : " + in); + } + System.err.println("screen shot rect: " + r); + String name = "FSFrame_fs_"+ + (fsSupported?"supported":"not_supported")+".png"; + try { + ImageIO.write(bImg, "png", new File(name)); + System.out.println("Dumped screen shot to "+name); + } catch (IOException ex) {} + throw new Error("Some pixel colors not correct; FS window may not" + + " have been displayed correctly"); + } + } + + void checkFSFunctionality(boolean withSecurity) { + GraphicsDevice gd = getGraphicsConfiguration().getDevice(); + if (withSecurity) { + SecurityManager sm = new SecurityManager(); + System.setSecurityManager(sm); + } + try { + // None of these should throw an exception + final boolean fs = gd.isFullScreenSupported(); + System.out.println("FullscreenSupported: " + (fs ? "yes" : "no")); + gd.setFullScreenWindow(this); + try { + // Give the system time to set the FS window and display it + // properly + Thread.sleep(2000); + } catch (Exception e) {} + if (!withSecurity) { + // See if FS window got displayed correctly + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + repaint(); + checkFSDisplay(fs); + } + }); + } catch (InvocationTargetException ex) { + ex.printStackTrace(); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + // reset window + gd.setFullScreenWindow(null); + try { + // Give the system time to set the FS window and display it + // properly + Thread.sleep(2000); + } catch (Exception e) {} + } catch (SecurityException e) { + e.printStackTrace(); + throw new Error("Failure: should not get an exception when " + + "calling isFSSupported or setFSWindow"); + } + } + + public void run() { + boolean firstTime = true; + while (!done) { + if (visible) { + checkFSFunctionality(false); + checkFSFunctionality(true); + done = true; + } else { + // sleep while we wait + try { + // Give the system time to set the FS window and display it + // properly + Thread.sleep(100); + } catch (Exception e) {} + } + } + System.out.println("PASS"); + } + + public static void main(String args[]) { + FSFrame frame = new FSFrame(); + frame.setUndecorated(true); + Thread t = new Thread(frame); + frame.setSize(500, 500); + frame.setVisible(true); + t.start(); + while (!done) { + try { + // Do not exit the main thread until the test is finished + Thread.sleep(1000); + } catch (Exception e) {} + } + frame.dispose(); + } +} diff --git a/jdk/test/java/awt/Mixing/ValidBounds.java b/jdk/test/java/awt/Mixing/ValidBounds.java index dec7e6fce44..49a3da46660 100644 --- a/jdk/test/java/awt/Mixing/ValidBounds.java +++ b/jdk/test/java/awt/Mixing/ValidBounds.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/Modal/WsDisabledStyle/CloseBlocker/CloseBlocker.java b/jdk/test/java/awt/Modal/WsDisabledStyle/CloseBlocker/CloseBlocker.java index ad48949b3ac..a632334b524 100644 --- a/jdk/test/java/awt/Modal/WsDisabledStyle/CloseBlocker/CloseBlocker.java +++ b/jdk/test/java/awt/Modal/WsDisabledStyle/CloseBlocker/CloseBlocker.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/Modal/WsDisabledStyle/OverBlocker/OverBlocker.java b/jdk/test/java/awt/Modal/WsDisabledStyle/OverBlocker/OverBlocker.java index 15d963baa08..09c409e19b9 100644 --- a/jdk/test/java/awt/Modal/WsDisabledStyle/OverBlocker/OverBlocker.java +++ b/jdk/test/java/awt/Modal/WsDisabledStyle/OverBlocker/OverBlocker.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/Modal/WsDisabledStyle/Winkey/Winkey.java b/jdk/test/java/awt/Modal/WsDisabledStyle/Winkey/Winkey.java index 59297463a2e..90ce56f8213 100644 --- a/jdk/test/java/awt/Modal/WsDisabledStyle/Winkey/Winkey.java +++ b/jdk/test/java/awt/Modal/WsDisabledStyle/Winkey/Winkey.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java new file mode 100644 index 00000000000..e49736ca875 --- /dev/null +++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java @@ -0,0 +1,131 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that drag events are coming for every button if the property is set to true + @author Andrei Dmitriev : area=awt.mouse + @run main ExtraButtonDrag + */ + +//events from standard should also come + +import java.awt.*; +import java.awt.event.*; + +public class ExtraButtonDrag extends Frame { + static String tk = Toolkit.getDefaultToolkit().getClass().getName(); + static Robot robot; + static int [] buttonsPressed; + static int [] buttonsReleased; + static int [] buttonsClicked; + volatile static boolean dragged = false; + volatile static boolean moved = false; + + public ExtraButtonDrag(){ + super("ExtraButtonDrag"); + } + + public static void main(String []s){ + Frame frame = new ExtraButtonDrag(); + + MouseAdapter ma = new MouseAdapter() { + public void mouseDragged(MouseEvent e) { + System.out.println("Dragged "+e);// +" : "+ e.getButton() + " : " +e.getButtonState(e.getButton())); + dragged = true; + } + public void mouseMoved(MouseEvent e) { + System.out.println("Moved "+e); + moved = true; + } + public void mousePressed(MouseEvent e) { + System.out.println(">>> "+e); + } + public void mouseReleased(MouseEvent e) { + System.out.println(">>> "+e); + } + + }; + + frame.addMouseMotionListener(ma); + frame.addMouseListener(ma); + + frame.setSize(300, 300); + frame.setVisible(true); + + int [] buttonMask = new int [MouseInfo.getNumberOfButtons()]; //InputEvent.getButtonMasks(); + + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonMask[i] = InputEvent.getMaskForButton(i+1); + // System.out.println("TEST: "+tmp[i]); + } + + try { + robot = new Robot(); + robot.delay(1000); + Point centerFrame = new Point(frame.getLocationOnScreen().x + frame.getWidth()/2, frame.getLocationOnScreen().y + frame.getHeight()/2); + Point outboundsFrame = new Point(frame.getLocationOnScreen().x + frame.getWidth()*3/2, frame.getLocationOnScreen().y + frame.getHeight()/2); + + System.out.println("areExtraMouseButtonsEnabled() == " + Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() ); + + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + System.out.println("button to drag = " +(i+1) + " : value passed to robot = " +buttonMask[i]); + + try { + dragMouse(buttonMask[i], centerFrame.x, centerFrame.y, outboundsFrame.x, outboundsFrame.y); + } catch (IllegalArgumentException e){ + throw new RuntimeException("Test failed. Exception occured.", e); + } + + robot.delay(500); + //this is a choice-case for X protocol issue: native events from extra buttons doesn't contain + // the correct state so it's unable to decide if there is a drag or move. By default we send MOVED event. + //XToolkit: extra buttons should report MOVED events only + //WToolkit: extra buttons should report DRAGGED events only + if (i > 2){ //extra buttons only + if (tk.equals("sun.awt.X11.XToolkit") || tk.equals("sun.awt.motif.MToolkit")) { + if (!moved || dragged) { + throw new RuntimeException("Test failed."+ tk +" Button = " +(i+1) + " moved = "+moved +" : dragged = " +dragged); + } + } else { //WToolkit + if (moved || !dragged) { + throw new RuntimeException("Test failed."+ tk +" Button = " +(i+1) + " moved = "+moved +" : dragged = " +dragged); + } + } + } else { + if (moved || !dragged){ + throw new RuntimeException("Test failed. Button = " +(i+1) + " not dragged."); + } + } + } + } catch (Exception e){ + throw new RuntimeException("", e); + } + } + + public static void dragMouse(int button, int x0, int y0, int x1, int y1){ + int curX = x0; + int curY = y0; + int dx = x0 < x1 ? 1 : -1; + int dy = y0 < y1 ? 1 : -1; + robot.mouseMove(x0, y0); + + robot.delay(200); + dragged = false; + moved = false; + + robot.mousePress(button); + + while (curX != x1){ + curX += dx; + robot.mouseMove(curX, curY); + robot.delay(5); + } + while (curY != y1 ){ + curY += dy; + robot.mouseMove(curX, curY); + robot.delay(5); + } + robot.mouseRelease(button); + } + +} + diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ModifierPermutation.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ModifierPermutation.java new file mode 100644 index 00000000000..2c22669a4da --- /dev/null +++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/ModifierPermutation.java @@ -0,0 +1,320 @@ +/* + test %I% %E% + @bug 6315717 + @summary presses buttons in all permutations and verifies modifiers + @author Andrei Dmitriev : area=awt.mouse + @run main ModifierPermutation + */ +//package modifierpermutation; + +/* +The test will try to press-release every button present on the mouse in different order. +Here are some abbreviations: + BUTTON1 press = P1 + BUTTON2 press = P2 etc. + BUTTON1 release = R1 + BUTTON2 release = R2 etc. +Only sequences alike below are possible : . +Sequences like will not be covered by this test due to its probable complexity. + */ + +import java.awt.*; +import sun.awt.SunToolkit; +import java.awt.event.*; +import java.util.Arrays; + +public class ModifierPermutation { + static boolean failed = false; + final static int BUTTONSNUMBER = MouseInfo.getNumberOfButtons(); + +/* + * Because of some problems with BUTTONx_MASK + * (they are not ordered. Instead, their values are: 16 8 4) + * We have to use array [1..n] and make every permutation on its + * containment. After each permutation, make the same thing with + * array of buttons and array of expected modifiers. + */ + static SunToolkit st = (SunToolkit)(Toolkit.getDefaultToolkit()); + //all button masks + static int [] mouseButtons = new int [BUTTONSNUMBER]; //BUTTONx_MASK + static int [] mouseButtonsDown = new int [BUTTONSNUMBER]; //BUTTONx_DOWN_MASK + + //used to store mouse buttons sequences to press/to release + static int [] affectedButtonsToPressRelease; +// static int [] buttonsToRelease; +// static int [] modifiersToVerifyOnPressRelease; + + static Robot robot; + static CheckingAdapter adapterTest1; + static Frame f; + + static { + for (int i = 0; i < BUTTONSNUMBER; i++){ + mouseButtons[i] = InputEvent.getMaskForButton(i+1); //then change first three elements here to BUTTONx_MASK + mouseButtonsDown[i] = InputEvent.getMaskForButton(i+1); + } + //mouseButtons initially has following values : 16 8 4. +/* mouseButtons[0] = InputEvent.BUTTON1_MASK; + mouseButtons[1] = InputEvent.BUTTON2_MASK; + mouseButtons[2] = InputEvent.BUTTON3_MASK; + */ + } + + public static void main(String s[]){ + init(); + + try { + robot = new Robot(); + } catch (Exception e){ + e.printStackTrace(); + throw new RuntimeException("Test failed.", e); + } + robot.delay(500); + robot.mouseMove(f.getLocationOnScreen().x + f.getWidth()/2, f.getLocationOnScreen().y + f.getHeight()/2); + robot.delay(500); + //Top limit is the factorial of the number of existing buttons + for (int k = 0; k < factorial(mouseButtons.length)-1; k++){ + //now we will press 2 up to maximum buttons and release them in different order and listen for + // PRESSED events and check it's ExModifiers + for (int buttonsToPressNumber = 2; buttonsToPressNumber <= BUTTONSNUMBER; buttonsToPressNumber++ ){ + System.out.println(">>>"); + + //Now get the slice of affected buttons + affectedButtonsToPressRelease = Arrays.copyOf(mouseButtons, buttonsToPressNumber); +// modifiersToVerifyOnPressRelease = Arrays.copyOf(mouseButtons, buttonsToPressNumber); + + //Now press all these buttons in the order as they are in array affectedButtonsToPressRelease + //And release all these buttons in back order. + + dumpArray("Affected Buttons ", affectedButtonsToPressRelease); + pressAllButtons(affectedButtonsToPressRelease); + releaseAllButtonsForwardOrder(affectedButtonsToPressRelease); +// nextPermutation(i, buttonsToRelease); + //TODO: press buttons and release them backward + //All I have to add is : +// pressAllButtons(affectedButtonsToPressRelease); +// releaseAllButtonsBackwardOrder(affectedButtonsToPressRelease); + + System.out.println("<<<"); + } + nextPermutation(k, mouseButtons); +// PermutationGenerator.nextPermutation(k, mouseButtonsDown); + dumpArray("mouseButtons (step="+k+")", mouseButtons); +// dumpArray("mouseButtonsDown (step="+k+")", mouseButtonsDown); + } + } + + private static void init(){ + adapterTest1 = new CheckingAdapter(); + f = new Frame("Robot presses mouse here"); + f.setSize(300, 300); + f.setVisible(true); + f.addMouseListener(adapterTest1); + } + public static int factorial(int t){ + if (t <=1 ) { + return 1; + } else { + return t*factorial(t-1); + } + } + + // use this variable to get current button on EDT in checkModifiers() + static volatile int currentButtonIndexUnderAction; + + public static void pressAllButtons(int []array){ + for (int i = 0; i =0) { + if (array[i] < array[i+1]){ + leftEl = i; + // System.out.println("leftEl = "+leftEl); + break; + } + i--; + } + + i = array.length - 1; + while (i>=0) { + if (array[i] > array[leftEl]) { + rightEl = i; + // System.out.println("rightEl = "+rightEl); + break; + } + i--; + } + swapElements(array, leftEl, rightEl); + if (leftEl + 2 < array.length){ + // System.out.println("sort"); + Arrays.sort(array, leftEl + 1 , array.length); + } + } + + public static void swapElements(int [] array, int leftEl, int rightEl){ + int tmp = array[leftEl]; + array[leftEl] = array[rightEl]; + array[rightEl] = tmp; + } + + public static void checkModifiersOnRelease(MouseEvent e){ + System.out.println("CheckModifiersOnRelease. currentButtonIndexUnderAction ="+currentButtonIndexUnderAction); + for (int i = currentButtonIndexUnderAction+1; i=0) { + if (buttonIndicesToPermutate[i] < buttonIndicesToPermutate[i+1]){ + leftEl = i; + // System.out.println("leftEl = "+leftEl); + break; + } + i--; + } + + i = array.length - 1; + while (i>=0) { + if (buttonIndicesToPermutate[i] >buttonIndicesToPermutate[leftEl]) { + rightEl = i; + // System.out.println("rightEl = "+rightEl); + break; + } + i--; + } + swapElements(array, leftEl, rightEl); + swapElements(buttonIndicesToPermutate, leftEl, rightEl); + + if (leftEl + 2 < array.length){ + // System.out.println("sort"); +//need to make our own sorting because arraysort makes this on actual values in array... + Arrays.sort(array, leftEl + 1 , array.length); + Arrays.sort(buttonIndicesToPermutate, leftEl + 1 , buttonIndicesToPermutate.length); +// sortArray(array, leftEl + 1 , array.length); + } + } + public static void swapElements(int [] array, int leftEl, int rightEl){ + int tmp = array[leftEl]; + array[leftEl] = array[rightEl]; + array[rightEl] = tmp; + } +} +*/ diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java new file mode 100644 index 00000000000..f70b8dd691b --- /dev/null +++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Extra.java @@ -0,0 +1,490 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that modifiers are correct for extra buttons + @author Andrei Dmitriev : area=awt.mouse + @run main MouseModifiersUnitTest_Extra + */ + +import java.awt.*; +import java.awt.event.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.StringTokenizer; +import java.util.Vector; + +// will process extra buttons only +// asking parameters from CMD: manual/automatic, modifier to test + +public class MouseModifiersUnitTest_Extra extends Frame { + static final int NONE = 0; + static final int SHIFT = 1; + static final int CTRL = 2; + static final int ALT = 3; + static CheckingModifierAdapter adapterTest1; + static CheckingModifierAdapter adapterTest2; + static CheckingModifierAdapter adapterTest3; + static CheckingModifierAdapter adapterTest4; + + static boolean debug = true; //dump all errors (debug) or throw first(under jtreg) exception + static boolean autorun = false; //use robot or manual run + static int testModifier = NONE; + + static int [] mouseButtons; + static int [] mouseButtonDownMasks; + + //an arrays representing a modifiersEx of extra mouse buttons while using ALT/CTRL/SHIFT or none of them + static int [] modifiersExStandard; + static int [] modifiersExStandardSHIFT; + static int [] modifiersExStandardCTRL; + static int [] modifiersExStandardALT; + + // final static int [] mouseButtons = new int [] {MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON3_MASK}; + // BUTTON1, 2, 3 press-release. + final static int modifiersStandard = 0; //InputEvent.BUTTON_DOWN_MASK; + + public static void checkPressedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardExModifiers = getStandardExArray(testModifier); + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 4)*3; + dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]); + if (modifiers != modifiersStandard){ + MessageLogger.reportError("Test failed : Pressed. modifiers != modifiersStandard"); + } + + if (modifiersEx != curStandardExModifiers[index]){ +// System.out.println(">>>>>>>>>>>>>>> Pressed. modifiersEx "+modifiersEx +" : "+!= curStandardExModifiers"); + MessageLogger.reportError("Test failed : Pressed. modifiersEx != curStandardExModifiers"); + } + + //check event.paramString() output + HashMap paramStringElements = tokenizeParamString(event.paramString()); + System.out.println(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + checkExtModifiersOnPress(testModifier, paramStringElements, button); + } + + public static void checkExtModifiersOnReleaseClick(int testModifier, HashMap h, int button){ + String ethalon = ""; + switch (testModifier){ + case SHIFT:{ + ethalon = "Shift"; + break; + } + case ALT:{ + ethalon = "Alt"; + break; + } + case CTRL:{ + ethalon = "Ctrl"; + break; + } + } + // + if (h.get("extModifiers") == null){ + h.put("extModifiers", ""); + } + if (!ethalon.equals(h.get("extModifiers"))) { + MessageLogger.reportError("Test failed : Released/Clicked. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + } + } + + public static void checkExtModifiersOnPress(int testModifier, HashMap h, int button){ + String ethalon = ""; + switch (testModifier){ + case SHIFT:{ + ethalon = "Shift+"; + break; + } + case ALT:{ + ethalon = "Alt+"; + break; + } + case CTRL:{ + ethalon = "Ctrl+"; + break; + } + } + ethalon = ethalon + "Button" +button; + + if (!h.get("extModifiers").equals(ethalon)) { + MessageLogger.reportError("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + } + } + + public static void checkModifiers(int testModifier, HashMap h, int button){ + // none of modifiers for extra button should be null + if (h.get("modifiers") != null) { + MessageLogger.reportError("Test failed : modifiers != null"); + } + } + + public static void checkButton(HashMap h, int button){ + if (h.get("button") == null) { + MessageLogger.reportError("Test failed : checkButton(). button is absent in paramString()"); + } + if (Integer.parseInt(h.get("button")) != button) { + MessageLogger.reportError("Test failed : checkButton. button in paramString() doesn't equal to button being pressed."); + } + } + public static HashMap tokenizeParamString(String param){ + HashMap params = new HashMap(); + StringTokenizer st = new StringTokenizer(param, ",="); + while (st.hasMoreTokens()){ + String tmp = st.nextToken(); +// System.out.println("PARSER : "+tmp); + if (tmp.equals("button") || + tmp.equals("modifiers") || + tmp.equals("extModifiers")) { + params.put(tmp, st.nextToken()); + } + } + return params; + } + + public static Vector tokenizeModifiers(String modifierList){ + Vector modifiers = new Vector(); + StringTokenizer st = new StringTokenizer(modifierList, "+"); + while (st.hasMoreTokens()){ + String tmp = st.nextToken(); + modifiers.addElement(tmp); + System.out.println("MODIFIER PARSER : "+tmp); + } + return modifiers; + } + + public static void checkReleasedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardExModifiers = getStandardExArray(testModifier); + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 4)*3 + 1; + dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]); + if (modifiers != modifiersStandard){ + MessageLogger.reportError("Test failed : Released. modifiers != modifiersStandard"); + } + + if (modifiersEx != curStandardExModifiers[index]){ + MessageLogger.reportError("Test failed : Released. modifiersEx != curStandardExModifiers"); + } + + //check event.paramString() output + HashMap paramStringElements = tokenizeParamString(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + System.out.println("paramStringElements = "+paramStringElements); + checkExtModifiersOnReleaseClick(testModifier, paramStringElements, button); + } + + public static void checkClickedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardExModifiers = getStandardExArray(testModifier); + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 4)*3 + 2; + dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]); + if (modifiers != modifiersStandard){ + MessageLogger.reportError("Test failed : Clicked. modifiers != modifiersStandard"); + } + + if (modifiersEx != curStandardExModifiers[index]){ + MessageLogger.reportError("Test failed : Clicked. modifiersEx != curStandardExModifiers"); + } + + //check event.paramString() output + HashMap paramStringElements = tokenizeParamString(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + checkExtModifiersOnReleaseClick(testModifier, paramStringElements, button); + } + + private static int[] getStandardExArray(int testModifier) { + int [] curStandardExModifiers; + switch (testModifier){ + case SHIFT: + curStandardExModifiers = modifiersExStandardSHIFT; + break; + case CTRL: + curStandardExModifiers = modifiersExStandardCTRL; + break; + case ALT: + curStandardExModifiers = modifiersExStandardALT; + break; + default: //NONE by default + curStandardExModifiers = modifiersExStandard; + } + return curStandardExModifiers; + } + + static Robot robot; + public void init() { + this.setLayout(new BorderLayout()); + + String[] instructions = + { + "This test should be used with the mouse having more then three buttons.", + "Currently, " + MouseInfo.getNumberOfButtons() +" buttons are available.", + "If there are less then three buttons, press PASS.", + "1. Press each extra mouse button.", + "2. For each mouse event its modifiers and ExModifiers will be printed.", + "3. Verify that they are correct.", + "4. Press Pass or Fail accordingly." + }; +// Sysout.createDialogWithInstructions( instructions ); + +// addMouseListener(adapterTest1); + try { + robot = new Robot(); + } catch (Exception e) { + MessageLogger.reportError("Test failed. "+e); + } + }//End init() + + public void start() { + //Get things going. Request focus, set size, et cetera + setSize(200,200); + setVisible(true); + validate(); + if (autorun) { + testNONE(); + testSHIFT(); + testCTRL(); + testALT(); + } else { + switch (testModifier){ + case SHIFT: + this.addMouseListener(adapterTest2); + break; + case CTRL: + this.addMouseListener(adapterTest3); + break; + case ALT: + this.addMouseListener(adapterTest4); + break; + default: //NONE by default + this.addMouseListener(adapterTest1); + } + } + }// start() + + //000000000000000000000000000000000000000000000000000000000000000 + public void testNONE(){ + this.addMouseListener(adapterTest1); + robot.delay(1000); + robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); + for (int i = 3; i< mouseButtons.length; i++){ + System.out.println("testNONE() => " +mouseButtons[i] ); + robot.mousePress(mouseButtons[i]); + robot.delay(100); + robot.mouseRelease(mouseButtons[i]); + } + robot.delay(1000); + this.removeMouseListener(adapterTest1); + } + + public void testSHIFT(){ + this.addMouseListener(adapterTest2); + robot.delay(1000); + robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); + for (int i = 3; i< mouseButtons.length; i++){ + robot.keyPress(KeyEvent.VK_SHIFT); + System.out.println("testSHIFT() => " +mouseButtons[i] ); + robot.mousePress(mouseButtons[i]); + robot.delay(100); + robot.mouseRelease(mouseButtons[i]); + robot.keyRelease(KeyEvent.VK_SHIFT); + } + robot.delay(1000); + this.removeMouseListener(adapterTest2); + } + + public void testCTRL(){ + this.addMouseListener(adapterTest3); + robot.delay(1000); + robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); + for (int i = 3; i< mouseButtons.length; i++){ + robot.keyPress(KeyEvent.VK_CONTROL); + System.out.println("testCTRL() => " +mouseButtons[i] ); + robot.mousePress(mouseButtons[i]); + robot.delay(100); + robot.mouseRelease(mouseButtons[i]); + robot.keyRelease(KeyEvent.VK_CONTROL); + } + robot.delay(1000); + this.removeMouseListener(adapterTest3); + } + + public void testALT(){ + this.addMouseListener(adapterTest4); + robot.delay(1000); + robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2); + for (int i = 3; i< mouseButtons.length; i++){ + robot.keyPress(KeyEvent.VK_ALT); + System.out.println("testALT() => " +mouseButtons[i] ); + robot.mousePress(mouseButtons[i]); + robot.delay(100); + robot.mouseRelease(mouseButtons[i]); + robot.keyRelease(KeyEvent.VK_ALT); + } + robot.delay(1000); + this.removeMouseListener(adapterTest4); + } + + //************************************************************************************************** + public static void dumpValues(int button, int modifiers, int modifiersStandard, int modifiersEx, int modifiersExStandard){ + System.out.println("Button = "+button + "Modifiers = "+ modifiers + "standard = "+ modifiersStandard); + System.out.println("Button = "+button + "ModifiersEx = "+ modifiersEx + "standardEx = "+ modifiersExStandard); + } + + public static void initParams(String []s){ + if (s.length != 3){ + autorun = true; + debug = false; + testModifier = NONE; + } else { + autorun = Boolean.valueOf(s[0]); + debug = Boolean.valueOf(s[1]); + + if (s[2].equals("NONE")){ + testModifier = NONE; + } + if (s[2].equals("SHIFT")){ + testModifier = SHIFT; + } + if (s[2].equals("CTRL")){ + testModifier = CTRL; + } + if (s[2].equals("ALT")){ + testModifier = ALT; + } + } + MessageLogger.setDebug(debug); + System.out.println("Autorun : " +autorun); + System.out.println("Debug mode : " +debug); + System.out.println("Modifier to verify : " + testModifier); + } + + public static void initAdapters(){ + adapterTest1 = new CheckingModifierAdapter(NONE); + adapterTest2 = new CheckingModifierAdapter(SHIFT); + adapterTest3 = new CheckingModifierAdapter(CTRL); + adapterTest4 = new CheckingModifierAdapter(ALT); + } + + public static void initVars(){ + int [] tmp = new int [MouseInfo.getNumberOfButtons()]; + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + tmp[i] = InputEvent.getMaskForButton(i+1); + // System.out.println("TEST: "+tmp[i]); + } + + mouseButtons = Arrays.copyOf(tmp, tmp.length); + + for (int i = 0; i < mouseButtons.length; i++){ + System.out.println("MouseArray [i] == "+mouseButtons[i]); + } + + mouseButtonDownMasks = Arrays.copyOf(tmp, tmp.length); + + // So we need to get the number of extra buttons on the mouse: "MouseInfo.getNumberOfButtons() - 3" + // and multyply on 3 because each button will generate three events : PRESS, RELEASE and CLICK. + tmp = new int [(MouseInfo.getNumberOfButtons()-3)*3]; + Arrays.fill(tmp, 0); + + for (int i = 0, j = 3; i < tmp.length; i = i + 3, j++){ + tmp[i] = mouseButtonDownMasks[j]; + } + modifiersExStandard = Arrays.copyOf(tmp, tmp.length); + + Arrays.fill(tmp, InputEvent.SHIFT_DOWN_MASK); + for (int i = 0, j = 3; i < MouseInfo.getNumberOfButtons(); i = i + 3, j++){ + tmp[i] = tmp[j] | mouseButtonDownMasks[j]; + } + modifiersExStandardSHIFT = Arrays.copyOf(tmp, tmp.length); + + Arrays.fill(tmp, InputEvent.CTRL_DOWN_MASK); + for (int i = 0, j = 3; i < MouseInfo.getNumberOfButtons(); i = i + 3, j++){ + tmp[i] = tmp[j] | mouseButtonDownMasks[j]; + } + modifiersExStandardCTRL = Arrays.copyOf(tmp, tmp.length); + + Arrays.fill(tmp, InputEvent.ALT_DOWN_MASK); + for (int i = 0, j = 3; i < MouseInfo.getNumberOfButtons(); i = i + 3, j++){ + tmp[i] = tmp[j] | mouseButtonDownMasks[j]; + } + modifiersExStandardALT = Arrays.copyOf(tmp, tmp.length); + } + + public static void main(String []s){ + if (MouseInfo.getNumberOfButtons() < 4){ + System.out.println("There are less then 4 buttons on the mouse. The test may not be accomplished. Skipping."); + return; + } + initVars(); + MouseModifiersUnitTest_Extra frame = new MouseModifiersUnitTest_Extra(); + frame.initParams(s); + frame.init(); + initAdapters(); + frame.start(); + } + +}// class + +/* A class that invoke appropriate verification + * routine with current modifier. + */ +class CheckingModifierAdapter extends MouseAdapter{ + int modifier; + public CheckingModifierAdapter(int modifier){ + this.modifier = modifier; + } + + public void mousePressed(MouseEvent e) { + System.out.println("PRESSED "+e); + if (e.getButton() <= MouseEvent.BUTTON3) { + System.out.println("Standard button affected. Skip."); + } else { + MouseModifiersUnitTest_Extra.checkPressedModifiersTest(modifier, e); + } + } + public void mouseReleased(MouseEvent e) { + System.out.println("RELEASED "+e); + if (e.getButton() <= MouseEvent.BUTTON3) { + System.out.println("Standard button affected. Skip."); + } else { + MouseModifiersUnitTest_Extra.checkReleasedModifiersTest(modifier, e); + } + } + public void mouseClicked(MouseEvent e) { + System.out.println("CLICKED "+e); + if (e.getButton() <= MouseEvent.BUTTON3) { + System.out.println("Standard button affected. Skip."); + } else { + MouseModifiersUnitTest_Extra.checkClickedModifiersTest(modifier, e); + } + } +} +//Utility class that could report a message depending on current purpose of the test run +class MessageLogger{ + private static boolean debug; + + public static void setDebug(boolean d){ + debug = d; + log("Switch to "+ ((debug)?"debug":"trial") +" mode"); + } + + public static void log(String message){ + System.out.println(message); + } + + public static void reportError(String message){ + if (debug){ + System.out.println(message); + } else { + throw new RuntimeException(message); + } + } +} diff --git a/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java new file mode 100644 index 00000000000..cd2dab03039 --- /dev/null +++ b/jdk/test/java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java @@ -0,0 +1,598 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that modifiers are correct for standard (1, 2, 3, wheel) mouse buttons + @author Andrei Dmitriev : area=awt.mouse + @run main MouseModifiersUnitTest_Standard + */ + +import java.awt.*; +import java.awt.event.*; +import java.util.HashMap; +import java.util.StringTokenizer; +import java.util.Vector; + +//the test verifies: +// 1) verifies that modifiers are correct for standard (1, 2, 3) mouse buttons +// TODO: 2) verifies that modifiers are correct for wheel +// TODO: 3) +// Case1. the test posts BUTTONx_MASK and verifies that paramString() contains correct modifiers and exModifiers +// Case2. the test posts BUTTONx_DOWN_MASK and verifies that paramString() contains correct modifiers and exModifiers +// Case3. the test posts getMaskForButton(n) and verifies that paramString() contains correct modifiers and exModifiers +// repeat all cases with SHIFT/ALT/CTRL modifiers verify that paramString() contains correct modifiers and exModifiers +// I'm verifying button, modifiers and extModifiers for now. + +public class MouseModifiersUnitTest_Standard { + static final int NONE = 0; + static final int SHIFT = 1; + static final int CTRL = 2; + static final int ALT = 3; + static boolean debug = true; //dump all errors (debug) or throw first(under jtreg) exception + static boolean autorun = false; //use robot or manual run + static int testModifier = NONE; + // static String testModifier = "NONE"; + static CheckingModifierAdapter adapterTest1; + static CheckingModifierAdapter adapterTest2; + static CheckingModifierAdapter adapterTest3; + static CheckingModifierAdapter adapterTest4; + static Frame f; + final static int [] mouseButtons = new int [] {MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON3_MASK}; + // BUTTON1, 2, 3 press-release. + final static int [] modifiersStandardTestNONE = new int[] {MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON1_MASK, + MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON2_MASK, + MouseEvent.BUTTON3_MASK, MouseEvent.BUTTON3_MASK, MouseEvent.BUTTON3_MASK }; + final static int [] modifiersExStandardTestNONE = new int[] {MouseEvent.BUTTON1_DOWN_MASK, 0, 0, + MouseEvent.BUTTON2_DOWN_MASK, 0, 0, + MouseEvent.BUTTON3_DOWN_MASK, 0, 0}; + // BUTTON1, 2, 3 press-release with shift modifier + final static int [] modifiersStandardTestSHIFT = new int[] {MouseEvent.BUTTON1_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON1_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON1_MASK|InputEvent.SHIFT_MASK, + MouseEvent.BUTTON2_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON2_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON2_MASK|InputEvent.SHIFT_MASK, + MouseEvent.BUTTON3_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON3_MASK|InputEvent.SHIFT_MASK, MouseEvent.BUTTON3_MASK|InputEvent.SHIFT_MASK }; + final static int [] modifiersExStandardTestSHIFT = new int[] {MouseEvent.BUTTON1_DOWN_MASK|InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, + MouseEvent.BUTTON2_DOWN_MASK|InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, + MouseEvent.BUTTON3_DOWN_MASK|InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK, InputEvent.SHIFT_DOWN_MASK}; + // BUTTON1, 2, 3 press-release with CTRL modifier + final static int [] modifiersStandardTestCTRL = new int[] {MouseEvent.BUTTON1_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON1_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON1_MASK|InputEvent.CTRL_MASK, + MouseEvent.BUTTON2_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON2_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON2_MASK|InputEvent.CTRL_MASK, + MouseEvent.BUTTON3_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON3_MASK|InputEvent.CTRL_MASK, MouseEvent.BUTTON3_MASK|InputEvent.CTRL_MASK }; + final static int [] modifiersExStandardTestCTRL = new int[] {MouseEvent.BUTTON1_DOWN_MASK|InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, + MouseEvent.BUTTON2_DOWN_MASK|InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, + MouseEvent.BUTTON3_DOWN_MASK|InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK, InputEvent.CTRL_DOWN_MASK}; + + // BUTTON1, 2, 3 press-release with ALT modifier + final static int [] modifiersStandardTestALT = new int[] {MouseEvent.BUTTON1_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON1_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON1_MASK|InputEvent.ALT_MASK, + MouseEvent.BUTTON2_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON2_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON2_MASK|InputEvent.ALT_MASK, + MouseEvent.BUTTON3_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON3_MASK|InputEvent.ALT_MASK, MouseEvent.BUTTON3_MASK|InputEvent.ALT_MASK }; + final static int [] modifiersExStandardTestALT = new int[] {MouseEvent.BUTTON1_DOWN_MASK|InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK, + MouseEvent.BUTTON2_DOWN_MASK|InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK, + MouseEvent.BUTTON3_DOWN_MASK|InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK, InputEvent.ALT_DOWN_MASK}; + + static Robot robot; + + public static void main(String s[]){ + initParams(s); + initAdapters(); + f = new Frame(); + final int [] modifiers = {InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK}; + final String [] modifierNames = {"InputEvent.SHIFT_MASK", "InputEvent.CTRL_MASK"}; + f.setLayout(new FlowLayout()); + f.addMouseWheelListener(new MouseWheelListener() { + public void mouseWheelMoved(MouseWheelEvent e) { + System.out.println("WHEEL "+e); + } + }); + f.setSize(300, 300); + f.setVisible(true); + + try { + robot = new Robot(); + robot.delay(500); + robot.mouseMove(f.getLocationOnScreen().x + f.getWidth()/2, f.getLocationOnScreen().y + f.getHeight()/2); + if (autorun) { + //testing buttons 1, 2, 3 only + testPlainButtons(); + robot.delay(500); + + //testing buttons 1, 2, 3 with SHIFT, CTRL, ALT keyboard modifiers + testButtonsWithShift(); + robot.delay(500); + + testButtonsWithControl(); + robot.delay(500); + + testButtonsWithAlt(); + robot.delay(500); + } else { + switch (testModifier){ + case SHIFT: + f.addMouseListener(adapterTest2); + break; + case CTRL: + f.addMouseListener(adapterTest3); + break; + case ALT: + f.addMouseListener(adapterTest4); + break; + default: //NONE inclusive + f.addMouseListener(adapterTest1); + } + } + } catch (Exception e){ + throw new RuntimeException("Test failed."); + } + + } + + public static void initAdapters(){ + adapterTest1 = new CheckingModifierAdapter(NONE); + adapterTest2 = new CheckingModifierAdapter(SHIFT); + adapterTest3 = new CheckingModifierAdapter(CTRL); + adapterTest4 = new CheckingModifierAdapter(ALT); + } + + /*======================================================================*/ + public static void checkPressedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardModifiers = getStandardArray(testModifier); + int [] curStandardExModifiers = getStandardExArray(testModifier); + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 1)*3; + // int index = (button - 4)*3; + dumpValues(button, modifiers, curStandardModifiers[index], modifiersEx, curStandardExModifiers[index]); + if (modifiers != curStandardModifiers[index]){ + if (debug){ + System.out.println("Test failed : Pressed. modifiers != modifiersStandard"); + } else { + throw new RuntimeException("Test failed : Pressed. modifiers != modifiersStandard"); + } + } + + if (modifiersEx != curStandardExModifiers[index]){ +// System.out.println(">>>>>>>>>>>>>>> Pressed. modifiersEx "+modifiersEx +" : "+!= curStandardExModifiers"); + if (debug){ + System.out.println("Test failed : Pressed. modifiersEx != curStandardExModifiers"); + } else { + throw new RuntimeException("Test failed : Pressed. modifiersEx != curStandardExModifiers"); + } + } + HashMap paramStringElements = tokenizeParamString(event.paramString()); + System.out.println(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + checkExtModifiersOnPress(testModifier, paramStringElements, button); + } + + public static void checkButton(HashMap h, int button){ + if (h.get("button") == null) { + throw new RuntimeException("Test failed : Clicked. button is absent in paramString()"); + } + if (Integer.parseInt(h.get("button")) != button) { + throw new RuntimeException("Test failed : Clicked. button in paramString() doesn't equal to button being pressed."); + } + } + + public static void checkExtModifiersOnPress(int testModifier, HashMap h, int button){ + String ethalon = ""; + if (h.get("extModifiers") == null) { + System.out.println("Test failed : Pressed. extModifiers == null"); + throw new RuntimeException("Test failed : Pressed. extModifiers == null"); + } + switch (testModifier){ + case SHIFT:{ + ethalon = "Shift+"; + break; + } + case ALT:{ + ethalon = "Alt+"; + break; + } + case CTRL:{ + ethalon = "Ctrl+"; + break; + } + default: { + ethalon = ""; + } + ethalon = ethalon + "Button" +button; + + if (!h.get("extModifiers").equals(ethalon)) { + System.out.println("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + throw new RuntimeException("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon); + } + } + } + + + + public static void checkModifiers(int testModifier, HashMap h, int button){ + // none of modifiers should be null + if (h.get("modifiers") == null) { + System.out.println("Test failed : modifiers == null"); + throw new RuntimeException("Test failed : modifiers == null"); + } + Vector modifierElements = tokenizeModifiers(h.get("modifiers")); + //check that ButtonX is there + String buttonEthalon = "Button" + button; + if (modifierElements.contains(buttonEthalon)){ + modifierElements.remove(buttonEthalon); + } else { + System.out.println("Test failed : modifiers doesn't contain Button "+h.get("modifiers")); + throw new RuntimeException("Test failed : modifiers doesn't contain Button "+h.get("modifiers")); + } + + + //Check all explicitly pressed modifires +// boolean altIncluded = false; //don't duplicate Alt when ALT is pressed and BUTTON2_MASK. + String excplicitModifier = ""; + boolean altIncluded = false; + switch (testModifier){ + case SHIFT:{ + excplicitModifier = "Shift"; + break; + } + case ALT:{ + excplicitModifier = "Alt"; + altIncluded = true; //there should be only on "Alt" for two modifiers. So check it. + break; + } + case CTRL:{ + excplicitModifier = "Ctrl"; + break; + } + } + if (!excplicitModifier.equals("")){ + if (modifierElements.contains(excplicitModifier)){ + modifierElements.remove(excplicitModifier); + } else { + System.out.println("Test failed : modifiers doesn't contain explicit modifier "+excplicitModifier + " in "+ h.get("modifiers")); + throw new RuntimeException("Test failed : modifiers doesn't contain explicit modifier "+excplicitModifier + " in "+ h.get("modifiers")); + } + } + + //Button 2 and 3 reports about Alt+Button2 and Meta+Button3 respectively. + //Check these values too + String extraModifiers = ""; + String extraModifiersButton3 = ""; + switch (button){ + //BUTTON1 with ALT reports about Alt+Button1+Button2. + //We should fix this but I would not change this. + case 1: { + //Alt+Button1+Button2: + // 1) we already handled "Alt" in excplicitModifier + // 2) we already took "Button1" in buttonEthalon + // 3) so "Button2" is only remained. + // This should only happen when ALT+Button1 is pressed + if (altIncluded){ + extraModifiers = "Button2"; + } + break; + } + case 2: { + //Alt+Button2 report about "Alt+Button2". + extraModifiers = "Alt"; + break; + } + case 3: { + //ALT+BUTTON3 reports about "Alt+Meta+Button2+Button3" + // This should only happen when ALT+Button3 is pressed + extraModifiers = "Meta"; + if (altIncluded){ + extraModifiersButton3 = "Button2"; + } + break; + } + }//switch + + if (!extraModifiers.equals("")){ + if (modifierElements.contains(extraModifiers)){ + modifierElements.remove(extraModifiers); + } else { + //we may already removed "Alt" when filtered explicit modifiers. + //Here is no failure in this case. + if (!altIncluded) { + System.out.println("Test failed : modifiers doesn't contain a modifier from BUTTON2 or BUTTON3 "+extraModifiers + " in "+ h.get("modifiers")); + throw new RuntimeException("Test failed : modifiers doesn't contain a modifier from BUTTON2 or BUTTON3 "+extraModifiers + " in "+ h.get("modifiers")); + } + } + } + + if (!extraModifiersButton3.equals("")){ + if (modifierElements.contains(extraModifiersButton3)){ + modifierElements.remove(extraModifiersButton3); + } else { + System.out.println("Test failed : modifiers doesn't contain a modifier from BUTTON2 or BUTTON3 "+extraModifiersButton3 + " in "+ h.get("modifiers")); + throw new RuntimeException("Test failed : modifiers doesn't contain a modifier from BUTTON2 or BUTTON3 "+extraModifiersButton3 + " in "+ h.get("modifiers")); + } + } + + //the length of vector should now be zero + if (!modifierElements.isEmpty()){ + System.out.println("Test failed : there is some more elements in modifiers that shouldn't be there: "+h.get("modifiers")); + throw new RuntimeException("Test failed : there is some more elements in modifiers that shouldn't be there: "+h.get("modifiers")); + } + } + + public static void checkExtModifiersOnReleaseClick(int testModifier, HashMap h, int button){ + String ethalon = ""; + switch (testModifier){ + case SHIFT:{ + ethalon = "Shift+"; + break; + } + case ALT:{ + ethalon = "Alt+"; + break; + } + case CTRL:{ + ethalon = "Ctrl+"; + break; + } + default: { + if (h.get("extModifiers") != null) { + System.out.println("Test failed : Released. extModifiers != null but no modifiers keys are pressed"); + throw new RuntimeException("Test failed : Released. extModifiers != null but no modifiers keys are pressed"); + } else { + //no modifiers + return; + } + } + } + if (h.get("extModifiers").equals(ethalon)) { + System.out.println("Test failed : Released. extModifiers = "+ h.get("extModifiers") +" instead of : "+ethalon); + throw new RuntimeException("Test failed : Released. extModifiers = "+ h.get("extModifiers") +" instead of : "+ethalon); + } + } + + public static void checkReleasedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardModifiers = getStandardArray(testModifier); + int [] curStandardExModifiers = getStandardExArray(testModifier); + // int index = (button - 4)*3 + 1; + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 1)*3 + 1; + dumpValues(button, modifiers, curStandardModifiers[index], modifiersEx, curStandardExModifiers[index]); + if (modifiers != curStandardModifiers[index]){ + if (debug){ + System.out.println("Test failed : Released. modifiers != modifiersStandard"); + } else { + throw new RuntimeException("Test failed : Released. modifiers != modifiersStandard"); + } + } + if (modifiersEx != curStandardExModifiers[index]){ + if (debug){ + System.out.println("Test failed : Released. modifiersEx != curStandardExModifiers"); + } else { + throw new RuntimeException("Test failed : Released. modifiersEx != curStandardExModifiers"); + } + } + HashMap paramStringElements = tokenizeParamString(event.paramString()); + System.out.println(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + checkExtModifiersOnReleaseClick(testModifier, paramStringElements, button); + } + + public static void checkClickedModifiersTest(int testModifier, MouseEvent event){ + int [] curStandardModifiers = getStandardArray(testModifier); + int [] curStandardExModifiers = getStandardExArray(testModifier); + // int index = (button - 4)*3 + 2; + int button = event.getButton(); + int modifiers = event.getModifiers(); + int modifiersEx = event.getModifiersEx(); + int index = (button - 1)*3 + 2; + dumpValues(button, modifiers, curStandardModifiers[index], modifiersEx, curStandardExModifiers[index]); + if (modifiers != curStandardModifiers[index]){ + if (debug){ + System.out.println("Test failed : Clicked. modifiers != modifiersStandard"); + } else { + throw new RuntimeException("Test failed : Clicked. modifiers != modifiersStandard"); + } + } + if (modifiersEx != curStandardExModifiers[index]){ + if (debug){ + System.out.println("Test failed : Clicked. modifiersEx != curStandardExModifiers"); + } else { + throw new RuntimeException("Test failed : Clicked. modifiersEx != curStandardExModifiers"); + } + } + HashMap paramStringElements = tokenizeParamString(event.paramString()); + checkButton(paramStringElements, button); + checkModifiers(testModifier, paramStringElements, button); + checkExtModifiersOnReleaseClick(testModifier, paramStringElements, button); + } + /*======================================================================*/ + + public static HashMap tokenizeParamString(String param){ + HashMap params = new HashMap(); + StringTokenizer st = new StringTokenizer(param, ",="); + while (st.hasMoreTokens()){ + String tmp = st.nextToken(); +// System.out.println("PARSER : "+tmp); + if (tmp.equals("button") || + tmp.equals("modifiers") || + tmp.equals("extModifiers")) { + params.put(tmp, st.nextToken()); + } + } + return params; + } + + public static Vector tokenizeModifiers(String modifierList){ + Vector modifiers = new Vector(); + StringTokenizer st = new StringTokenizer(modifierList, "+"); + while (st.hasMoreTokens()){ + String tmp = st.nextToken(); + modifiers.addElement(tmp); + System.out.println("MODIFIER PARSER : "+tmp); + } + return modifiers; + } + + + //test BUTTON1, 2 and 3 without any modifiers keys + public static void testPlainButtons(){ + System.out.println("Testing buttons without modifiers."); + f.addMouseListener(adapterTest1); + for (int button : mouseButtons){ + robot.mousePress(button); + robot.delay(100); + robot.mouseRelease(button); + } + robot.delay(1000); + f.removeMouseListener(adapterTest1); + } + + //test BUTTON1, 2 and 3 with SHIFT key + public static void testButtonsWithShift(){ + System.out.println("Testing buttons with SHIFT modifier."); + f.addMouseListener(adapterTest2); + + for (int button : mouseButtons){ + robot.keyPress(KeyEvent.VK_SHIFT); + robot.mousePress(button); + robot.delay(100); + robot.mouseRelease(button); + robot.keyRelease(KeyEvent.VK_SHIFT); + } + robot.delay(1000); + f.removeMouseListener(adapterTest2); + } + + //test BUTTON1, 2 and 3 with CTRL key + public static void testButtonsWithControl(){ + System.out.println("Testing buttons with CONTROL modifier."); + f.addMouseListener(adapterTest3); + for (int button : mouseButtons){ + robot.keyPress(KeyEvent.VK_CONTROL); + robot.mousePress(button); + robot.delay(100); + robot.mouseRelease(button); + robot.keyRelease(KeyEvent.VK_CONTROL); + } + robot.delay(1000); + f.removeMouseListener(adapterTest3); + } + + //test BUTTON1, 2 and 3 with ALT key + public static void testButtonsWithAlt(){ + System.out.println("Testing buttons with ALT modifier."); + f.addMouseListener(adapterTest4); + for (int button : mouseButtons){ + robot.keyPress(KeyEvent.VK_ALT); + robot.mousePress(button); + robot.delay(100); + robot.mouseRelease(button); + robot.keyRelease(KeyEvent.VK_ALT); + } + robot.delay(1000); + f.removeMouseListener(adapterTest4); + } + + public static void initParams(String []s){ + if (s.length != 3){ + autorun = true; + debug = false; + testModifier = NONE; + } else { + autorun = Boolean.valueOf(s[0]); + debug = Boolean.valueOf(s[1]); + + if (s[2].equals("NONE")){ + testModifier = NONE; + } + if (s[2].equals("SHIFT")){ + testModifier = SHIFT; + } + if (s[2].equals("CTRL")){ + testModifier = CTRL; + } + if (s[2].equals("ALT")){ + testModifier = ALT; + } + } + System.out.println("Autorun : " +autorun); + System.out.println("Debug mode : " +debug); + System.out.println("Modifier to verify : " + testModifier); + } + + public static void dumpValues(int button, int modifiers, int modifiersStandard, int modifiersEx, int modifiersExStandard){ + System.out.println("Button = "+button + "Modifiers = "+ modifiers + " standard = "+ modifiersStandard); + System.out.println(" ModifiersEx = "+ modifiersEx + " standardEx = "+ modifiersExStandard); + } + + private static int[] getStandardExArray(int testModifier) { + int [] curStandardExModifiers; + switch (testModifier){ + case SHIFT: + curStandardExModifiers = modifiersExStandardTestSHIFT; + break; + case CTRL: + curStandardExModifiers = modifiersExStandardTestCTRL; + break; + case ALT: + curStandardExModifiers = modifiersExStandardTestALT; + break; + default: //NONE by default + curStandardExModifiers = modifiersExStandardTestNONE; + } + return curStandardExModifiers; + } + + private static int[] getStandardArray(int testModifier) { + int [] curStandardModifiers; + switch (testModifier){ + case SHIFT: + curStandardModifiers = modifiersStandardTestSHIFT; + break; + case CTRL: + curStandardModifiers = modifiersStandardTestCTRL; + break; + case ALT: + curStandardModifiers = modifiersStandardTestALT; + break; + default: //NONE by default + curStandardModifiers = modifiersStandardTestNONE; + } + return curStandardModifiers; + } + +} + + +/* A class that invoke appropriate verification + * routine with current modifier. + */ +class CheckingModifierAdapter extends MouseAdapter{ + int modifier; + public CheckingModifierAdapter(int modifier){ + this.modifier = modifier; + } + + public void mousePressed(MouseEvent e) { + System.out.println("PRESSED "+e); + if (e.getButton() > MouseEvent.BUTTON3) { + System.out.println("Extra button affected. Skip."); + } else { + MouseModifiersUnitTest_Standard.checkPressedModifiersTest(modifier, e); // e.getButton(), e.getModifiers(), e.getModifiersEx(), + } + } + public void mouseReleased(MouseEvent e) { + System.out.println("RELEASED "+e); + if (e.getButton() > MouseEvent.BUTTON3) { + System.out.println("Extra button affected. Skip."); + } else { + MouseModifiersUnitTest_Standard.checkReleasedModifiersTest(modifier, e); // e.getButton(), e.getModifiers(), e.getModifiersEx() + } + } + public void mouseClicked(MouseEvent e) { + System.out.println("CLICKED "+e); + if (e.getButton() > MouseEvent.BUTTON3) { + System.out.println("Extra button affected. Skip."); + } else { + MouseModifiersUnitTest_Standard.checkClickedModifiersTest(modifier, e); //e.getButton(), e.getModifiers(), e.getModifiersEx() + } + } +} + diff --git a/jdk/test/java/awt/Multiscreen/DeviceIdentificationTest/DeviceIdentificationTest.java b/jdk/test/java/awt/Multiscreen/DeviceIdentificationTest/DeviceIdentificationTest.java new file mode 100644 index 00000000000..a3062bcef86 --- /dev/null +++ b/jdk/test/java/awt/Multiscreen/DeviceIdentificationTest/DeviceIdentificationTest.java @@ -0,0 +1,168 @@ +/* + * 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. + * + * 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 6614214 + * @summary Verifies that we enter the fs mode on the correct screen. + * Here is how to test: start the test on on a multi-screen system. + * Verify that the display is correctly tracked by dragging the frame back + * and forth between screens. Then verify that the correct device enters + * the full-screen mode - when "Enter FS mode" is pressed it should enter on + * the device where the frame is. + * + * Then change the order of the monitors in the DisplayProperties dialog, + * (while the app is running) and see that it still works. + * Restart the app, verify again. + * + * Now change the primary monitor on the system and verify with the + * app running, as well as after restarting it that we still enter the + * fs mode on the right device. + * + * @run main/manual/othervm DeviceIdentificationTest + * @run main/manual/othervm -Dsun.java2d.noddraw=true DeviceIdentificationTest + * @run main/manual/othervm -Dsun.java2d.opengl=True DeviceIdentificationTest + */ + +import java.awt.Button; +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +public class DeviceIdentificationTest { + + public static void main(String args[]) { + final Frame f = new Frame("DeviceIdentificationTest"); + f.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + f.dispose(); + } + }); + f.addComponentListener(new ComponentAdapter() { + public void componentMoved(ComponentEvent e) { + f.setTitle("Currently on: "+ + f.getGraphicsConfiguration().getDevice()); + } + }); + + Panel p = new Panel(); + Button b = new Button("Print Current Devices"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + GraphicsDevice gds[] = + GraphicsEnvironment.getLocalGraphicsEnvironment(). + getScreenDevices(); + int i = 0; + System.err.println("--- Devices: ---"); + for (GraphicsDevice gd : gds) { + System.err.println("Device["+i+"]= "+ gd); + System.err.println(" bounds = "+ + gd.getDefaultConfiguration().getBounds()); + i++; + } + System.err.println("-------------------"); + } + }); + p.add(b); + + b = new Button("Print My Device"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + GraphicsConfiguration gc = f.getGraphicsConfiguration(); + GraphicsDevice gd = gc.getDevice(); + System.err.println("--- My Device ---"); + System.err.println("Device = "+ gd); + System.err.println(" bounds = "+ + gd.getDefaultConfiguration().getBounds()); + } + }); + p.add(b); + + b = new Button("Create FS Frame on my Device"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + GraphicsConfiguration gc = f.getGraphicsConfiguration(); + final GraphicsDevice gd = gc.getDevice(); + System.err.println("--- Creating FS Frame on Device ---"); + System.err.println("Device = "+ gd); + System.err.println(" bounds = "+ + gd.getDefaultConfiguration().getBounds()); + final Frame fsf = new Frame("Full-screen Frame on dev"+gd, gc) { + public void paint(Graphics g) { + g.setColor(Color.green); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setColor(Color.red); + g.drawString("FS on device: "+gd, 200, 200); + g.drawString("Click to exit Full-screen.", 200, 250); + } + }; + fsf.setUndecorated(true); + fsf.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + gd.setFullScreenWindow(null); + fsf.dispose(); + } + }); + gd.setFullScreenWindow(fsf); + } + }); + p.add(b); + f.add("North", p); + + p = new Panel(); + b = new Button("Test Passed"); + b.setBackground(Color.green); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.out.println("Test Passed"); + f.dispose(); + } + }); + p.add(b); + b = new Button("Test Failed"); + b.setBackground(Color.red); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + System.out.println("Test FAILED"); + f.dispose(); + throw new RuntimeException("Test FAILED"); + } + }); + p.add(b); + f.add("South", p); + + f.pack(); + f.setVisible(true); + } +} diff --git a/jdk/test/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java b/jdk/test/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java new file mode 100644 index 00000000000..91b13cc131a --- /dev/null +++ b/jdk/test/java/awt/Robot/AcceptExtraMouseButtons/AcceptExtraMouseButtons.java @@ -0,0 +1,118 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that Robot is accepting extra mouse buttons + @author Andrei Dmitriev : area=awt.mouse + @library ../../regtesthelpers + @build Util + @run main AcceptExtraMouseButtons + */ + +//if we do robot.mousePress(InputEvent.BUTTON1_DOWN_MASK) the test must +// 1) accept it (i.e. don't throw an IllegalArgumentException +// 2) actually post a MouseEvent +// Also, Robot should still accept InputEvent.BUTTONx_MASKs + +import java.awt.*; +import java.awt.event.*; +import sun.awt.SunToolkit; +import test.java.awt.regtesthelpers.Util; + +public class AcceptExtraMouseButtons extends Frame { + static String tk = Toolkit.getDefaultToolkit().getClass().getName(); + static Robot robot; + static int [] standardButtonMasks = {InputEvent.BUTTON1_MASK, + InputEvent.BUTTON2_MASK, + InputEvent.BUTTON3_MASK}; + static int [] buttonsPressed; + static int [] buttonsReleased; + static int [] buttonsClicked; + + static int buttonsNum = MouseInfo.getNumberOfButtons(); + + public static void main(String []s){ + + //MouseInfo.getNumberOfButtons() reports two more buttons on XToolkit + //as they reserved for wheel (both directions). + if (tk.equals("sun.awt.X11.XToolkit") || tk.equals("sun.awt.motif.MToolkit")) { + buttonsNum = buttonsNum - 2; + } + System.out.println("Number Of Buttons = "+ buttonsNum); + if (buttonsNum < 3) { + System.out.println("Linux and Windows systems should emulate three buttons if even there are only 1 or 2 are phsically available. Setting number of buttons to 3."); + buttonsNum = 3; + } + + buttonsPressed = new int [buttonsNum]; + buttonsReleased = new int [buttonsNum]; + buttonsClicked = new int [buttonsNum]; + + AcceptExtraMouseButtons frame = new AcceptExtraMouseButtons(); + + MouseAdapter ma1 = new MouseAdapter() { + public void mousePressed(MouseEvent e) { + buttonsPressed[e.getButton() - 1] += 1; + System.out.println("PRESSED "+e); + } + public void mouseReleased(MouseEvent e) { + buttonsReleased[e.getButton() - 1] += 1; + System.out.println("RELEASED "+e); + } + public void mouseClicked(MouseEvent e) { + buttonsClicked[e.getButton() - 1] += 1; + System.out.println("CLICKED "+e); + } + }; + frame.addMouseListener(ma1); + + frame.setSize(300, 300); + frame.setVisible(true); + + Util.waitForIdle(robot); //a time to show a Frame + + try { + robot = new Robot(); + robot.delay(1000); + robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth()/2, + frame.getLocationOnScreen().y + frame.getHeight()/2); + + //TestCase 1: verify that all BUTTONx_DOWN_MASKs are accepted by the Robot. + + for (int i = 0; i < buttonsNum; i++){ + int buttonMask = InputEvent.getMaskForButton(i+1); + System.out.println("button to press = " +(i+1) + " : value passed to robot = " +buttonMask); + robot.mousePress(buttonMask); + robot.delay(30); + robot.mouseRelease(buttonMask); + Util.waitForIdle(robot); + } + for (int i = 0; i < buttonsNum; i++){ + if (buttonsPressed[i] != 1 || buttonsReleased[i] != 1 || buttonsClicked[i] !=1 ) { + throw new RuntimeException("TESTCASE 1 FAILED : button " + (i+1) + " wasn't single pressed|released|clicked : "+ buttonsPressed[i] +" : "+ buttonsReleased[i] +" : "+ buttonsClicked[i]); + } + } + + java.util.Arrays.fill(buttonsPressed, 0); + java.util.Arrays.fill(buttonsReleased, 0); + java.util.Arrays.fill(buttonsClicked, 0); + //TestCase 2: verify that all BUTTONx_MASKs are accepted by the Robot. + for (int i = 0; i < standardButtonMasks.length; i++){ + int buttonMask = standardButtonMasks[i]; + System.out.println("button to press = " +(i+1) + " : value passed to robot = " +buttonMask); + robot.mousePress(buttonMask); + robot.delay(30); + robot.mouseRelease(buttonMask); + Util.waitForIdle(robot); + } + for (int i = 0; i < standardButtonMasks.length; i++){ + if (buttonsPressed[i] != 1 || buttonsReleased[i] != 1 || buttonsClicked[i] !=1 ) { + throw new RuntimeException("TESTCASE 2 FAILED : button " + (i+1) + " wasn't single pressed|released|clicked : "+ buttonsPressed[i] +" : "+ buttonsReleased[i] +" : "+ buttonsClicked[i]); + } + } + + } catch (Exception e){ + e.printStackTrace(); + throw new RuntimeException(e); + } + } +} diff --git a/jdk/test/java/awt/Robot/ManualInstructions/ManualInstructions.java b/jdk/test/java/awt/Robot/ManualInstructions/ManualInstructions.java new file mode 100644 index 00000000000..96baf9b913c --- /dev/null +++ b/jdk/test/java/awt/Robot/ManualInstructions/ManualInstructions.java @@ -0,0 +1,305 @@ +/* + test %W% %E% %I%, %G% + @bug 6315717 + @summary manual control over the Robot + @author Andrei Dmitriev : area=awt.robot + @run applet/manual=yesno ManualInstructions.html +*/ + +import java.applet.Applet; +import java.awt.*; +import java.awt.event.*; +import java.util.Timer; +import java.util.TimerTask; + +public class ManualInstructions extends Applet +{ + final static long SEND_DELAY = 1000; + + public static void main(String s[]){ + ManualInstructions mi = new ManualInstructions(); + mi.init(); + mi.start(); + } + + static Robot robot; + Point mouseLocation; //where mouse should be pressed each time + Panel target = new Panel(); + Button pressOn = new Button("press on ..."); + Button releaseOn = new Button("release on ..."); + Button clickOn = new Button("click on ..."); + Choice buttonNumber = new Choice(); + + public void init() + { + try { + robot = new Robot(); + } catch (AWTException ex) { + ex.printStackTrace(); + throw new RuntimeException(ex); + } + this.setLayout (new BorderLayout ()); + + target.setBackground(Color.green); + target.setName("GreenBox");//for the ease of debug + target.setPreferredSize(new Dimension(100, 100)); + String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); + + // on X systems two buttons are reserved for wheel though they are countable by MouseInfo. + int buttonsNumber = toolkit.equals("sun.awt.windows.WToolkit")?MouseInfo.getNumberOfButtons():MouseInfo.getNumberOfButtons()-2; + + for (int i = 0; i < 8; i++){ + buttonNumber.add("BUTTON"+(i+1)+"_MASK"); + } + + pressOn.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + System.out.println("Now pressing : " + (buttonNumber.getSelectedIndex()+1)); + + Timer timer = new Timer(); + TimerTask robotInteraction = new TimerTask(){ + public void run(){ + robot.mouseMove(updateTargetLocation().x, updateTargetLocation().y); + robot.mousePress(getMask(buttonNumber.getSelectedIndex()+1)); + } + }; + timer.schedule(robotInteraction, SEND_DELAY); + } + }); + + releaseOn.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + System.out.println("Now releasing : " + (buttonNumber.getSelectedIndex()+1)); + Timer timer = new Timer(); + TimerTask robotInteraction = new TimerTask(){ + public void run(){ + robot.mouseMove(updateTargetLocation().x, updateTargetLocation().y); + robot.mouseRelease(getMask(buttonNumber.getSelectedIndex()+1)); + } + }; + timer.schedule(robotInteraction, SEND_DELAY); + } + }); + + clickOn.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + System.out.println("Now clicking : " + (buttonNumber.getSelectedIndex()+1)); + Timer timer = new Timer(); + TimerTask robotInteraction = new TimerTask(){ + public void run(){ + robot.mouseMove(updateTargetLocation().x, updateTargetLocation().y); + robot.mousePress(getMask(buttonNumber.getSelectedIndex()+1)); + robot.mouseRelease(getMask(buttonNumber.getSelectedIndex()+1)); + } + }; + timer.schedule(robotInteraction, SEND_DELAY); + } + + }); + target.addMouseListener(new MouseAdapter(){ + public void mousePressed(MouseEvent e){ + Sysout.println(""+e); + } + public void mouseReleased(MouseEvent e){ + Sysout.println(""+e); + } + public void mouseClicked(MouseEvent e){ + Sysout.println(""+e); + } + }); + + String[] instructions = + { + "Do provide an instruction to the robot by", + "choosing the button number to act and ", + "pressing appropriate java.awt.Button on the left.", + "Inspect an output in the TextArea below.", + "Please don't generate non-natural sequences like Release-Release, etc.", + "If you use keyboard be sure that you released the keyboard shortly.", + "If events are generated well press Pass, otherwise Fail." + }; + Sysout.createDialogWithInstructions( instructions ); + + }//End init() + + private int getMask(int button){ + return InputEvent.getMaskForButton(button); + + /* + //this only works for standard buttons and for old JDK builds + int mask = 0; + switch (button){ + case 1: { + mask = InputEvent.BUTTON1_MASK; + break; + } + case 2: { + mask = InputEvent.BUTTON2_MASK; + break; + } + case 3: { + mask = InputEvent.BUTTON3_MASK; + break; + } + } + return mask; + */ + } + + private Point updateTargetLocation() { + return new Point(target.getLocationOnScreen().x + target.getWidth()/2, target.getLocationOnScreen().y + target.getHeight()/2); + } + + public void start () + { + //Get things going. Request focus, set size, et cetera + setSize (200,200); + setVisible(true); + validate(); + Frame f = new Frame ("Set action for Robot here."); + f.setLayout(new FlowLayout()); + f.add(buttonNumber); + f.add(pressOn); + f.add(releaseOn); + f.add(clickOn); + f.add(target); + f.pack(); + f.setVisible(true); + }// start() +}// class + +/* 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; + + 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." ); + } + + 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 = 120; + + //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/Robot/RobotExtraButton/RobotExtraButton.java b/jdk/test/java/awt/Robot/RobotExtraButton/RobotExtraButton.java new file mode 100644 index 00000000000..83e9571239d --- /dev/null +++ b/jdk/test/java/awt/Robot/RobotExtraButton/RobotExtraButton.java @@ -0,0 +1,79 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that robot could accept extra buttons + @author Andrei Dmitriev : area=awt.mouse + @library ../../regtesthelpers + @build Util + @run main RobotExtraButton + */ + +import java.awt.*; +import java.awt.event.*; +import test.java.awt.regtesthelpers.Util; + +public class RobotExtraButton extends Frame { + static Robot robot; + public static void main(String []s){ + RobotExtraButton frame = new RobotExtraButton(); + frame.setSize(300, 300); + frame.setVisible(true); + frame.addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent e) { + System.out.println("PRESSED "+e); + } + public void mouseReleased(MouseEvent e) { + System.out.println("RELEASED "+e); + } + public void mouseClicked(MouseEvent e) { + System.out.println("CLICKED "+e); + } + }); + Util.waitForIdle(robot); + int [] buttonMask = new int[MouseInfo.getNumberOfButtons()]; // = InputEvent.getButtonDownMasks(); + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonMask[i] = InputEvent.getMaskForButton(i+1); + System.out.println("TEST: "+buttonMask[i]); + } + + try { + robot = new Robot(); + robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth()/2, frame.getLocationOnScreen().y + frame.getHeight()/2); + /* + if (MouseInfo.getNumberOfButtons() <= 3) { + System.out.println("Number Of Buttons = "+ MouseInfo.getNumberOfButtons() +". Finish!"); + return; + }*/ + + System.out.println("TEST: press 1"); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + Util.waitForIdle(robot); + + System.out.println("TEST: press 2"); + + robot.mousePress(InputEvent.BUTTON2_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON2_MASK); + Util.waitForIdle(robot); + System.out.println("TEST: press 3"); + + robot.mousePress(InputEvent.BUTTON3_MASK); + robot.delay(50); + robot.mouseRelease(InputEvent.BUTTON3_MASK); + Util.waitForIdle(robot); + System.out.println("--------------------------------------------------"); + for (int i = 0; i < buttonMask.length; i++){ + System.out.println("button would = " +i + " : value = " +buttonMask[i]); + robot.mousePress(buttonMask[i]); + robot.delay(50); + robot.mouseRelease(buttonMask[i]); + Util.waitForIdle(robot); + } + } catch (Exception e){ + e.printStackTrace(); + throw new RuntimeException("Test failed.", e); + } + } +} diff --git a/jdk/test/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java b/jdk/test/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java new file mode 100644 index 00000000000..44098dd3e48 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java @@ -0,0 +1,48 @@ +/* + @test + @bug 6738181 + @library ../../../regtesthelpers + @build Sysout + @summary Toolkit.getAWTEventListeners returns empty array + @author andrei dmitriev: area=awt.headless + @run main/othervm -Djava.awt.headless=true AWTListener +*/ + +/** + * In a headless mode add a listener for container events. + * Check if a single listener is still assigned to the Toolkit class. + */ + +import java.awt.*; +import java.awt.event.*; +import test.java.awt.regtesthelpers.Sysout; + +public class AWTListener { + public static void main(String []s) { + Toolkit toolkit = Toolkit.getDefaultToolkit(); + + AWTEventListener orig = new AWTEventListener() { + public void eventDispatched(AWTEvent event) { } + }; + + Sysout.println("Test: listener to add = " +orig); + toolkit.addAWTEventListener(orig, AWTEvent.CONTAINER_EVENT_MASK); + + for (AWTEventListener l: toolkit.getAWTEventListeners()){ + Sysout.println("Test: listener = " +l+" "); + } + + if ( toolkit.getAWTEventListeners().length == 0 ) { + throw new RuntimeException("Case 1. An empty array returned unexpectedly"); + } + + for (AWTEventListener l: toolkit.getAWTEventListeners(AWTEvent.CONTAINER_EVENT_MASK)){ + Sysout.println("Test: listener = " +l); + } + + if ( toolkit.getAWTEventListeners(AWTEvent.CONTAINER_EVENT_MASK).length == 0 ) { + throw new RuntimeException("Case 2. An empty array returned unexpectedly"); + } + Sysout.println("Test PASSED"); + } +} diff --git a/jdk/test/java/awt/Toolkit/HeadlessTray/HeadlessTray.java b/jdk/test/java/awt/Toolkit/HeadlessTray/HeadlessTray.java new file mode 100644 index 00000000000..2045052f68a --- /dev/null +++ b/jdk/test/java/awt/Toolkit/HeadlessTray/HeadlessTray.java @@ -0,0 +1,49 @@ +/* + * Copyright 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. + * + * 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 6737722 + @summary no tray support in headless mode + @author dmitry.cherepanov: area=awt.headless + @run main HeadlessTray +*/ + +import java.awt.*; + +public class HeadlessTray +{ + public static void main (String args[]) { + + System.setProperty("java.awt.headless", "true"); + + // We expect the method returns false and no exception thrown + boolean isSupported = SystemTray.isSupported(); + + if (isSupported) { + throw new RuntimeException("Tray shouldn't be supported in headless mode "); + } + + } + +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_1.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_1.java new file mode 100644 index 00000000000..3fdd3bce310 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_1.java @@ -0,0 +1,36 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that system property sun.awt.enableExtraMouseButtons is true by default + @author Andrei Dmitriev : area=awt.mouse + @run main SystemPropTest_1 + */ +//1) Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns false initially. +//2) Verifies that Toolkit.areExtraMouseButtonsEnabled() returns true by default. +// This must initlizes the Toolkit class. +//3) Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns true (default). +import java.awt.*; + +public class SystemPropTest_1 { + + public static void main(String []s){ + boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + System.out.println("1. System.getProperty = " + propValue); + if (propValue){ + throw new RuntimeException("TEST FAILED(1) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED : Toolkit.areExtraMouseButtonsEnabled() returns false"); + } + + System.getProperties().list(System.out); + System.out.println("XXXX. System.getProperty = " + System.getProperty("sun.awt.enableExtraMouseButtons")); + + propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + System.out.println("2. System.getProperty = " + propValue); + if (!propValue){ + throw new RuntimeException("TEST FAILED(2) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_2.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_2.java new file mode 100644 index 00000000000..366dbdf5cf6 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_2.java @@ -0,0 +1,25 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that system property sun.awt.enableExtraMouseButtons might be set to true by the command line + @author Andrei Dmitriev : area=awt.mouse + @run main/othervm -Dsun.awt.enableExtraMouseButtons=true SystemPropTest_2 + */ +//1) Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns true if set through the command line. +//2) Verifies that Toolkit.areExtraMouseButtonsEnabled() returns true if the proprty is set through the command line. +import java.awt.*; + +public class SystemPropTest_2 { + + public static void main(String []s){ + boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + System.out.println("System.getProperty = " + propValue); + if (!propValue){ + throw new RuntimeException("TEST FAILED : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED : Toolkit.areExtraMouseButtonsEnabled() returns false"); + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_3.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_3.java new file mode 100644 index 00000000000..e634af90127 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_3.java @@ -0,0 +1,26 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that system property sun.awt.enableExtraMouseButtons might be set to false by the command line + @author Andrei Dmitriev : area=awt.mouse + @run main/othervm -Dsun.awt.enableExtraMouseButtons=false SystemPropTest_3 + */ +//1) Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns false if set through the command line. +//2) Verifies that Toolkit.areExtraMouseButtonsEnabled() returns false if the proprty is set through the command line. +import java.awt.*; + +public class SystemPropTest_3 { + + public static void main(String []s){ + boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + System.out.println("Test System.getProperty = " + System.getProperty("sun.awt.enableExtraMouseButtons")); + System.out.println("System.getProperty = " + propValue); + if (propValue){ + throw new RuntimeException("TEST FAILED : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED : Toolkit.areExtraMouseButtonsEnabled() returns true"); + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_4.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_4.java new file mode 100644 index 00000000000..85a80b741a3 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_4.java @@ -0,0 +1,42 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that system property sun.awt.enableExtraMouseButtons might be set to true by the System class API. + @author Andrei Dmitriev : area=awt.mouse + @run main SystemPropTest_4 + */ +//1) +// - Use System.setProperty("sun.awt.enableExtraMouseButtons", "true") +// - Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns true +// - Verifies that Toolkit.areExtraMouseButtonsEnabled() returns true. +//2) +// - Use System.setProperty("sun.awt.enableExtraMouseButtons", "false") +// - Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns false +// - Verifies that Toolkit.areExtraMouseButtonsEnabled() returns true still. + +import java.awt.*; + +public class SystemPropTest_4 { + public static void main(String []s){ + System.out.println("STAGE 1"); + System.setProperty("sun.awt.enableExtraMouseButtons", "true"); + boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + if (!propValue){ + throw new RuntimeException("TEST FAILED(1) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED(1) : Toolkit.areExtraMouseButtonsEnabled() returns false"); + } + + System.out.println("STAGE 2"); + System.setProperty("sun.awt.enableExtraMouseButtons", "false"); + propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + if (propValue){ + throw new RuntimeException("TEST FAILED(2) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED(2) : Toolkit.areExtraMouseButtonsEnabled() returns false"); + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_5.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_5.java new file mode 100644 index 00000000000..6dc2203d023 --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/SystemPropTest_5.java @@ -0,0 +1,42 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that system property sun.awt.enableExtraMouseButtons might be set to false by the System class API. + @author Andrei Dmitriev : area=awt.mouse + @run main SystemPropTest_5 + */ +//1) +// - Use System.setProperty("sun.awt.enableExtraMouseButtons", "false") +// - Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns false +// - Verifies that Toolkit.areExtraMouseButtonsEnabled() returns false. +//2) +// - Use System.setProperty("sun.awt.enableExtraMouseButtons", "true") +// - Verifies that System.getProperty("sun.awt.enableExtraMouseButtons") returns true +// - Verifies that Toolkit.areExtraMouseButtonsEnabled() returns false still. + +import java.awt.*; + +public class SystemPropTest_5 { + public static void main(String []s){ + System.out.println("STAGE 1"); + System.setProperty("sun.awt.enableExtraMouseButtons", "false"); + boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + if (propValue){ + throw new RuntimeException("TEST FAILED(1) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED(1) : Toolkit.areExtraMouseButtonsEnabled() returns true"); + } + + System.out.println("STAGE 2"); + System.setProperty("sun.awt.enableExtraMouseButtons", "true"); + propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + if (!propValue){ + throw new RuntimeException("TEST FAILED(2) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()){ + throw new RuntimeException("TEST FAILED(2) : Toolkit.areExtraMouseButtonsEnabled() returns true"); + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Disable.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Disable.java new file mode 100644 index 00000000000..023bbb2f3db --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Disable.java @@ -0,0 +1,143 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that sun.awt.enableExtraMouseButtons = false consumes extra events + @author Andrei Dmitriev : area=awt.mouse + @run main/othervm -Dsun.awt.enableExtraMouseButtons=false ToolkitPropertyTest_Disable + */ + +import java.awt.*; +import java.awt.event.*; + +// Testcase 1: set to FALSE and check +// Testcase 2: set to FALSE and check that extra events are not coming +// check that standard events are coming + +public class ToolkitPropertyTest_Disable extends Frame { + static boolean propValue; + static Robot robot; + static int [] buttonsPressed; + static int [] buttonsReleased; + static int [] buttonsClicked; + + static boolean lessThenFourButtons; + + public static void main(String []s){ + propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + buttonsPressed = new int [MouseInfo.getNumberOfButtons()]; + buttonsReleased = new int [MouseInfo.getNumberOfButtons()]; + buttonsClicked = new int [MouseInfo.getNumberOfButtons()]; + + ToolkitPropertyTest_Disable frame = new ToolkitPropertyTest_Disable(); + frame.setSize(300, 300); + frame.setVisible(true); + + MouseAdapter ma1 = new MouseAdapter() { + public void mousePressed(MouseEvent e) { + buttonsPressed[e.getButton() - 1] += 1; + System.out.println("PRESSED "+e); + } + public void mouseReleased(MouseEvent e) { + buttonsReleased[e.getButton() - 1] += 1; + System.out.println("RELEASED "+e); + } + public void mouseClicked(MouseEvent e) { + buttonsClicked[e.getButton() - 1] += 1; + System.out.println("CLICKED "+e); + } + }; + + try { + robot = new Robot(); + robot.delay(1000); + robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth()/2, frame.getLocationOnScreen().y + frame.getHeight()/2); + + System.out.println("Property = " + propValue); + testCase0(); + + testCase1(); + System.out.println("Number Of Buttons = "+ MouseInfo.getNumberOfButtons()); + + lessThenFourButtons = (MouseInfo.getNumberOfButtons() <= 3); + if ( !lessThenFourButtons ) { + frame.addMouseListener(ma1); + testCase2(); + } + } catch (Exception e){ + e.printStackTrace(); +// throw new RuntimeException(e); + } finally { +// frame.removeMouseListener(ma1); + } + } + + public static void testCase0(){ + if (propValue){ + throw new RuntimeException("TEST FAILED (0): System property sun.awt.enableExtraMouseButtons = " + propValue); + } + } + + public static void testCase1(){ + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() == true){ + throw new RuntimeException("TEST FAILED (1): setting to FALSE. Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() = " + Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()); + } + } + + public static void testCase2(){ + emptyArrays(); + int [] buttonMasks = new int[MouseInfo.getNumberOfButtons()]; // = InputEvent.getButtonDownMasks(); + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonMasks[i] = InputEvent.getMaskForButton(i+1); + System.out.println("TEST: "+buttonMasks[i]); + } + + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + System.out.println("button to press = " +(i+1) + " : value passed to robot = " +buttonMasks[i]); + try { + robot.mousePress(buttonMasks[i]); + robot.delay(70); + robot.mouseRelease(buttonMasks[i]); + robot.delay(200); + //no exception is thrown + if (i >= 3) { + throw new RuntimeException("TESTCASE 2 FAILED : robot accepted the extra button " + (i+1) + " instead of throwing an exception."); + } + } catch (IllegalArgumentException e){ + if (i >= 3) { + System.out.println("Passed: an exception caught for extra button."); + } else { + throw new RuntimeException("TESTCASE 2 FAILED : exception happen on standard button.", e); + } + } + } + robot.delay(2000); + if (MouseInfo.getNumberOfButtons() < 3) { + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + if (buttonsPressed[i] != 1 || buttonsReleased[i] != 1 || buttonsClicked[i] !=1 ) { + throw new RuntimeException("TESTCASE 2 FAILED : button " + (i+1) + " wasn't single pressed."); + } + } + } else { + for (int i = 0; i < 3; i++){ + if (buttonsPressed[i] != 1 || buttonsReleased[i] != 1 || buttonsClicked[i] !=1 ) { + throw new RuntimeException("TESTCASE 2 FAILED : button " + (i+1) + " wasn't single pressed."); + } + } + + for (int i = 3; i < MouseInfo.getNumberOfButtons(); i++){ + if (buttonsPressed[i] != 0 || buttonsReleased[i] != 0 || buttonsClicked[i] != 0 ) { + throw new RuntimeException("TESTCASE 2 FAILED : button " + (i+1) + " was pressed."); + } + } + } + } + + public static void emptyArrays(){ + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonsPressed[i] = 0; + buttonsReleased[i] = 0; + buttonsClicked[i] = 0; + } + } + +} diff --git a/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java new file mode 100644 index 00000000000..fa6a41771aa --- /dev/null +++ b/jdk/test/java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java @@ -0,0 +1,120 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that sun.awt.enableExtraMouseButtons is working + @author Andrei Dmitriev : area=awt.mouse + @run main/othervm -Dsun.awt.enableExtraMouseButtons=true ToolkitPropertyTest_Enable + */ + +import java.awt.*; +import java.awt.event.*; + +// Testcase 1: set to TRUE (via jtreg option) +// Testcase 2: set to TRUE and check that extra events are coming +// check that standard events are coming + +public class ToolkitPropertyTest_Enable extends Frame { + static boolean propValue; + static Robot robot; + static int [] buttonsPressed; + static int [] buttonsReleased; + static int [] buttonsClicked; + + public static void main(String []s){ + propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons")); + buttonsPressed = new int [MouseInfo.getNumberOfButtons()]; + buttonsReleased = new int [MouseInfo.getNumberOfButtons()]; + buttonsClicked = new int [MouseInfo.getNumberOfButtons()]; + + ToolkitPropertyTest_Enable frame = new ToolkitPropertyTest_Enable(); + frame.setSize(300, 300); + frame.setVisible(true); + + MouseAdapter ma1 = new MouseAdapter() { + public void mousePressed(MouseEvent e) { + buttonsPressed[e.getButton() - 1] += 1; + System.out.println("PRESSED "+e); + } + public void mouseReleased(MouseEvent e) { + buttonsReleased[e.getButton() - 1] += 1; + System.out.println("RELEASED "+e); + } + public void mouseClicked(MouseEvent e) { + buttonsClicked[e.getButton() - 1] += 1; + System.out.println("CLICKED "+e); + } + }; + // frame.addMouseListener(ma1); + + try { + robot = new Robot(); + robot.delay(1000); + robot.mouseMove(frame.getLocationOnScreen().x + frame.getWidth()/2, frame.getLocationOnScreen().y + frame.getHeight()/2); + + System.out.println("Property = " + propValue); + testCase0(); + + testCase1(); + System.out.println("Number Of Buttons = "+ MouseInfo.getNumberOfButtons()); + + boolean lessThenFourButtons = (MouseInfo.getNumberOfButtons() <= 3); + if ( !lessThenFourButtons ) { + frame.addMouseListener(ma1); + testCase2(); + // testCase3(); + // testCase4(); + frame.removeMouseListener(ma1); + } + } catch (Exception e){ + e.printStackTrace(); + throw new RuntimeException(e); + } + + } + + public static void testCase0(){ + if (!propValue){ + throw new RuntimeException("TEST FAILED (0) : System property sun.awt.enableExtraMouseButtons = " + propValue); + } + } + + public static void testCase1(){ + if (Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled() == false){ + throw new RuntimeException("TEST FAILED (1) : setting to TRUE. enabled = " + Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()); + } + } + + public static void testCase2(){ + emptyArrays(); + //we can't post a message from an unexistent button + int [] buttonMasks = new int[MouseInfo.getNumberOfButtons()]; // = InputEvent.getButtonDownMasks(); + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonMasks[i] = InputEvent.getMaskForButton(i+1); + System.out.println("TEST: "+buttonMasks[i]); + } + + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + System.out.println("button to press = " +(i+1) + " : value passed to robot = " +buttonMasks[i]); + robot.mousePress(buttonMasks[i]); + robot.delay(70); + robot.mouseRelease(buttonMasks[i]); + robot.delay(200); + } + robot.delay(1000); + + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + if (buttonsPressed[i] != 1 || buttonsReleased[i] != 1 || buttonsClicked[i] !=1 ) { + throw new RuntimeException("TESTCASE 2 FAILED : button " + (i+1) + " wasn't single pressed|released|clicked : "+ buttonsPressed[i] +" : "+ buttonsReleased[i] +" : "+ buttonsClicked[i]); + } + } + } + + public static void emptyArrays(){ + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonsPressed[i] = 0; + buttonsReleased[i] = 0; + buttonsClicked[i] = 0; + } + } + +} diff --git a/jdk/test/java/awt/event/InputEvent/ButtonArraysEquality/ButtonArraysEquality.java b/jdk/test/java/awt/event/InputEvent/ButtonArraysEquality/ButtonArraysEquality.java new file mode 100644 index 00000000000..80823918e32 --- /dev/null +++ b/jdk/test/java/awt/event/InputEvent/ButtonArraysEquality/ButtonArraysEquality.java @@ -0,0 +1,83 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that InputEvents button masks arrays are the same + @author Andrei Dmitriev : area=awt.event + @run main ButtonArraysEquality + */ + +import java.awt.*; +import java.awt.event.*; +import java.lang.reflect.*; +import java.security.AccessController; +import java.security.PrivilegedAction; + +// get array InputEvent.BUTTON_MASK via reflection +// get array InputEvent.BUTTON_DOWN_MASK via reflection +// compare their lengths and values + +public class ButtonArraysEquality { + static int [] eventDownMask = new int []{InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, InputEvent.BUTTON3_DOWN_MASK}; + + public static void main(String []s){ + int [] buttonDownMasksAPI = new int [MouseInfo.getNumberOfButtons()]; + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonDownMasksAPI[i] = InputEvent.getMaskForButton(i+1); + System.out.println("TEST: "+buttonDownMasksAPI[i]); + } + + // getButtonDownMasks() + Object obj = AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + try { + Class clazz = Class.forName("java.awt.event.InputEvent"); + Method method = clazz.getDeclaredMethod("getButtonDownMasks",new Class [] {}); + if (method != null) { + method.setAccessible(true); + return method.invoke(null, (Object[])null); + } + }catch (Exception e){ + throw new RuntimeException("Test failed. Exception occured:", e); + } + return null; + } + }); + + int [] buttonDownMasks = new int [Array.getLength(obj)]; + checkNullAndPutValuesToArray(buttonDownMasks, obj); + + //check lengths: array shouldn't contain less elements then the number of buttons on a mouse + if (buttonDownMasks.length < buttonDownMasksAPI.length){ + throw new RuntimeException("Test failed. The lengths array is less then the number of buttons"); + } + + // verify values for first three buttons + for (int i = 0; i < 3; i++) { + if (eventDownMask[i] != buttonDownMasks[i]) + { + System.out.println("Test : "+ i + " | " + " | " +eventDownMask[i] + " | "+ buttonDownMasks[i]); + throw new RuntimeException("Failure: masks are not correct for standard buttons"); + } + } + + // verify values for extra buttons if any + for (int i = 3; i < MouseInfo.getNumberOfButtons(); i++) { + if (buttonDownMasksAPI[i] != buttonDownMasks[i]) { + throw new RuntimeException("Failure: masks are not the same for extra buttons"); + } + } + System.out.println("Test passed."); + } + + public static void checkNullAndPutValuesToArray(int [] array, Object obj){ + if (obj == null){ + throw new RuntimeException("Test failed. The array obtained via reflection is "+obj); + } + + for (int i = 0; i < Array.getLength(obj); i++){ + System.out.println("Test (Reflection): "+ Array.getInt(obj, i)); + array[i] = Array.getInt(obj, i); + } + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java b/jdk/test/java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java new file mode 100644 index 00000000000..802f4cfd6b2 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java @@ -0,0 +1,53 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that MouseEvent CTOR accepts extra mouse button numbers + @author Andrei Dmitriev : area=awt.event + @run main AcceptExtraButton + */ + +//package acceptextrabutton; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseAdapter; + +public class AcceptExtraButton extends Frame { + static int [] eventID = new int []{MouseEvent.MOUSE_PRESSED, MouseEvent.MOUSE_RELEASED, MouseEvent.MOUSE_CLICKED}; + + public static void main(String []s){ + AcceptExtraButton f = new AcceptExtraButton(); + f.setSize(300, 300); + f.setVisible(true); + + for (int buttonId = 0; buttonId>>"+me); + f.dispatchEvent( ( AWTEvent )me ); + } + } + MouseAdapter ma1 = new MouseAdapter() { + public void mousePressed(MouseEvent e) { + System.out.println("PRESSED "+e); + } + public void mouseReleased(MouseEvent e) { + System.out.println("RELEASED "+e); + } + public void mouseClicked(MouseEvent e) { + System.out.println("CLICKED "+e); + } + }; + f.addMouseListener(ma1); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions.java b/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions.java new file mode 100644 index 00000000000..d4611158553 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions.java @@ -0,0 +1,89 @@ +/* + test %I% %E% + @bug 6315717 + @summary verifies that MouseEvent could be constructed correctly for mouse extra buttons in regard to sun.awt.enableExtraMouseButtons property + @author Andrei Dmitriev : area=awt.event + @run main CTORRestrictions + */ + +/* + * verify that user can create the MouseEvent? with button1|2|3|4|5|... when property "sun.awt.enableExtraMouseButtons" is true by default + */ +import java.awt.*; +import java.awt.event.*; + +public class CTORRestrictions{ + static Frame frame = new Frame("MouseEvent Test Frame"); + static Point mousePosition; + static Point mousePositionOnScreen; + + public static void main(String []s){ + Robot robot = null; + try { + robot = new Robot(); + } catch (AWTException ex) { + throw new RuntimeException("Test Failed", ex); + } + frame.setSize (200,200); + frame.setLocation (300, 400); + frame.setVisible(true); + robot.delay(1000); + System.out.println("sun.awt.enableExtraMouseButtons = "+Toolkit.getDefaultToolkit().getDesktopProperty("sun.awt.enableExtraMouseButtons")); + mousePosition = new Point(100, 100); + mousePositionOnScreen = new Point(frame.getLocationOnScreen().x + mousePosition.x, + frame.getLocationOnScreen().y + mousePosition.y); + + /* + * On Linux the native system count a wheel (both directions) as two more buttons on a mouse. + * So, MouseInfo.getNumberOfButtons() would report 5 buttons on a three-button mouse. + * On Windows it would still report that MouseInfo.getNumberOfButtons() == 3. + * We should handle XToolkit case and iterate through the buttons + * up to (MouseInfo.getNumberOfButtons() - 2) value. + */ + int numberOfButtons; + if (Toolkit.getDefaultToolkit().getClass().getName().equals("sun.awt.windows.WToolkit")){ + numberOfButtons = MouseInfo.getNumberOfButtons(); + } else { + numberOfButtons = MouseInfo.getNumberOfButtons() - 2; + } + System.out.println("Stage 1. Number of buttons = "+ numberOfButtons); + + for (int buttonId = 1; buttonId <= numberOfButtons; buttonId++){ + postMouseEventNewCtor(buttonId); + } + + System.out.println("Stage 2. Number of buttons = "+ numberOfButtons); + for (int buttonId = 1; buttonId <= numberOfButtons; buttonId++){ + postMouseEventOldCtor(buttonId); + } + System.out.println("Test passed."); + } + + public static void postMouseEventNewCtor(int buttonId) { + MouseEvent me = new MouseEvent(frame, + MouseEvent.MOUSE_PRESSED, + System.currentTimeMillis(), + MouseEvent.BUTTON1_DOWN_MASK, + mousePosition.x, mousePosition.y, + mousePositionOnScreen.x, + mousePositionOnScreen.y, + 1, + false, //popupTrigger + buttonId //button + ); + frame.dispatchEvent( ( AWTEvent )me ); + } + + public static void postMouseEventOldCtor(int buttonId) { + MouseEvent meOld = new MouseEvent(frame, + MouseEvent.MOUSE_PRESSED, + System.currentTimeMillis(), + MouseEvent.BUTTON1_DOWN_MASK, + mousePosition.x, mousePosition.y, + 1, + false, //popupTrigger + buttonId //button + ); + frame.dispatchEvent( ( AWTEvent )meOld ); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java b/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java new file mode 100644 index 00000000000..aaf1c16c760 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/CTORRestrictions/CTORRestrictions_Disable.java @@ -0,0 +1,101 @@ +/* + test %I% %E% + @bug 6315717 + @summary verifies that MouseEvent could be constructed correctly for mouse extra buttons in regard to sun.awt.enableExtraMouseButtons property + @author Andrei Dmitriev : area=awt.event + @run main/othervm -Dsun.awt.enableExtraMouseButtons=false CTORRestrictions_Disable + */ + +/* + * verify that user can't create the MouseEvent? with button4|5|... when property "sun.awt.enableExtraMouseButtons"=false + * verify that user can create the MouseEvent? with button1|2|3 when property "sun.awt.enableExtraMouseButtons"=false + */ + +import java.awt.*; +import java.awt.event.*; + +public class CTORRestrictions_Disable { + static Frame frame = new Frame("MouseEvent Test Frame"); + static Point mousePosition; + static Point mousePositionOnScreen; + + public static void main(String []s){ + Robot robot = null; + try { + robot = new Robot(); + } catch (AWTException ex) { + throw new RuntimeException("Test Failed", ex); + } + frame.setSize (200,200); + frame.setLocation (300, 400); + frame.setVisible(true); + robot.delay(1000); + System.out.println(Toolkit.getDefaultToolkit().getDesktopProperty("sun.awt.enableExtraMouseButtons")); + mousePosition = new Point(100, 100); + mousePositionOnScreen = new Point(frame.getLocationOnScreen().x + mousePosition.x, + frame.getLocationOnScreen().y + mousePosition.y); + + System.out.println("Stage 1"); + for (int buttonId = 1; buttonId <= MouseInfo.getNumberOfButtons(); buttonId++){ + try { + postMouseEventNewCtor(buttonId); + if (buttonId > 3) { + throw new RuntimeException("Stage 1 FAILED: MouseEvent CTOR accepted the extra button " + (buttonId+1) + " instead of throwing an exception."); + } + } catch (IllegalArgumentException e){ + if (buttonId > 3) { + System.out.println("Passed: an exception caught for extra button."); + } else { + throw new RuntimeException("Stage 1 FAILED : exception happen on standard button.", e); + } + } + } + + System.out.println("Stage 2"); + for (int buttonId = 1; buttonId <= MouseInfo.getNumberOfButtons(); buttonId++){ + try { + postMouseEventOldCtor(buttonId); + if (buttonId > 3) { + throw new RuntimeException("Stage 2 FAILED: MouseEvent CTOR accepted the extra button " + (buttonId+1) + " instead of throwing an exception."); + } + } catch (IllegalArgumentException e){ + if (buttonId > 3) { + System.out.println("Passed: an exception caught for extra button."); + } else { + throw new RuntimeException("Stage 2 FAILED : exception happen on standard button.", e); + } + } + } + System.out.println("Test passed."); + } + + public static void postMouseEventNewCtor(int buttonId) { + MouseEvent me = new MouseEvent(frame, + MouseEvent.MOUSE_PRESSED, + System.currentTimeMillis(), + MouseEvent.BUTTON1_DOWN_MASK, + mousePosition.x, mousePosition.y, + mousePositionOnScreen.x, + mousePositionOnScreen.y, + 1, + false, //popupTrigger + buttonId //button + ); + frame.dispatchEvent( ( AWTEvent )me ); + } + + public static void postMouseEventOldCtor(int buttonId) { + MouseEvent meOld = new MouseEvent(frame, + MouseEvent.MOUSE_PRESSED, + System.currentTimeMillis(), + MouseEvent.BUTTON1_DOWN_MASK, + mousePosition.x, mousePosition.y, + 1, + false, //popupTrigger + buttonId //button + ); + frame.dispatchEvent( ( AWTEvent )meOld ); + } +} + + diff --git a/jdk/test/java/awt/event/MouseEvent/CheckGetMaskForButton/CheckGetMaskForButton.java b/jdk/test/java/awt/event/MouseEvent/CheckGetMaskForButton/CheckGetMaskForButton.java new file mode 100644 index 00000000000..2f62521f58d --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/CheckGetMaskForButton/CheckGetMaskForButton.java @@ -0,0 +1,65 @@ +/* + @test %I% %E% + @bug 6315717 + @summary verifies that InputEvent.getMaskForButton() returns the same values as in InputEvent.BUTTON_DOWN_MASK + @author Andrei Dmitriev : area=awt.event + @run main CheckGetMaskForButton +*/ + +import java.awt.*; +import java.awt.event.InputEvent; +import java.lang.reflect.*; +import java.security.AccessController; +import java.security.PrivilegedAction; + +public class CheckGetMaskForButton{ + static Robot robot; + + public static void main(String []s){ + System.out.println("Number Of Buttons = "+ MouseInfo.getNumberOfButtons()); + CheckGetMaskForButton f = new CheckGetMaskForButton(); + int [] buttonMasksViaAPI = new int[MouseInfo.getNumberOfButtons()]; + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + buttonMasksViaAPI[i] = InputEvent.getMaskForButton(i+1); + System.out.println("Test (API): "+ buttonMasksViaAPI[i]); + } + + //get same array via reflection + Object obj = AccessController.doPrivileged( + new PrivilegedAction() { + public Object run() { + try { + Class clazz = Class.forName("java.awt.event.InputEvent"); + Method method = clazz.getDeclaredMethod("getButtonDownMasks",new Class [] {}); + if (method != null) { + method.setAccessible(true); + return method.invoke(null, (Object[])null); + } + }catch (Exception e){ + throw new RuntimeException("Test failed. Exception occured:", e); + } + return null; + } + }); + + if (obj == null){ + throw new RuntimeException("Test failed. The value obtained via reflection is "+obj); + } + + int [] buttonDownMasksViaReflection = new int [Array.getLength(obj)]; + //check that length of API array greater or equals then Reflect array. + if (Array.getLength(obj) < buttonMasksViaAPI.length){ + throw new RuntimeException("Test failed. The length of API array greater or equals then the length of Reflect array."); + } + + //Check that the values obtained via reflection from InputEvent.BUTTON_DOWN_MASK are the + // same as for standard API. + for (int i = 0; i < MouseInfo.getNumberOfButtons(); i++){ + System.out.println("Test (Reflection): "+ Array.getInt(obj, i)); + if (buttonMasksViaAPI[i] != Array.getInt(obj, i)){ + throw new RuntimeException("Test failed. Values of InputEvent array are different for API and Reflection invocations"); + } + } + System.out.println("Test passed."); + } +} diff --git a/jdk/test/java/awt/event/MouseEvent/SmoothWheel/SmoothWheel.java b/jdk/test/java/awt/event/MouseEvent/SmoothWheel/SmoothWheel.java index 00e07c84d3c..e3f7f6498ab 100644 --- a/jdk/test/java/awt/event/MouseEvent/SmoothWheel/SmoothWheel.java +++ b/jdk/test/java/awt/event/MouseEvent/SmoothWheel/SmoothWheel.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/font/TextLayout/VisibleAdvance.java b/jdk/test/java/awt/font/TextLayout/VisibleAdvance.java index 446d16dba15..224b2386125 100644 --- a/jdk/test/java/awt/font/TextLayout/VisibleAdvance.java +++ b/jdk/test/java/awt/font/TextLayout/VisibleAdvance.java @@ -1,3 +1,27 @@ +/* + * Copyright 2005-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. + * + * 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.*; import java.awt.font.*; import java.awt.geom.*; diff --git a/jdk/test/java/awt/font/Threads/FontThread.java b/jdk/test/java/awt/font/Threads/FontThread.java index 3eb47d74326..0db9ae2c399 100644 --- a/jdk/test/java/awt/font/Threads/FontThread.java +++ b/jdk/test/java/awt/font/Threads/FontThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/awt/image/MemoryLeakTest/MemoryLeakTest.java b/jdk/test/java/awt/image/MemoryLeakTest/MemoryLeakTest.java new file mode 100644 index 00000000000..ace1bb4979e --- /dev/null +++ b/jdk/test/java/awt/image/MemoryLeakTest/MemoryLeakTest.java @@ -0,0 +1,175 @@ +/* + * Copyright 1998-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. + * + * 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 4078566 6658398 + @summary Test for a memory leak in Image. + @run main/manual MemoryLeakTest +*/ + +import java.applet.Applet; +import java.lang.*; +import java.awt.*; +import java.awt.event.*; + +class Globals { + static boolean testPassed=false; + static Thread mainThread=null; +} + +public class MemoryLeakTest extends Applet { + +public static void main(String args[]) throws Exception { + new TestDialog(new Frame(), "MemoryLeakTest").start(); + new MemoryLeak().start(); + Globals.mainThread = Thread.currentThread(); + try { + Thread.sleep(300000); + } catch (InterruptedException e) { + if (!Globals.testPassed) + throw new Exception("MemoryLeakTest failed."); + } +} + +} + +class TestDialog extends Dialog + implements ActionListener { + +TextArea output; +Button passButton; +Button failButton; +String name; + +public TestDialog(Frame frame, String name) +{ + super(frame, name + " Pass/Fail Dialog"); + this.name = name; + output = new TextArea(11, 50); + add("North", output); + output.append("Do the following steps on Solaris only.\n"); + output.append("Maximize and minimize the Memory Leak Test window.\n"); + output.append("Execute the following after minimize.\n"); + output.append(" ps -al | egrep -i 'java|PPID'\n"); + output.append("Examine the size of the process under SZ.\n"); + output.append("Maximize and minimize the Memory Leak Test window again.\n"); + output.append("Execute the following after minimize.\n"); + output.append(" ps -al | egrep -i 'java|PPID'\n"); + output.append("Examine the size of the process under SZ.\n"); + output.append("If the two SZ values are the same, plus or minus one,\n"); + output.append("then click Pass, else click Fail."); + Panel buttonPanel = new Panel(); + passButton = new Button("Pass"); + failButton = new Button("Fail"); + passButton.addActionListener(this); + failButton.addActionListener(this); + buttonPanel.add(passButton); + buttonPanel.add(failButton); + add("South", buttonPanel); + pack(); +} + +public void start() +{ + show(); +} + +public void actionPerformed(ActionEvent event) +{ + if ( event.getSource() == passButton ) { + Globals.testPassed = true; + System.err.println(name + " Passed."); + } + else if ( event.getSource() == failButton ) { + Globals.testPassed = false; + System.err.println(name + " Failed."); + } + this.dispose(); + if (Globals.mainThread != null) + Globals.mainThread.interrupt(); +} + +} + + +class MemoryLeak extends Frame implements ComponentListener +{ +private Image osImage; + +public MemoryLeak() +{ + super("Memory Leak Test"); + setSize(200, 200); + addComponentListener(this); +} + +public static void main(String args[]) +{ + new MemoryLeak().start(); +} + +public void start() +{ + show(); +} + +public void paint(Graphics g) { + if (osImage != null) { + g.drawImage(osImage, 0, 0, this); + } +} + +public void update(Graphics g) +{ + paint(g); +} + +public void componentResized(ComponentEvent e) +{ + Image oldimage = osImage; + osImage = createImage(getSize().width, getSize().height); + Graphics g = osImage.getGraphics(); + if (oldimage != null) { + g.drawImage(oldimage, 0, 0, getSize().width, getSize().height, this); + oldimage.flush(); + } else { + g.setColor(Color.blue); + g.drawLine(0, 0, getSize().width, getSize().height); + } + g.dispose(); +} + +public void componentMoved(ComponentEvent e) {} + +public void componentShown(ComponentEvent e) +{ + osImage = createImage(getSize().width, getSize().height); + Graphics g = osImage.getGraphics(); + g.setColor(Color.blue); + g.drawLine(0, 0, getSize().width, getSize().height); + g.dispose(); +} + +public void componentHidden(ComponentEvent e) {} + +} diff --git a/jdk/test/java/awt/print/PrinterJob/PrintAWTImage.java b/jdk/test/java/awt/print/PrinterJob/PrintAWTImage.java new file mode 100644 index 00000000000..0cb3b4eb86b --- /dev/null +++ b/jdk/test/java/awt/print/PrinterJob/PrintAWTImage.java @@ -0,0 +1,90 @@ +/* + * Copyright 1999-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 + * @bug 4257262 6708509 + * @summary Image should be sent to printer. +* @run main/manual PrintAWTImage + */ + +import java.awt.*; +import java.awt.event.*; +import java.awt.print.*; + + +public class PrintAWTImage extends Frame + implements ActionListener, Printable { + + public Image imgJava; + + + public static void main(String args[]) { + PrintAWTImage f = new PrintAWTImage(); + f.show(); + } + + public PrintAWTImage() { + + Button printButton = new Button("Print"); + setLayout(new FlowLayout()); + add(printButton); + printButton.addActionListener(this); + + addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + System.exit(0); + } + }); + + pack(); + } + + public void actionPerformed(ActionEvent e) { + + PrinterJob pj = PrinterJob.getPrinterJob(); + + if (pj != null && pj.printDialog()) { + pj.setPrintable(this); + try { + pj.print(); + } catch (PrinterException pe) { + } finally { + System.err.println("PRINT RETURNED"); + } + } + } + + + public int print(Graphics g, PageFormat pgFmt, int pgIndex) { + if (pgIndex > 0) + return Printable.NO_SUCH_PAGE; + + Graphics2D g2d = (Graphics2D)g; + g2d.translate(pgFmt.getImageableX(), pgFmt.getImageableY()); + Image imgJava = Toolkit.getDefaultToolkit().getImage("duke.gif"); + g2d.drawImage(imgJava, 0, 0, this); + + return Printable.PAGE_EXISTS; + } + +} diff --git a/jdk/test/java/awt/print/PrinterJob/duke.gif b/jdk/test/java/awt/print/PrinterJob/duke.gif new file mode 100644 index 00000000000..ed32e0ff79b Binary files /dev/null and b/jdk/test/java/awt/print/PrinterJob/duke.gif differ diff --git a/jdk/test/java/beans/Introspector/Test4896879.java b/jdk/test/java/beans/Introspector/Test4896879.java index 2423841c798..4e1ef7e1fe9 100644 --- a/jdk/test/java/beans/Introspector/Test4896879.java +++ b/jdk/test/java/beans/Introspector/Test4896879.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/beans/Introspector/Test4935607.java b/jdk/test/java/beans/Introspector/Test4935607.java index 7ce48c9b6c8..6e94f0006b2 100644 --- a/jdk/test/java/beans/Introspector/Test4935607.java +++ b/jdk/test/java/beans/Introspector/Test4935607.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/beans/XMLEncoder/Test4935607.java b/jdk/test/java/beans/XMLEncoder/Test4935607.java index 3d5e70e6df1..da8bbe3fd7e 100644 --- a/jdk/test/java/beans/XMLEncoder/Test4935607.java +++ b/jdk/test/java/beans/XMLEncoder/Test4935607.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/beans/XMLEncoder/java_io_File.java b/jdk/test/java/beans/XMLEncoder/java_io_File.java new file mode 100644 index 00000000000..282949b0151 --- /dev/null +++ b/jdk/test/java/beans/XMLEncoder/java_io_File.java @@ -0,0 +1,47 @@ +/* + * Copyright 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. + * + * 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 6708550 + * @summary Tests File encoding + * @author Sergey Malenkov + */ + +import java.io.File; + +public final class java_io_File extends AbstractTest { + public static void main(String[] args) { + new java_io_File().test(true); + } + + @Override + protected File getObject() { + return new File("test.txt"); // NON-NLS: local file + } + + @Override + protected File getAnotherObject() { + return new File("/pub/demo/"); // NON-NLS: path + } +} diff --git a/jdk/test/java/io/File/MaxPath.java b/jdk/test/java/io/File/MaxPath.java new file mode 100644 index 00000000000..115f05ee85d --- /dev/null +++ b/jdk/test/java/io/File/MaxPath.java @@ -0,0 +1,56 @@ +/* + * Copyright 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. + * + * 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 6481955 + @summary Path length less than MAX_PATH (260) works on Windows + */ + +import java.io.*; + +public class MaxPath { + public static void main(String[] args) throws Exception { + String osName = System.getProperty("os.name"); + if (!osName.startsWith("Windows")) { + return; + } + int MAX_PATH = 260; + String dir = new File(".").getAbsolutePath() + "\\"; + String padding = "1234567890123456789012345678901234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890012345678900123456789001234567890"; + for (int i = 240 - dir.length(); i < MAX_PATH - dir.length(); i++) { + String longname = dir + padding.substring(0, i); + try { + File f = new File(longname); + if (f.createNewFile()) { + if (!f.exists() || !f.canRead()) { + throw new RuntimeException("Failed at length: " + longname.length()); + } + f.delete(); + } + } catch (IOException e) { + System.out.println("Failed at length: " + longname.length()); + throw e; + } + } + } +} diff --git a/jdk/test/java/io/File/SetLastModified.java b/jdk/test/java/io/File/SetLastModified.java index 22cb5326554..bcb7070c530 100644 --- a/jdk/test/java/io/File/SetLastModified.java +++ b/jdk/test/java/io/File/SetLastModified.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -22,11 +22,13 @@ */ /* @test - @bug 4091757 + @bug 4091757 6652379 @summary Basic test for setLastModified method */ import java.io.*; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; public class SetLastModified { @@ -95,13 +97,24 @@ public class SetLastModified { if (f.setLastModified(nt)) throw new Exception("Succeeded on non-existent file: " + f); - OutputStream o = new FileOutputStream(f); - o.write('x'); - o.close(); - ot = f.lastModified(); - if (!f.setLastModified(nt)) - throw new Exception("setLastModified failed on file: " + f); - ck(f, nt, f.lastModified()); + // set/check last modified on files of size 1, 1GB+1, 2GB+1, .. + // On Windows we only test with a tiny file as that platform doesn't + // support sparse files by default and so the test takes too long. + final long G = 1024L * 1024L * 1024L; + final long MAX_POSITION = + System.getProperty("os.name").startsWith("Windows") ? 0L : 3L*G; + long pos = 0L; + while (pos <= MAX_POSITION) { + FileChannel fc = new FileOutputStream(f).getChannel(); + fc.position(pos).write(ByteBuffer.wrap("x".getBytes())); + fc.close(); + ot = f.lastModified(); + System.out.format("check with file size: %d\n", f.length()); + if (!f.setLastModified(nt)) + throw new Exception("setLastModified failed on file: " + f); + ck(f, nt, f.lastModified()); + pos += G; + } if (!f.delete()) throw new Exception("Can't delete test file " + f); if (!d2.delete()) throw new Exception("Can't delete test directory " + d2); diff --git a/jdk/test/java/io/File/SetReadOnly.java b/jdk/test/java/io/File/SetReadOnly.java index ed89513f8bf..ecd7e6aae23 100644 --- a/jdk/test/java/io/File/SetReadOnly.java +++ b/jdk/test/java/io/File/SetReadOnly.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 @@ -22,7 +22,7 @@ */ /* @test - @bug 4091757 + @bug 4091757 4939819 @summary Basic test for setReadOnly method */ @@ -59,8 +59,15 @@ public class SetReadOnly { throw new Exception(f + ": Cannot create directory"); if (!f.setReadOnly()) throw new Exception(f + ": Failed on directory"); - if (f.canWrite()) - throw new Exception(f + ": Directory is writeable"); + // The readonly attribute on Windows does not make a folder read-only + if (System.getProperty("os.name").startsWith("Windows")) { + if (!f.canWrite()) + throw new Exception(f + ": Directory is not writeable"); + } else { + if (f.canWrite()) + throw new Exception(f + ": Directory is writeable"); + } + if (!f.delete()) throw new Exception(f + ": Cannot delete directory"); diff --git a/jdk/test/java/io/FileOutputStream/AtomicAppend.java b/jdk/test/java/io/FileOutputStream/AtomicAppend.java index f5f0c23606c..f76e6117539 100644 --- a/jdk/test/java/io/FileOutputStream/AtomicAppend.java +++ b/jdk/test/java/io/FileOutputStream/AtomicAppend.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/java/lang/ProcessBuilder/Basic.java b/jdk/test/java/lang/ProcessBuilder/Basic.java index b0bfe12f250..d5ac05f4599 100644 --- a/jdk/test/java/lang/ProcessBuilder/Basic.java +++ b/jdk/test/java/lang/ProcessBuilder/Basic.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/lang/System/Versions.java b/jdk/test/java/lang/System/Versions.java index d94d3b451eb..7464fc88474 100644 --- a/jdk/test/java/lang/System/Versions.java +++ b/jdk/test/java/lang/System/Versions.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 @@ -23,7 +23,7 @@ /** * @test - * @bug 4989690 6259855 + * @bug 4989690 6259855 6706299 * @summary Check that version-related system property invariants hold. * @author Martin Buchholz */ diff --git a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh index 937b6600431..c26ef857339 100644 --- a/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh +++ b/jdk/test/java/lang/instrument/BootClassPath/BootClassPathTest.sh @@ -1,5 +1,5 @@ # -# Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-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 diff --git a/jdk/test/java/lang/instrument/MakeJAR2.sh b/jdk/test/java/lang/instrument/MakeJAR2.sh index 6b6721ed550..3cd6b1c653a 100644 --- a/jdk/test/java/lang/instrument/MakeJAR2.sh +++ b/jdk/test/java/lang/instrument/MakeJAR2.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java b/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java index 5ff3d5599e2..20b25a8f286 100644 --- a/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java +++ b/jdk/test/java/lang/instrument/NativeMethodPrefixAgent.java @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/PremainClass/DummyMain.java b/jdk/test/java/lang/instrument/PremainClass/DummyMain.java index 0cf20ef6c1f..517574dee43 100644 --- a/jdk/test/java/lang/instrument/PremainClass/DummyMain.java +++ b/jdk/test/java/lang/instrument/PremainClass/DummyMain.java @@ -1,5 +1,5 @@ /* - * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh index d6c34e44f57..c3d3cb77689 100644 --- a/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh +++ b/jdk/test/java/lang/instrument/PremainClass/PremainClassTest.sh @@ -1,5 +1,5 @@ # -# Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2004-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 diff --git a/jdk/test/java/lang/instrument/RetransformAgent.java b/jdk/test/java/lang/instrument/RetransformAgent.java index cd8db7458e8..dc19dce5ef8 100644 --- a/jdk/test/java/lang/instrument/RetransformAgent.java +++ b/jdk/test/java/lang/instrument/RetransformAgent.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java b/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java index de1573a53a5..771535fe852 100644 --- a/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java +++ b/jdk/test/java/lang/instrument/TransformerManagementThreadAddTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java b/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java index a7d381ff821..c31fb2476d6 100644 --- a/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java +++ b/jdk/test/java/lang/instrument/TransformerManagementThreadRemoveTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh index 3f4e08b9c95..eab604e58ec 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CircularityErrorTest.sh @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh index 5b7411ac989..a71b49e07ef 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/ClassUnloadTest.sh @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh index 2cd7032cedc..0fdce4ba0a4 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/CommonSetup.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh index ba6d985f218..06ebd6f10e0 100644 --- a/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh +++ b/jdk/test/java/lang/instrument/appendToClassLoaderSearch/run_tests.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 2005-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 diff --git a/jdk/test/java/net/CookieHandler/CookieManagerTest.java b/jdk/test/java/net/CookieHandler/CookieManagerTest.java index b83c27fcefc..99af6149809 100644 --- a/jdk/test/java/net/CookieHandler/CookieManagerTest.java +++ b/jdk/test/java/net/CookieHandler/CookieManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/net/Inet6Address/serialize/Readme.txt b/jdk/test/java/net/Inet6Address/serialize/Readme.txt new file mode 100644 index 00000000000..4335bbd206f --- /dev/null +++ b/jdk/test/java/net/Inet6Address/serialize/Readme.txt @@ -0,0 +1,6 @@ +This test uses 2 binary data files that were each created by serializing an Inet6Address instance. +In both cases this has to do with the tricky issue of scopes in serialized addresses. + +serial1.4.2.ser: Was created by serializing an Inet6Address (::1) with J2SE 1.4.2 and is used to check for backward compatibility. + +serial-bge0.ser: Was created on a Sparc workstation because it has an uncommon interface name ('bge0') which is useful for the test. diff --git a/jdk/test/java/net/Inet6Address/serialize/Serialize.java b/jdk/test/java/net/Inet6Address/serialize/Serialize.java index d97149b79a1..17b5500576c 100644 --- a/jdk/test/java/net/Inet6Address/serialize/Serialize.java +++ b/jdk/test/java/net/Inet6Address/serialize/Serialize.java @@ -24,7 +24,9 @@ /** * @test * @bug 4921029 + * @bug 6656849 * @summary java.net.Inet6Address fails to be serialized with IPv6 support + * @summary NullPointerException thrown while de-serializing IPV6 Address. */ import java.net.*; @@ -76,11 +78,20 @@ public class Serialize { System.out.println(nobj); - // create an address with an unlikely numeric scope_id - if (!test ((Inet6Address)InetAddress.getByName ("fe80::1%99"))) { - throw new RuntimeException ("test failed on fe80::1%99"); - } + // create an address with an unlikely numeric scope_id + if (!test ((Inet6Address)InetAddress.getByName ("fe80::1%99"))) { + throw new RuntimeException ("test failed on fe80::1%99"); + } + // Deserialize an Inet6 address with a named interface + file = new File (System.getProperty("test.src"), "serial-bge0.ser"); + ois = new ObjectInputStream(new FileInputStream(file)); + try { + nobj = (Inet6Address) ois.readObject(); + } catch (NullPointerException e) { + throw new RuntimeException("6656849 Not fixed: NullPointer when deserializing"); + } + System.out.println(nobj); System.out.println("All tests passed"); } @@ -97,8 +108,5 @@ public class Serialize { } else { return false; } - - } - } diff --git a/jdk/test/java/net/Inet6Address/serialize/serial-bge0.ser b/jdk/test/java/net/Inet6Address/serialize/serial-bge0.ser new file mode 100644 index 00000000000..4382d7d1e8f Binary files /dev/null and b/jdk/test/java/net/Inet6Address/serialize/serial-bge0.ser differ diff --git a/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java b/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java index 82d593c5d70..1caf725078c 100644 --- a/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java +++ b/jdk/test/java/nio/Buffer/StringCharBufferSliceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java index 8ec350cff01..834e7431eb6 100644 --- a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java +++ b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4460583 4470470 4840199 6419424 + * @bug 4460583 4470470 4840199 6419424 6710579 6596323 * @summary Comprehensive test of asynchronous closing and interruption * @author Mark Reinhold */ @@ -582,7 +582,7 @@ public class AsyncCloseAndInterrupt { log.println("WARNING: transferFrom/close not tested"); return; } - if ((op == TRANSFER_TO) && TestUtil.onSolaris()) { + if ((op == TRANSFER_TO) && !TestUtil.onWindows()) { log.println("WARNING: transferTo/close not tested"); return; } diff --git a/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java b/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java index 23ef97a6bbf..278badb9702 100644 --- a/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java +++ b/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4938372 + * @bug 4938372 6541641 * @summary Flushing dirty pages prior to unmap can cause Cleaner thread to * abort VM if memory system has pages locked */ @@ -39,7 +39,7 @@ import java.util.ArrayList; public class ExpandingMap { - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws Exception { int initialSize = 20480*1024; int maximumMapSize = 16*1024*1024; @@ -103,6 +103,13 @@ public class ExpandingMap { } } + fc.close(); + // cleanup the ref to mapped buffers so they can be GCed + for (int i = 0; i < buffers.length; i++) + buffers[i] = null; + System.gc(); + // Take a nap to wait for the Cleaner to cleanup those unrefed maps + Thread.sleep(1000); System.out.println("TEST PASSED"); } diff --git a/jdk/test/java/nio/channels/FileChannel/LongTransferTest.java b/jdk/test/java/nio/channels/FileChannel/LongTransferTest.java index 068e6d0d875..eb20ef43d3d 100644 --- a/jdk/test/java/nio/channels/FileChannel/LongTransferTest.java +++ b/jdk/test/java/nio/channels/FileChannel/LongTransferTest.java @@ -22,7 +22,7 @@ */ /* @test - @bug 5105464 6269047 + @bug 5105464 6269047 6541631 * @summary Test to transfer bytes with a size bigger than Integer.MAX_VALUE */ @@ -81,9 +81,11 @@ public class LongTransferTest { System.out.println("LongTransferTest-main: OK!"); socket.close(); - server.close(); + inChannel.close(); + outChannel.close(); + inFile.delete(); outFile.delete(); } diff --git a/jdk/test/java/nio/channels/Selector/Wakeup.java b/jdk/test/java/nio/channels/Selector/Wakeup.java new file mode 100644 index 00000000000..808ba831653 --- /dev/null +++ b/jdk/test/java/nio/channels/Selector/Wakeup.java @@ -0,0 +1,197 @@ +/* + * Copyright 2001-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 + * @bug 6405995 + * @summary Unit test for selector wakeup and interruption + * @library .. + */ + +import java.io.*; +import java.net.*; +import java.nio.*; +import java.nio.channels.*; +import java.util.Random; + +public class Wakeup { + + static void sleep(int millis) { + try { + Thread.sleep(millis); + } catch (InterruptedException x) { + x.printStackTrace(); + } + } + + static class Sleeper extends TestThread { + volatile boolean started = false; + volatile int entries = 0; + volatile int wakeups = 0; + volatile boolean wantInterrupt = false; + volatile boolean gotInterrupt = false; + volatile Exception exception = null; + volatile boolean closed = false; + Object gate = new Object(); + + Selector sel; + + Sleeper(Selector sel) { + super("Sleeper", System.err); + this.sel = sel; + } + + public void go() throws Exception { + started = true; + for (;;) { + synchronized (gate) { } + entries++; + try { + sel.select(); + } catch (ClosedSelectorException x) { + closed = true; + } + boolean intr = Thread.currentThread().isInterrupted(); + wakeups++; + System.err.println("Wakeup " + wakeups + + (closed ? " (closed)" : "") + + (intr ? " (intr)" : "")); + if (wakeups > 1000) + throw new Exception("Too many wakeups"); + if (closed) + return; + if (wantInterrupt) { + while (!Thread.interrupted()) + Thread.yield(); + gotInterrupt = true; + wantInterrupt = false; + } + } + } + + } + + private static int checkedWakeups = 0; + + private static void check(Sleeper sleeper, boolean intr) + throws Exception + { + checkedWakeups++; + if (sleeper.wakeups > checkedWakeups) { + sleeper.finish(100); + throw new Exception("Sleeper has run ahead"); + } + int n = 0; + while (sleeper.wakeups < checkedWakeups) { + sleep(50); + if ((n += 50) > 1000) { + sleeper.finish(100); + throw new Exception("Sleeper appears to be dead (" + + checkedWakeups + ")"); + } + } + if (sleeper.wakeups > checkedWakeups) { + sleeper.finish(100); + throw new Exception("Too many wakeups: Expected " + + checkedWakeups + + ", got " + sleeper.wakeups); + } + if (intr) { + n = 0; + // Interrupts can sometimes be delayed, so wait + while (!sleeper.gotInterrupt) { + sleep(50); + if ((n += 50) > 1000) { + sleeper.finish(100); + throw new Exception("Interrupt never delivered"); + } + } + sleeper.gotInterrupt = false; + } + System.err.println("Check " + checkedWakeups + + (intr ? " (intr " + n + ")" : "")); + } + + public static void main(String[] args) throws Exception { + + Selector sel = Selector.open(); + + // Wakeup before select + sel.wakeup(); + + Sleeper sleeper = new Sleeper(sel); + + sleeper.start(); + while (!sleeper.started) + sleep(50); + + check(sleeper, false); // 1 + + for (int i = 2; i < 5; i++) { + // Wakeup during select + sel.wakeup(); + check(sleeper, false); // 2 .. 4 + } + + // Double wakeup + synchronized (sleeper.gate) { + sel.wakeup(); + check(sleeper, false); // 5 + sel.wakeup(); + sel.wakeup(); + } + check(sleeper, false); // 6 + + // Interrupt + synchronized (sleeper.gate) { + sleeper.wantInterrupt = true; + sleeper.interrupt(); + check(sleeper, true); // 7 + } + + // Interrupt before select + while (sleeper.entries < 8) + Thread.yield(); + synchronized (sleeper.gate) { + sel.wakeup(); + check(sleeper, false); // 8 + sleeper.wantInterrupt = true; + sleeper.interrupt(); + sleep(50); + } + check(sleeper, true); // 9 + + // Close during select + while (sleeper.entries < 10) + Thread.yield(); + synchronized (sleeper.gate) { + sel.close(); + check(sleeper, false); // 10 + } + + if (sleeper.finish(200) == 0) + throw new Exception("Test failed"); + if (!sleeper.closed) + throw new Exception("Selector not closed"); + } + +} diff --git a/jdk/test/java/nio/channels/SocketChannel/AsyncCloseChannel.java b/jdk/test/java/nio/channels/SocketChannel/AsyncCloseChannel.java index eca929576cd..b14301dc706 100644 --- a/jdk/test/java/nio/channels/SocketChannel/AsyncCloseChannel.java +++ b/jdk/test/java/nio/channels/SocketChannel/AsyncCloseChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2006-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 @@ -22,7 +22,7 @@ */ /* @test - * @bug 6285901 + * @bug 6285901 6501089 * @summary Check no data is written to wrong socket channel during async closing. * @author Xueming Shen */ @@ -33,13 +33,13 @@ import java.nio.channels.*; import java.net.*; public class AsyncCloseChannel { - static boolean failed = false; - static boolean keepGoing = true; + static volatile boolean failed = false; + static volatile boolean keepGoing = true; + static int maxAcceptCount = 100; + static volatile int acceptCount = 0; static String host = "127.0.0.1"; - static int sensorPort = 3010; - static int targetPort = 3020; - static int maxAcceptCount = 1000; - static int acceptCount = 0; + static int sensorPort; + static int targetPort; public static void main(String args[]) throws Exception { if (System.getProperty("os.name").startsWith("Windows")) { @@ -48,11 +48,15 @@ public class AsyncCloseChannel { } Thread ss = new SensorServer(); ss.start(); Thread ts = new TargetServer(); ts.start(); + + sensorPort = ((ServerThread)ss).server.getLocalPort(); + targetPort = ((ServerThread)ts).server.getLocalPort(); + Thread sc = new SensorClient(); sc.start(); Thread tc = new TargetClient(); tc.start(); while(acceptCount < maxAcceptCount && !failed) { - Thread.yield(); + Thread.sleep(10); } keepGoing = false; try { @@ -66,11 +70,8 @@ public class AsyncCloseChannel { + acceptCount + "> times of accept!"); } - - static class SensorServer extends ThreadEx { + static class SensorServer extends ServerThread { public void runEx() throws Exception { - ServerSocket server; - server = new ServerSocket(sensorPort); while(keepGoing) { try { final Socket s = server.accept(); @@ -80,7 +81,7 @@ public class AsyncCloseChannel { int c = s.getInputStream().read(); if(c != -1) { // No data is ever written to the peer's socket! - System.out.println("Oops: read a character: " + System.err.println("Oops: read a character: " + (char) c); failed = true; } @@ -92,17 +93,14 @@ public class AsyncCloseChannel { } }.start(); } catch (IOException ex) { - //ex.printStackTrace(); + System.err.println("Exception on sensor server " + ex.getMessage()); } } } } - static class TargetServer extends ThreadEx { + static class TargetServer extends ServerThread { public void runEx() throws Exception { - - ServerSocket server; - server = new ServerSocket(targetPort); while (keepGoing) { try { final Socket s = server.accept(); @@ -127,7 +125,7 @@ public class AsyncCloseChannel { } }.start(); } catch (IOException ex) { - //ex.printStackTrace(); + System.err.println("Exception on target server " + ex.getMessage()); } } } @@ -142,19 +140,19 @@ public class AsyncCloseChannel { try { s = new Socket(); synchronized(this) { - while(!wake) { + while(!wake && keepGoing) { try { wait(); } catch (InterruptedException ex) { } } + wake = false; } - wake = false; s.connect(new InetSocketAddress(host, sensorPort)); try { Thread.sleep(10); } catch (InterruptedException ex) { } } catch (IOException ex) { - System.out.println("Exception on sensor client " + ex.getMessage()); + System.err.println("Exception on sensor client " + ex.getMessage()); } finally { if(s != null) { try { @@ -200,26 +198,49 @@ public class AsyncCloseChannel { } } catch (IOException ex) { if(!(ex instanceof ClosedChannelException)) - System.out.println("Exception in target client child " + System.err.println("Exception in target client child " + ex.toString()); } } }; t.start(); - while(!ready) - Thread.yield(); + while(!ready && keepGoing) { + try { + Thread.sleep(10); + } catch (InterruptedException ex) {} + } s.close(); SensorClient.wakeMe(); t.join(); } catch (IOException ex) { - System.out.println("Exception in target client parent " + System.err.println("Exception in target client parent " + ex.getMessage()); } catch (InterruptedException ex) {} } } } - static abstract class ThreadEx extends Thread { + static abstract class ServerThread extends Thread { + ServerSocket server; + public ServerThread() { + super(); + try { + server = new ServerSocket(0); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + + public void interrupt() { + super.interrupt(); + if (server != null) { + try { + server.close(); + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } public void run() { try { runEx(); @@ -231,7 +252,6 @@ public class AsyncCloseChannel { abstract void runEx() throws Exception; } - public static void closeIt(Socket s) { try { if(s != null) diff --git a/jdk/test/java/nio/channels/TestUtil.java b/jdk/test/java/nio/channels/TestUtil.java index 94dcb997694..63e8537eadf 100644 --- a/jdk/test/java/nio/channels/TestUtil.java +++ b/jdk/test/java/nio/channels/TestUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java b/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java index f91916430fb..d73706abe07 100644 --- a/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java +++ b/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java index b5aa5360317..edf78919129 100644 --- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java +++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails_Stub.java b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails_Stub.java index 5c1047f7860..1148f549357 100644 --- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails_Stub.java +++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateMe.java b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateMe.java index 92d7df3faf6..95b3cbd0241 100644 --- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateMe.java +++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateMe.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ShutdownThread.java b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ShutdownThread.java index a902289234b..82b973f51d1 100644 --- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ShutdownThread.java +++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ShutdownThread.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java index a60a6b2f99e..3082ab424c1 100644 --- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java +++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup_Stub.java b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup_Stub.java index 0ce899c6f08..e6eca0332cb 100644 --- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup_Stub.java +++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/MyActivationGroupImpl.java b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/MyActivationGroupImpl.java index f4392af2fcf..bd3a130e7b6 100644 --- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/MyActivationGroupImpl.java +++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/MyActivationGroupImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java b/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java index eed889c0e38..9e26a24d27a 100644 --- a/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java +++ b/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java b/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java index 589b93bb6c0..23f8248a418 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ActivateMe.java b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ActivateMe.java index c6a55411edd..0cf0be6b442 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ActivateMe.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ActivateMe.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java index 3f9ef2b2fe6..9273d39f1b4 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor_Stub.java b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor_Stub.java index d7f9080c278..e0ac40adfd4 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor_Stub.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/CanCreateStubs.java b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/CanCreateStubs.java index 7ee66f59c95..cad4274b624 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/CanCreateStubs.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/CanCreateStubs.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java index 8b47547f8a0..ab312dcf6f8 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted_Stub.java b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted_Stub.java index a8cb2d81f5f..1ec8c5ba1bd 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted_Stub.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/ActivateMe.java b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/ActivateMe.java index d9848e3c815..16b268975f1 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/ActivateMe.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/ActivateMe.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/CallbackInterface.java b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/CallbackInterface.java index e737ac91603..b6d08de7680 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/CallbackInterface.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/CallbackInterface.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/Callback_Stub.java b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/Callback_Stub.java index 4e8a85d759b..c9ca5ebac8b 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/Callback_Stub.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/Callback_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java index 605b66b1ec8..141d92be50d 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup_Stub.java b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup_Stub.java index e9a5bcfb141..9418ad279a6 100644 --- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup_Stub.java +++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/dgc/VMID/CheckVMID.java b/jdk/test/java/rmi/dgc/VMID/CheckVMID.java index 09e4cbec91e..75484c0534e 100644 --- a/jdk/test/java/rmi/dgc/VMID/CheckVMID.java +++ b/jdk/test/java/rmi/dgc/VMID/CheckVMID.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java index 2a0e4309be2..b727ffa903e 100644 --- a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java +++ b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure_Stub.java b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure_Stub.java index b5819050111..793c208aaff 100644 --- a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure_Stub.java +++ b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java b/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java index 3f06432f352..0c48d53fa58 100644 --- a/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java +++ b/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation_Stub.java b/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation_Stub.java index b73581aa1de..db0f31951e5 100644 --- a/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation_Stub.java +++ b/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java b/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java index b74931a0943..5fe6b64abaa 100644 --- a/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java +++ b/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls_Stub.java b/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls_Stub.java index f35e8dccbef..85dc0548cbc 100644 --- a/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls_Stub.java +++ b/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java index 4263351b2fb..8e9a188825f 100644 --- a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java +++ b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/altSecurityManager/TestSecurityManager.java b/jdk/test/java/rmi/registry/altSecurityManager/TestSecurityManager.java index 5d9e16253d0..df818e0dd59 100644 --- a/jdk/test/java/rmi/registry/altSecurityManager/TestSecurityManager.java +++ b/jdk/test/java/rmi/registry/altSecurityManager/TestSecurityManager.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/checkusage/CheckUsage.java b/jdk/test/java/rmi/registry/checkusage/CheckUsage.java index 37556efb820..81469a665ba 100644 --- a/jdk/test/java/rmi/registry/checkusage/CheckUsage.java +++ b/jdk/test/java/rmi/registry/checkusage/CheckUsage.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java b/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java index ad7ba02d35d..7d501f8a4bf 100644 --- a/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java +++ b/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/classPathCodebase/Dummy.java b/jdk/test/java/rmi/registry/classPathCodebase/Dummy.java index ad40244578a..1680a2eea42 100644 --- a/jdk/test/java/rmi/registry/classPathCodebase/Dummy.java +++ b/jdk/test/java/rmi/registry/classPathCodebase/Dummy.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/registry/emptyName/EmptyName.java b/jdk/test/java/rmi/registry/emptyName/EmptyName.java index 7507dc7fa63..9231bd250f0 100644 --- a/jdk/test/java/rmi/registry/emptyName/EmptyName.java +++ b/jdk/test/java/rmi/registry/emptyName/EmptyName.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java b/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java index 8ab80dd26f3..4f1a0c56514 100644 --- a/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java +++ b/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/registry/interfaceHash/ReferenceRegistryStub.java b/jdk/test/java/rmi/registry/interfaceHash/ReferenceRegistryStub.java index 9db88da5939..6abfc24c4c8 100644 --- a/jdk/test/java/rmi/registry/interfaceHash/ReferenceRegistryStub.java +++ b/jdk/test/java/rmi/registry/interfaceHash/ReferenceRegistryStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java b/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java index 8bca932dda3..141954a0069 100644 --- a/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java +++ b/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/registry/reexport/Reexport.java b/jdk/test/java/rmi/registry/reexport/Reexport.java index 5c88736d4f0..d47e41553ef 100644 --- a/jdk/test/java/rmi/registry/reexport/Reexport.java +++ b/jdk/test/java/rmi/registry/reexport/Reexport.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServer.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServer.java index a57d614e94a..d36b37cb0ea 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServer.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServerImpl.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServerImpl.java index a0133f523d9..1c7c50e516a 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServerImpl.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BenchServerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanArrayCalls.java index a9005d980e0..6e896fdd1d3 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanCalls.java index 52d2810b79e..f4f6db2515a 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/BooleanCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteArrayCalls.java index d0401315c48..63ab2e89198 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteCalls.java index 8368c2ea0ee..94346208127 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ByteCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharArrayCalls.java index 65903070436..204388a4094 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharCalls.java index eeeb836be4a..9ecd73cdbbe 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/CharCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ClassLoading.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ClassLoading.java index e6451c36ef3..58fe4d02645 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ClassLoading.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ClassLoading.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleArrayCalls.java index 44f12010e94..faead2c307b 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleCalls.java index c847391f666..80b61448c58 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/DoubleCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExceptionCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExceptionCalls.java index f7f521ae357..a4337fcf676 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExceptionCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExceptionCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExportObjs.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExportObjs.java index 72071177abf..f2e280cc1ca 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExportObjs.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ExportObjs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatArrayCalls.java index d044f06ebbe..bac5fcbff06 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatCalls.java index 564a81c1c6b..b41dbb01531 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/FloatCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntArrayCalls.java index f8897639ea9..d3143226476 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntCalls.java index e1777c3ac24..d47b7c7dd3d 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/IntCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongArrayCalls.java index 15cbeb799f5..cd57bcda549 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongCalls.java index 109ec952609..24b69cbcc5e 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/LongCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java index 3e06a8887d3..af8e3864245 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/NullCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/NullCalls.java index 0616f2e97f3..bcc7f91a666 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/NullCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/NullCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjArrayCalls.java index 3fa66cdbc1c..3ae1ff50350 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjTreeCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjTreeCalls.java index 02a9f066f80..35dac2ffdc8 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjTreeCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ObjTreeCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ProxyArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ProxyArrayCalls.java index 7242a4f31a8..5a6e42b839a 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ProxyArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ProxyArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/RemoteObjArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/RemoteObjArrayCalls.java index 5bf6a3b929a..96637a756f7 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/RemoteObjArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/RemoteObjArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortArrayCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortArrayCalls.java index 91589b8d401..9f62745875d 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortArrayCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortArrayCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortCalls.java index 2ba8e0f3acc..e9c29c21987 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/ShortCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/SmallObjTreeCalls.java b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/SmallObjTreeCalls.java index a43defb5234..679f47f704f 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/rmi/SmallObjTreeCalls.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/rmi/SmallObjTreeCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/BooleanArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/BooleanArrays.java index 5e6ff7656aa..1f852b49c58 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/BooleanArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/BooleanArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Booleans.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Booleans.java index abf8ef8c5e8..485ab9cf674 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Booleans.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Booleans.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ByteArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ByteArrays.java index b300e8af79b..9c7fc8f6e41 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ByteArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ByteArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Bytes.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Bytes.java index 31d6465c30c..7069b8fed66 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Bytes.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Bytes.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CharArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CharArrays.java index a9b1353b06f..2cca3d24d87 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CharArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CharArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Chars.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Chars.java index 1ee2c88ed6e..7104665eef1 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Chars.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Chars.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ClassDesc.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ClassDesc.java index a7ad155ceb0..f755af7bd3a 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ClassDesc.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ClassDesc.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Cons.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Cons.java index 99d58c05472..5b8ec511762 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Cons.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Cons.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomDefaultObjTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomDefaultObjTrees.java index 14ddbee4f82..ebb52d6cbc0 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomDefaultObjTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomDefaultObjTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomObjTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomObjTrees.java index d5f10a8738c..90e472dbc6b 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomObjTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/CustomObjTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/DoubleArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/DoubleArrays.java index f216ebab694..52ced9bdf05 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/DoubleArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/DoubleArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Doubles.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Doubles.java index e43df322c27..212bcde254f 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Doubles.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Doubles.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ExternObjTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ExternObjTrees.java index bb9053a787d..06c9de1d96c 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ExternObjTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ExternObjTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/FloatArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/FloatArrays.java index 8feae044d55..382fe7b7d79 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/FloatArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/FloatArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Floats.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Floats.java index 1dca696a6a4..8bd6048b6a9 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Floats.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Floats.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/GetPutFieldTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/GetPutFieldTrees.java index c5794f05bad..87d3b1376c3 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/GetPutFieldTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/GetPutFieldTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/IntArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/IntArrays.java index c50059bb6c3..c846f7e664f 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/IntArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/IntArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Ints.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Ints.java index 90cfb30216f..dd9f36b51fe 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Ints.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Ints.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/LongArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/LongArrays.java index 802bb82cf9a..bbb25611984 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/LongArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/LongArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Longs.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Longs.java index fdc1e04e647..706af604f62 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Longs.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Longs.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java index 49e8e813f6e..072a61aaa24 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Main.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjArrays.java index b9b1ec5fb7a..a88fd224374 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjTrees.java index f9405ba1d9c..316139c8bba 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ObjTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyArrays.java index c6ad86dd50e..f20f3827009 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyClassDesc.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyClassDesc.java index 4a0576361a2..7f809e931bc 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyClassDesc.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ProxyClassDesc.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/RepeatObjs.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/RepeatObjs.java index 08ae15908ef..3d8084a37c9 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/RepeatObjs.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/RepeatObjs.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ReplaceTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ReplaceTrees.java index e117453bd9b..bc80bfe4559 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ReplaceTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ReplaceTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ShortArrays.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ShortArrays.java index 45339999c5b..460942edb94 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/ShortArrays.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/ShortArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Shorts.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Shorts.java index dafdf53c9f3..1d16579b832 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Shorts.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Shorts.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/SmallObjTrees.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/SmallObjTrees.java index bb0394f3986..a079d8de62e 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/SmallObjTrees.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/SmallObjTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/StreamBuffer.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/StreamBuffer.java index 33efee8724b..8a8f86baeac 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/StreamBuffer.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/StreamBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Strings.java b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Strings.java index 512e1a33de4..6faff8fdd4a 100644 --- a/jdk/test/java/rmi/reliability/benchmark/bench/serial/Strings.java +++ b/jdk/test/java/rmi/reliability/benchmark/bench/serial/Strings.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/reliability/juicer/Apple.java b/jdk/test/java/rmi/reliability/juicer/Apple.java index f1b6b640351..ce04dee13d8 100644 --- a/jdk/test/java/rmi/reliability/juicer/Apple.java +++ b/jdk/test/java/rmi/reliability/juicer/Apple.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/AppleEvent.java b/jdk/test/java/rmi/reliability/juicer/AppleEvent.java index c76a6fd271e..a845d42d294 100644 --- a/jdk/test/java/rmi/reliability/juicer/AppleEvent.java +++ b/jdk/test/java/rmi/reliability/juicer/AppleEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/AppleImpl.java b/jdk/test/java/rmi/reliability/juicer/AppleImpl.java index f1f1c3ee94f..b31dd2e0a8d 100644 --- a/jdk/test/java/rmi/reliability/juicer/AppleImpl.java +++ b/jdk/test/java/rmi/reliability/juicer/AppleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/AppleUser.java b/jdk/test/java/rmi/reliability/juicer/AppleUser.java index be86b053b12..ec0f8b621ee 100644 --- a/jdk/test/java/rmi/reliability/juicer/AppleUser.java +++ b/jdk/test/java/rmi/reliability/juicer/AppleUser.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java b/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java index d2f8b681f5b..cc64a57557b 100644 --- a/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java +++ b/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/ApplicationServer.java b/jdk/test/java/rmi/reliability/juicer/ApplicationServer.java index e17528af81b..c4f01a370f6 100644 --- a/jdk/test/java/rmi/reliability/juicer/ApplicationServer.java +++ b/jdk/test/java/rmi/reliability/juicer/ApplicationServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/Orange.java b/jdk/test/java/rmi/reliability/juicer/Orange.java index 40e670a7ee5..c358ca5b7dd 100644 --- a/jdk/test/java/rmi/reliability/juicer/Orange.java +++ b/jdk/test/java/rmi/reliability/juicer/Orange.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/OrangeEcho.java b/jdk/test/java/rmi/reliability/juicer/OrangeEcho.java index 8077afad8bf..203bc69210a 100644 --- a/jdk/test/java/rmi/reliability/juicer/OrangeEcho.java +++ b/jdk/test/java/rmi/reliability/juicer/OrangeEcho.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/OrangeEchoImpl.java b/jdk/test/java/rmi/reliability/juicer/OrangeEchoImpl.java index 5472138bd31..270ff743639 100644 --- a/jdk/test/java/rmi/reliability/juicer/OrangeEchoImpl.java +++ b/jdk/test/java/rmi/reliability/juicer/OrangeEchoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/reliability/juicer/OrangeImpl.java b/jdk/test/java/rmi/reliability/juicer/OrangeImpl.java index 9643ca52fea..d4f681a2723 100644 --- a/jdk/test/java/rmi/reliability/juicer/OrangeImpl.java +++ b/jdk/test/java/rmi/reliability/juicer/OrangeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressConstants.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressConstants.java index cc7526077d8..e2fbf470dd1 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressConstants.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressInputStream.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressInputStream.java index 31577a1c2ad..a0be6e0fad6 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressInputStream.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressOutputStream.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressOutputStream.java index 5d38e147b18..39118af8267 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressOutputStream.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/CompressOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/Echo.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/Echo.java index 074781b2559..2be704b31de 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/Echo.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/Echo.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl.java index 7b334fe0375..be133e34f3a 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl_Stub.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl_Stub.java index 134446486fd..0e85e0a2b82 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl_Stub.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/EchoImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/MultiSocketFactory.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/MultiSocketFactory.java index 9ebfa3236e0..81e03e2d187 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/MultiSocketFactory.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/MultiSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java index b3e7a77b99b..cebd38942e1 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Compress.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Compress.java index 88057b954a0..bd957ea7601 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Compress.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Compress.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Hello.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Hello.java index 347dd9cc8e3..727c89a7c84 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Hello.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/Hello.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl.java index 13f74488a6c..716dc51c112 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl_Stub.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl_Stub.java index a2858f1ece8..8bd94735ef8 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl_Stub.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/HelloImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java index 3bce0037a8a..c2f928b831a 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressConstants.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressConstants.java index cc7526077d8..e2fbf470dd1 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressConstants.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressInputStream.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressInputStream.java index 31577a1c2ad..a0be6e0fad6 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressInputStream.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressOutputStream.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressOutputStream.java index 5d38e147b18..39118af8267 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressOutputStream.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/CompressOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/Echo.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/Echo.java index 03441f25a50..88992f960b4 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/Echo.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/Echo.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.java index c156ff903e9..bbed5475713 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl_Stub.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl_Stub.java index 05e866e61d9..666d26ace27 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl_Stub.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/EchoImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/MultiSocketFactory.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/MultiSocketFactory.java index 9ebfa3236e0..81e03e2d187 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/MultiSocketFactory.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/MultiSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java index f1b01f9b7c6..e28a0a6b2fc 100644 --- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java +++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java b/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java index 5d191fe67a6..8b55d0e5add 100644 --- a/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java +++ b/jdk/test/java/rmi/server/RemoteServer/setLogPermission/SetLogPermission.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java b/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java index 436d70a4051..8d4ac6349ee 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName_Stub.java index f42eda7d419..a81a07105a3 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java index 9ea571a41c6..e558d88c59a 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall_Stub.java index 9583f53546b..3389fe49713 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/Shutdown.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/Shutdown.java index 4dadbe51b2e..7b8c3c56b66 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/Shutdown.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/Shutdown.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl.java index 32c0c118b25..8f4b9f53b40 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl_Stub.java index 97c62ca33f8..8fb1ed3fa5b 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownMonitor.java b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownMonitor.java index 29f630b1fe0..ffca458a673 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownMonitor.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/ShutdownMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java index 0fb37c62209..685cc875be8 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java index 7e8d3592872..e614041539c 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2_Stub.java index bbefd5248aa..51e0c750721 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2002-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport_Stub.java index 535fffa00e1..1b83c3432f3 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/Ping.java b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/Ping.java index 682915cfcf2..37eb1c21d5b 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/Ping.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/Ping.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java index de1cef78188..085bd98168d 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak_Stub.java index 56102aa54fe..52a561bdfcf 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies.java b/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies.java index 62b0ae9339b..28764a0942e 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies_Stub.java b/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies_Stub.java index b567c29ebd6..b8570dd34c1 100644 --- a/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies_Stub.java +++ b/jdk/test/java/rmi/server/UnicastRemoteObject/useDynamicProxies/UseDynamicProxies_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 diff --git a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java index a12af61e4d7..fe5006117a2 100644 --- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java +++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread_Stub.java b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread_Stub.java index 612fe5db494..2753d6eac01 100644 --- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread_Stub.java +++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java index 327081c9d8a..770388770fb 100644 --- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java +++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/PoisonPill.java b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/PoisonPill.java index 3c885926c1f..c657b2f1bc6 100644 --- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/PoisonPill.java +++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/PoisonPill.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/RuntimeExceptionParameter.java b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/RuntimeExceptionParameter.java index 8d8f5e94c17..3c1636aa2cc 100644 --- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/RuntimeExceptionParameter.java +++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/RuntimeExceptionParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java b/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java index 05f30142bee..87416c6a984 100644 --- a/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java +++ b/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency_Stub.java b/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency_Stub.java index 97c275b4fd0..fdc6f12f3f8 100644 --- a/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency_Stub.java +++ b/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java index 6687b9202a8..5f3403f5b9a 100644 --- a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java +++ b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval_Stub.java b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval_Stub.java index 950e30982a3..f351b1172d6 100644 --- a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval_Stub.java +++ b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/SelfTerminator.java b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/SelfTerminator.java index 65e65f3e0b3..a1b84ad82c0 100644 --- a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/SelfTerminator.java +++ b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/SelfTerminator.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java b/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java index ea3a25d2945..f8db48a3b97 100644 --- a/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java +++ b/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2000-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet_Stub.java b/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet_Stub.java index 55189cad77a..41466745bf4 100644 --- a/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet_Stub.java +++ b/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java b/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java index eafb5e041a0..eeae2e36e5d 100644 --- a/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java +++ b/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext_Stub.java b/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext_Stub.java index 0e35db25c19..b24abffe786 100644 --- a/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext_Stub.java +++ b/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java b/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java index 02bb3d7f459..068c68aa331 100644 --- a/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java +++ b/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java index 00dadb2f338..4115cf77aa2 100644 --- a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java +++ b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDNClient.java b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDNClient.java index ef644b197be..d0f87244668 100644 --- a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDNClient.java +++ b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDNClient.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN_Stub.java b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN_Stub.java index 3c318cae946..c0ea6eb17d7 100644 --- a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN_Stub.java +++ b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkFQDN/TellServerName.java b/jdk/test/java/rmi/transport/checkFQDN/TellServerName.java index d5625c5cbdb..61632aa1b62 100644 --- a/jdk/test/java/rmi/transport/checkFQDN/TellServerName.java +++ b/jdk/test/java/rmi/transport/checkFQDN/TellServerName.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java index 94847ffc01e..e126e6c995e 100644 --- a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java +++ b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak_Stub.java b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak_Stub.java index 52b5d89a53a..f3dde3076ef 100644 --- a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak_Stub.java +++ b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeak.java b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeak.java index de412cda32e..d08368c5730 100644 --- a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeak.java +++ b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeakClient.java b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeakClient.java index b42f23d2e66..9bfff58da3e 100644 --- a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeakClient.java +++ b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/LeaseLeakClient.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java index 54ca8fd2a71..6a94319ae24 100644 --- a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java +++ b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java b/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java index 820d4c410dd..52fa270dd53 100644 --- a/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java +++ b/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/dgcDeadLock/Test.java b/jdk/test/java/rmi/transport/dgcDeadLock/Test.java index 5fcd90c3884..4fb2c4cf5f5 100644 --- a/jdk/test/java/rmi/transport/dgcDeadLock/Test.java +++ b/jdk/test/java/rmi/transport/dgcDeadLock/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl.java b/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl.java index 0f23ae73a0c..e5a68e25bd2 100644 --- a/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl.java +++ b/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl_Stub.java b/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl_Stub.java index f82df1fffbb..53cca3af7cf 100644 --- a/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl_Stub.java +++ b/jdk/test/java/rmi/transport/dgcDeadLock/TestImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1998-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 diff --git a/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java b/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java index e14de6adc57..28d0d7c962d 100644 --- a/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java +++ b/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java b/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java index c74c021b486..68879915c52 100644 --- a/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java +++ b/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java b/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java index 8fbba5460cd..1ca996b8bed 100644 --- a/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java +++ b/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest_Stub.java b/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest_Stub.java index a8b2e342441..60cc780ed56 100644 --- a/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest_Stub.java +++ b/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java b/jdk/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java index 8f1bd834b31..6e7bc8ec804 100644 --- a/jdk/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java +++ b/jdk/test/java/rmi/transport/pinClientSocketFactory/PinClientSocketFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/pinLastArguments/PinLastArguments.java b/jdk/test/java/rmi/transport/pinLastArguments/PinLastArguments.java index b85ad3a80c9..e4b162fac30 100644 --- a/jdk/test/java/rmi/transport/pinLastArguments/PinLastArguments.java +++ b/jdk/test/java/rmi/transport/pinLastArguments/PinLastArguments.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java b/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java index fa810c4437c..eea5ec4ee40 100644 --- a/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java +++ b/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java b/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java index 0bdd65d5bb8..823953a637c 100644 --- a/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java +++ b/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/readTimeout/TestIface.java b/jdk/test/java/rmi/transport/readTimeout/TestIface.java index a7096a0b2ca..015389767c5 100644 --- a/jdk/test/java/rmi/transport/readTimeout/TestIface.java +++ b/jdk/test/java/rmi/transport/readTimeout/TestIface.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/readTimeout/TestImpl.java b/jdk/test/java/rmi/transport/readTimeout/TestImpl.java index 3fc6af8b29a..c6441681d2f 100644 --- a/jdk/test/java/rmi/transport/readTimeout/TestImpl.java +++ b/jdk/test/java/rmi/transport/readTimeout/TestImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/readTimeout/TestImpl_Stub.java b/jdk/test/java/rmi/transport/readTimeout/TestImpl_Stub.java index 223ce7915c5..8720e940054 100644 --- a/jdk/test/java/rmi/transport/readTimeout/TestImpl_Stub.java +++ b/jdk/test/java/rmi/transport/readTimeout/TestImpl_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 1999-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 diff --git a/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java b/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java index cf386280945..f220a41de70 100644 --- a/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java +++ b/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java b/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java index 245942ddcd7..ceb7cb18f46 100644 --- a/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java +++ b/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak_Stub.java b/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak_Stub.java index bc17d11e8db..d67a147e042 100644 --- a/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak_Stub.java +++ b/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak_Stub.java @@ -1,5 +1,5 @@ /* - * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2001-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 diff --git a/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java new file mode 100644 index 00000000000..0ec0be61cc9 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/BuildEEBasicConstraints.java @@ -0,0 +1,79 @@ +/* + * Copyright 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. + * + * 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 6714842 + * @library ../../../testlibrary + * @build CertUtils + * @run main BuildEEBasicConstraints + * @summary make sure a PKIX CertPathBuilder builds a path to an + * end entity certificate when the setBasicConstraints method of the + * X509CertSelector of the targetConstraints PKIXBuilderParameters + * parameter is set to -2. + */ + +import java.security.cert.Certificate; +import java.security.cert.CertPath; +import java.security.cert.CertStore; +import java.security.cert.CollectionCertStoreParameters; +import java.security.cert.PKIXBuilderParameters; +import java.security.cert.PKIXCertPathBuilderResult; +import java.security.cert.TrustAnchor; +import java.security.cert.X509Certificate; +import java.security.cert.X509CertSelector; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public final class BuildEEBasicConstraints { + + public static void main(String[] args) throws Exception { + + X509Certificate rootCert = CertUtils.getCertFromFile("anchor.cer"); + TrustAnchor anchor = new TrustAnchor + (rootCert.getSubjectX500Principal(), rootCert.getPublicKey(), null); + X509CertSelector sel = new X509CertSelector(); + sel.setBasicConstraints(-2); + PKIXBuilderParameters params = new PKIXBuilderParameters + (Collections.singleton(anchor), sel); + params.setRevocationEnabled(false); + X509Certificate eeCert = CertUtils.getCertFromFile("ee.cer"); + X509Certificate caCert = CertUtils.getCertFromFile("ca.cer"); + ArrayList certs = new ArrayList(); + certs.add(caCert); + certs.add(eeCert); + CollectionCertStoreParameters ccsp = + new CollectionCertStoreParameters(certs); + CertStore cs = CertStore.getInstance("Collection", ccsp); + params.addCertStore(cs); + PKIXCertPathBuilderResult res = CertUtils.build(params); + CertPath cp = res.getCertPath(); + // check that first certificate is an EE cert + List certList = cp.getCertificates(); + X509Certificate cert = (X509Certificate) certList.get(0); + if (cert.getBasicConstraints() != -1) { + throw new Exception("Target certificate is not an EE certificate"); + } + } +} diff --git a/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/anchor.cer b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/anchor.cer new file mode 100644 index 00000000000..bfb5d5847b4 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/anchor.cer @@ -0,0 +1,8 @@ +-----BEGIN CERTIFICATE----- +MIIBFzCBwgIBATANBgkqhkiG9w0BAQQFADAXMRUwEwYDVQQDEwxUcnVzdCBBbmNo +b3IwHhcNMDIxMTA3MTE1NzAzWhcNMjIxMTA3MTE1NzAzWjAXMRUwEwYDVQQDEwxU +cnVzdCBBbmNob3IwXDANBgkqhkiG9w0BAQEFAANLADBIAkEA9uCj12hwDgC1n9go +0ozQAVMM+DfX0vpKOemyGNp+ycSLfAq3pxBcUKbQhjSRL7YjPkEL8XC6pRLwyEoF +osWweQIDAQABMA0GCSqGSIb3DQEBBAUAA0EAzZta5M1qbbozj7jWnNyTgB4HUpzv +4eP0VYQb1pQY1/xEMczaRt+RuoIDnHCq5a1vOiwk6ZbdG6GlJKx9lj0oMQ== +-----END CERTIFICATE----- diff --git a/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ca.cer b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ca.cer new file mode 100644 index 00000000000..26ffb68c1e0 --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ca.cer @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBSjCB9aADAgECAgECMA0GCSqGSIb3DQEBBAUAMBcxFTATBgNVBAMTDFRydXN0 +IEFuY2hvcjAeFw0wMjExMDcxMTU3MDNaFw0yMjExMDcxMTU3MDNaMA0xCzAJBgNV +BAMTAkNBMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ8mP3x37PablDfwldGL5G0+ +l9NgMJSdxVNWBg+ySzQNsZklEFCxGfxPQW+EFYfafHbTbmnni2gsgU1mgPBTQDsC +AwEAAaM2MDQwCwYDVR0PBAQDAgIEMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADAM +BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA0EA9oCyzh0UKmNsKb+KpppbKYs8 +iA8sDm9oDCwyVSXBM46zrP38nRcx3EdKFvGTwbb/Np+lcZALUsKVYQy3rlU+cQ== +-----END CERTIFICATE----- diff --git a/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ee.cer b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ee.cer new file mode 100644 index 00000000000..f20c937ed6c --- /dev/null +++ b/jdk/test/java/security/cert/CertPathBuilder/targetConstraints/ee.cer @@ -0,0 +1,9 @@ +-----BEGIN CERTIFICATE----- +MIIBLTCB2KADAgECAgEDMA0GCSqGSIb3DQEBBAUAMA0xCzAJBgNVBAMTAkNBMB4X +DTAyMTEwNzExNTcwM1oXDTIyMTEwNzExNTcwM1owFTETMBEGA1UEAxMKRW5kIEVu +dGl0eTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDVBDfF+uBr5s5jzzDs1njKlZNt +h8hHzEt3ASh67Peos+QrDzgpUyFXT6fdW2h7iPf0ifjM8eW2xa+3EnPjjU5jAgMB +AAGjGzAZMBcGA1UdIAQQMA4wBgYEVR0gADAEBgIqADANBgkqhkiG9w0BAQQFAANB +AFo//WOboCNOCcA1fvcWW9oc4MvV8ZPvFIAbyEbgyFd4id5lGDTRbRPvvNZRvdsN +NM2gXYr+f87NHIXc9EF3pzw= +-----END CERTIFICATE----- diff --git a/jdk/test/java/util/Currency/ValidateISO4217.java b/jdk/test/java/util/Currency/ValidateISO4217.java index 0e7e7d15462..ed1f2bc259d 100644 --- a/jdk/test/java/util/Currency/ValidateISO4217.java +++ b/jdk/test/java/util/Currency/ValidateISO4217.java @@ -90,7 +90,7 @@ public class ValidateISO4217 { /* Codes that are obsolete, do not have related country */ static final String otherCodes = - "ADP-AFA-ATS-AYM-BEF-BGL-BOV-BYB-CLF-DEM-ESP-FIM-FRF-GRD-GWP-IEP-ITL-LUF-MGF-MXV-NLG-PTE-RUR-SDD-SIT-SRG-TPE-TRL-VEF-USN-USS-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XTS-XXX-YUM-ZWN"; + "ADP-AFA-ATS-AYM-BEF-BGL-BOV-BYB-CLF-CYP-DEM-ESP-FIM-FRF-GRD-GWP-IEP-ITL-LUF-MGF-MTL-MXV-NLG-PTE-RUR-SDD-SIT-SRG-TPE-TRL-VEF-USN-USS-XAG-XAU-XBA-XBB-XBC-XBD-XDR-XFO-XFU-XPD-XPT-XTS-XXX-YUM-ZWN"; static boolean err = false; diff --git a/jdk/test/java/util/Currency/tablea1.txt b/jdk/test/java/util/Currency/tablea1.txt index cd2601101cf..69684358b9c 100644 --- a/jdk/test/java/util/Currency/tablea1.txt +++ b/jdk/test/java/util/Currency/tablea1.txt @@ -1,12 +1,12 @@ # # -# Based on BSi's ISO4217 data - "TABLE A1.doc" + amendments up until MA139.doc -# (As of 18 June 2007) +# Based on BSi's ISO4217 data - "TABLE A1.doc" + amendments up until MA140.doc +# (As of 24 September 2007) # # Version FILEVERSION=1 -DATAVERSION=139 +DATAVERSION=140 # ISO 4217 currency data AF AFN 971 2 @@ -68,7 +68,7 @@ CR CRC 188 2 CI XOF 952 0 HR HRK 191 2 CU CUP 192 2 -CY CYP 196 2 +CY EUR 978 2 CZ CZK 203 2 DK DKK 208 2 DJ DJF 262 0 @@ -149,7 +149,7 @@ MW MWK 454 2 MY MYR 458 2 MV MVR 462 2 ML XOF 952 0 -MT MTL 470 2 +MT EUR 978 2 MH USD 840 2 MQ EUR 978 2 MR MRO 478 2 diff --git a/jdk/test/java/util/concurrent/LinkedBlockingQueue/OfferRemoveLoops.java b/jdk/test/java/util/concurrent/LinkedBlockingQueue/OfferRemoveLoops.java index baca8f1b0f1..e66dfb7042d 100644 --- a/jdk/test/java/util/concurrent/LinkedBlockingQueue/OfferRemoveLoops.java +++ b/jdk/test/java/util/concurrent/LinkedBlockingQueue/OfferRemoveLoops.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/java/util/concurrent/SynchronousQueue/Fairness.java b/jdk/test/java/util/concurrent/SynchronousQueue/Fairness.java index 5adb71d99f7..f29a40df753 100644 --- a/jdk/test/java/util/concurrent/SynchronousQueue/Fairness.java +++ b/jdk/test/java/util/concurrent/SynchronousQueue/Fairness.java @@ -1,5 +1,5 @@ /* - * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2004-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 diff --git a/jdk/test/javax/management/Introspector/AnnotatedMBeanTest.java b/jdk/test/javax/management/Introspector/AnnotatedMBeanTest.java new file mode 100644 index 00000000000..b0782d39c85 --- /dev/null +++ b/jdk/test/javax/management/Introspector/AnnotatedMBeanTest.java @@ -0,0 +1,337 @@ +/* + * 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 %M% %I% + * @bug 6323980 + * @summary Test MBeans defined with @MBean + * @author Eamonn McManus + * @run main/othervm -ea AnnotatedMBeanTest + */ + +import java.io.File; +import java.io.PrintWriter; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import javax.management.Attribute; +import javax.management.Descriptor; +import javax.management.DescriptorKey; +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanInfo; +import javax.management.MBeanOperationInfo; +import javax.management.MBeanParameterInfo; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.MXBean; +import javax.management.MalformedObjectNameException; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; +import javax.management.MBean; +import javax.management.ObjectName; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.CompositeType; + +public class AnnotatedMBeanTest { + private static MBeanServer mbs; + private static final ObjectName objectName; + static { + try { + objectName = new ObjectName("test:type=Test"); + } catch (MalformedObjectNameException e) { + throw new RuntimeException(e); + } + } + + public static void main(String[] args) throws Exception { + if (!AnnotatedMBeanTest.class.desiredAssertionStatus()) + throw new Exception("Test must be run with -ea"); + + File policyFile = File.createTempFile("jmxperms", ".policy"); + policyFile.deleteOnExit(); + PrintWriter pw = new PrintWriter(policyFile); + pw.println("grant {"); + pw.println(" permission javax.management.MBeanPermission \"*\", \"*\";"); + pw.println(" permission javax.management.MBeanServerPermission \"*\";"); + pw.println(" permission javax.management.MBeanTrustPermission \"*\";"); + pw.println("};"); + pw.close(); + + System.setProperty("java.security.policy", policyFile.getAbsolutePath()); + System.setSecurityManager(new SecurityManager()); + + String failure = null; + + for (Method m : AnnotatedMBeanTest.class.getDeclaredMethods()) { + if (Modifier.isStatic(m.getModifiers()) && + m.getName().startsWith("test") && + m.getParameterTypes().length == 0) { + mbs = MBeanServerFactory.newMBeanServer(); + try { + m.invoke(null); + System.out.println(m.getName() + " OK"); + } catch (InvocationTargetException ite) { + System.out.println(m.getName() + " got exception:"); + Throwable t = ite.getCause(); + t.printStackTrace(System.out); + failure = m.getName() + ": " + t.toString(); + } + } + } + if (failure == null) + System.out.println("TEST PASSED"); + else + throw new Exception("TEST FAILED: " + failure); + } + + public static class Stats { + private final int used; + private final int size; + private final boolean interesting; + + public Stats(int used, int size, boolean interesting) { + this.used = used; + this.size = size; + this.interesting = interesting; + } + + public int getUsed() { + return used; + } + + public int getSize() { + return size; + } + + public boolean isInteresting() { + return interesting; + } + } + + @Retention(RetentionPolicy.RUNTIME) + public static @interface Units { + @DescriptorKey("units") + String value(); + } + + @MBean + public static class Cache { + private int used = 23; + private int size = 99; + + @ManagedAttribute + @Units("bytes") + public int getUsed() { + return used; + } + + @ManagedAttribute + public int getSize() { + return size; + } + + @ManagedAttribute + public void setSize(int x) { + this.size = x; + } + + @ManagedAttribute + public boolean isInteresting() { + return false; + } + + @ManagedAttribute + public Stats getStats() { + return new Stats(used, size, false); + } + + @ManagedOperation + public int dropOldest(int n) { + return 55; + } + + private void irrelevantMethod() {} + private int getIrrelevant() {return 0;} + public int getIrrelevant2() {return 0;} + + public int otherIrrelevantMethod() {return 5;} + } + + public static class SubCache extends Cache { + // SubCache does not have the @MBean annotation + // but its parent does. It doesn't add any @ManagedAttribute or + // @ManagedOperation methods, so its management interface + // should be the same. + private void irrelevantMethod2() {} + public int otherIrrelevantMethod3() {return 0;} + + public int getX() {return 0;} + public void setX(int x) {} + } + + @MXBean + public static class CacheMX { + private int used = 23; + private int size = 99; + + @ManagedAttribute + @Units("bytes") + public int getUsed() { + return used; + } + + @ManagedAttribute + public int getSize() { + return size; + } + + @ManagedAttribute + public void setSize(int x) { + this.size = x; + } + + @ManagedAttribute + public boolean isInteresting() { + return false; + } + + @ManagedAttribute + public Stats getStats() { + return new Stats(used, size, false); + } + + @ManagedOperation + public int dropOldest(int n) { + return 55; + } + + private void irrelevantMethod() {} + private int getIrrelevant() {return 0;} + public int getIrrelevant2() {return 0;} + + public int otherIrrelevantMethod() {return 5;} + } + + public static class SubCacheMX extends CacheMX { + private void irrelevantMethod2() {} + public int otherIrrelevantMethod3() {return 0;} + + public int getX() {return 0;} + public void setX(int x) {} + } + + private static void testSimpleManagedResource() throws Exception { + testResource(new Cache(), false); + } + + private static void testSubclassManagedResource() throws Exception { + testResource(new SubCache(), false); + } + + private static void testMXBeanResource() throws Exception { + testResource(new CacheMX(), true); + } + + private static void testSubclassMXBeanResource() throws Exception { + testResource(new SubCacheMX(), true); + } + + private static void testResource(Object resource, boolean mx) throws Exception { + mbs.registerMBean(resource, objectName); + + MBeanInfo mbi = mbs.getMBeanInfo(objectName); + assert mbi.getDescriptor().getFieldValue("mxbean").equals(Boolean.toString(mx)); + + MBeanAttributeInfo[] mbais = mbi.getAttributes(); + + assert mbais.length == 4: mbais.length; + + for (MBeanAttributeInfo mbai : mbais) { + String name = mbai.getName(); + if (name.equals("Used")) { + assert mbai.isReadable(); + assert !mbai.isWritable(); + assert !mbai.isIs(); + assert mbai.getType().equals("int"); + assert "bytes".equals(mbai.getDescriptor().getFieldValue("units")); + } else if (name.equals("Size")) { + assert mbai.isReadable(); + assert mbai.isWritable(); + assert !mbai.isIs(); + assert mbai.getType().equals("int"); + } else if (name.equals("Interesting")) { + assert mbai.isReadable(); + assert !mbai.isWritable(); + assert mbai.isIs(); + assert mbai.getType().equals("boolean"); + } else if (name.equals("Stats")) { + assert mbai.isReadable(); + assert !mbai.isWritable(); + assert !mbai.isIs(); + Descriptor d = mbai.getDescriptor(); + if (mx) { + assert mbai.getType().equals(CompositeData.class.getName()); + assert d.getFieldValue("originalType").equals(Stats.class.getName()); + CompositeType ct = (CompositeType) d.getFieldValue("openType"); + Set names = new HashSet( + Arrays.asList("used", "size", "interesting")); + assert ct.keySet().equals(names) : ct.keySet(); + } else { + assert mbai.getType().equals(Stats.class.getName()); + } + } else + assert false : name; + } + + MBeanOperationInfo[] mbois = mbi.getOperations(); + + assert mbois.length == 1: mbois.length; + + MBeanOperationInfo mboi = mbois[0]; + assert mboi.getName().equals("dropOldest"); + assert mboi.getReturnType().equals("int"); + MBeanParameterInfo[] mbpis = mboi.getSignature(); + assert mbpis.length == 1: mbpis.length; + assert mbpis[0].getType().equals("int"); + + assert mbs.getAttribute(objectName, "Used").equals(23); + + assert mbs.getAttribute(objectName, "Size").equals(99); + mbs.setAttribute(objectName, new Attribute("Size", 55)); + assert mbs.getAttribute(objectName, "Size").equals(55); + + assert mbs.getAttribute(objectName, "Interesting").equals(false); + + Object stats = mbs.getAttribute(objectName, "Stats"); + assert (mx ? CompositeData.class : Stats.class).isInstance(stats) : stats.getClass(); + + int ret = (Integer) mbs.invoke( + objectName, "dropOldest", new Object[] {66}, new String[] {"int"}); + assert ret == 55; + } +} diff --git a/jdk/test/javax/management/Introspector/AnnotatedNotificationInfoTest.java b/jdk/test/javax/management/Introspector/AnnotatedNotificationInfoTest.java new file mode 100644 index 00000000000..bc6a335dfbe --- /dev/null +++ b/jdk/test/javax/management/Introspector/AnnotatedNotificationInfoTest.java @@ -0,0 +1,271 @@ +/* + * 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 %M% %I% + * @bug 6323980 + * @summary Test @NotificationInfo annotation + * @author Eamonn McManus + * @run main/othervm -ea AnnotatedNotificationInfoTest + */ + +import java.io.Serializable; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Field; +import javax.annotation.Resource; +import javax.management.AttributeChangeNotification; +import javax.management.Description; +import javax.management.Descriptor; +import javax.management.ImmutableDescriptor; +import javax.management.MBean; +import javax.management.MBeanInfo; +import javax.management.MBeanNotificationInfo; +import javax.management.MBeanServer; +import javax.management.MXBean; +import javax.management.NotificationBroadcasterSupport; +import javax.management.NotificationInfo; +import javax.management.NotificationInfos; +import javax.management.ObjectName; +import javax.management.SendNotification; + +public class AnnotatedNotificationInfoTest { + // Data for the first test. This tests that MBeanNotificationInfo + // is correctly derived from @NotificationInfo. + // Every static field called mbean* is expected to be an MBean + // with a single MBeanNotificationInfo that has the same value + // in each case. + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static interface Intf1MBean {} + + public static class Intf1 + extends NotificationBroadcasterSupport implements Intf1MBean {} + + private static Object mbeanIntf1 = new Intf1(); + + @NotificationInfos( + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"})) + public static interface Intf2MBean {} + + public static class Intf2 + extends NotificationBroadcasterSupport implements Intf2MBean {} + + private static Object mbeanIntf2 = new Intf2(); + + @NotificationInfos({}) + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static interface Intf3MBean {} + + public static class Intf3 + extends NotificationBroadcasterSupport implements Intf3MBean {} + + private static Object mbeanIntf3 = new Intf3(); + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static interface ParentIntf {} + + public static interface Intf4MBean extends Serializable, ParentIntf, Cloneable {} + + public static class Intf4 + extends NotificationBroadcasterSupport implements Intf4MBean {} + + private static Object mbeanIntf4 = new Intf4(); + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static interface Intf5MXBean {} + + public static class Intf5Impl + extends NotificationBroadcasterSupport implements Intf5MXBean {} + + private static Object mbeanIntf5 = new Intf5Impl(); + + public static interface Impl1MBean {} + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static class Impl1 + extends NotificationBroadcasterSupport implements Impl1MBean {} + + private static Object mbeanImpl1 = new Impl1(); + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static class ParentImpl extends NotificationBroadcasterSupport {} + + public static interface Impl2MBean {} + + public static class Impl2 extends ParentImpl implements Impl2MBean {} + + private static Object mbeanImpl2 = new Impl2(); + + public static interface Impl3MXBean {} + + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static class Impl3 + extends NotificationBroadcasterSupport implements Impl3MXBean {} + + private static Object mbeanImpl3 = new Impl3(); + + public static class Impl4 extends ParentImpl implements Impl3MXBean {} + + private static Object mbeanImpl4 = new Impl4(); + + @MBean + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static class MBean1 extends NotificationBroadcasterSupport {} + + private static Object mbeanMBean1 = new MBean1(); + + @MBean + public static class MBean2 extends ParentImpl {} + + private static Object mbeanMBean2 = new MBean2(); + + // Following disabled until we support it +// @MBean +// @NotificationInfo( +// types = {"foo", "bar"}, +// notificationClass = AttributeChangeNotification.class, +// description = @Description( +// value = "description", +// bundleBaseName = "bundle", +// key = "key"), +// descriptorFields = {"foo=bar"}) +// public static class MBean3 { +// @Resource +// private volatile SendNotification send; +// } +// +// private static Object mbeanMBean3 = new MBean3(); + + @MXBean + @NotificationInfo( + types = {"foo", "bar"}, + notificationClass = AttributeChangeNotification.class, + description = @Description( + value = "description", + bundleBaseName = "bundle", + key = "key"), + descriptorFields = {"foo=bar"}) + public static class MXBean1 extends NotificationBroadcasterSupport {} + + private static Object mbeanMXBean1 = new MXBean1(); + + @MXBean + public static class MXBean2 extends ParentImpl {} + + private static Object mbeanMXBean2 = new MXBean2(); + + public static void main(String[] args) throws Exception { + if (!AnnotatedNotificationInfoTest.class.desiredAssertionStatus()) + throw new Exception("Test must be run with -ea"); + + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + ObjectName on = new ObjectName("a:b=c"); + + Descriptor expectedDescriptor = new ImmutableDescriptor( + "foo=bar", "descriptionResourceBundleBaseName=bundle", + "descriptionResourceKey=key"); + MBeanNotificationInfo expected = new MBeanNotificationInfo( + new String[] {"foo", "bar"}, + AttributeChangeNotification.class.getName(), + "description", + expectedDescriptor); + + System.out.println("Testing MBeans..."); + for (Field mbeanField : + AnnotatedNotificationInfoTest.class.getDeclaredFields()) { + if (!mbeanField.getName().startsWith("mbean")) + continue; + System.out.println("..." + mbeanField.getName()); + Object mbean = mbeanField.get(null); + mbs.registerMBean(mbean, on); + MBeanInfo mbi = mbs.getMBeanInfo(on); + MBeanNotificationInfo[] mbnis = mbi.getNotifications(); + assert mbnis.length == 1 : mbnis.length; + assert mbnis[0].equals(expected) : mbnis[0]; + mbs.unregisterMBean(on); + } + } +} diff --git a/jdk/test/javax/management/Introspector/MBeanDescriptionTest.java b/jdk/test/javax/management/Introspector/MBeanDescriptionTest.java new file mode 100644 index 00000000000..5fc77f9c119 --- /dev/null +++ b/jdk/test/javax/management/Introspector/MBeanDescriptionTest.java @@ -0,0 +1,830 @@ +/* + * 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 %M% %I% + * @bug 6323980 + * @summary Test @Description + * @author Eamonn McManus + */ + +import java.lang.management.ManagementFactory; +import javax.management.Description; +import javax.management.IntrospectionException; +import javax.management.MBean; +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanConstructorInfo; +import javax.management.MBeanFeatureInfo; +import javax.management.MBeanInfo; +import javax.management.MBeanOperationInfo; +import javax.management.MBeanParameterInfo; +import javax.management.MBeanServer; +import javax.management.MXBean; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; +import javax.management.NotCompliantMBeanException; +import javax.management.ObjectName; +import javax.management.StandardMBean; + +public class MBeanDescriptionTest { + private static String failure; + private static final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + private static final ObjectName name; + static { + try { + name = new ObjectName("a:b=c"); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static interface Interface { + @Description("A description") + public String getA(); + + @Description("B description") + public int getB(); + public void setB(int x); + + public boolean isC(); + @Description("C description") + public void setC(boolean x); + + @Description("D description") + public void setD(float x); + + @Description("H description") + public int getH(); + @Description("H description") + public void setH(int x); + + public String getE(); + + public int getF(); + public void setF(int x); + + public void setG(boolean x); + + @Description("opA description") + public int opA( + @Description("p1 description") + int p1, + @Description("p2 description") + int p2); + + public void opB(float x); + } + + @Description("MBean description") + public static interface TestMBean extends Interface {} + + public static class Test implements TestMBean { + @Description("0-arg constructor description") + public Test() {} + + public Test(String why) {} + + @Description("2-arg constructor description") + public Test( + @Description("p1 description") + int x, + @Description("p2 description") + String y) { + } + + public String getA() { + return null; + } + + public int getB() { + return 0; + } + + public void setB(int x) { + } + + public boolean isC() { + return false; + } + + public void setC(boolean x) { + } + + public void setD(float x) { + } + + public String getE() { + return null; + } + + public int getF() { + return 0; + } + + public void setF(int x) { + } + + public void setG(boolean x) { + } + + public int getH() { + return 0; + } + + public void setH(int x) { + } + + public int opA(int p1, int p2) { + return 0; + } + + public void opB(float x) { + } + } + + public static class TestSub extends Test { + @Description("0-arg constructor description") + public TestSub() {} + + public TestSub(String why) {} + + @Description("2-arg constructor description") + public TestSub( + @Description("p1 description") + int x, + @Description("p2 description") + String y) { + } + } + + public static class StandardSub extends StandardMBean implements TestMBean { + @Description("0-arg constructor description") + public StandardSub() { + super(TestMBean.class, false); + } + + public StandardSub(String why) { + super(TestMBean.class, false); + } + + @Description("2-arg constructor description") + public StandardSub( + @Description("p1 description") + int x, + @Description("p2 description") + String y) { + super(TestMBean.class, false); + } + + public String getA() { + return null; + } + + public int getB() { + return 0; + } + + public void setB(int x) { + } + + public boolean isC() { + return false; + } + + public void setC(boolean x) { + } + + public void setD(float x) { + } + + public String getE() { + return null; + } + + public int getF() { + return 0; + } + + public void setF(int x) { + } + + public void setG(boolean x) { + } + + public int opA(int p1, int p2) { + return 0; + } + + public void opB(float x) { + } + + public int getH() { + return 0; + } + + public void setH(int x) { + } + } + + @Description("MBean description") + public static interface TestMXBean extends Interface {} + + public static class TestMXBeanImpl implements TestMXBean { + @Description("0-arg constructor description") + public TestMXBeanImpl() {} + + public TestMXBeanImpl(String why) {} + + @Description("2-arg constructor description") + public TestMXBeanImpl( + @Description("p1 description") + int x, + @Description("p2 description") + String y) { + } + + public String getA() { + return null; + } + + public int getB() { + return 0; + } + + public void setB(int x) { + } + + public boolean isC() { + return false; + } + + public void setC(boolean x) { + } + + public void setD(float x) { + } + + public String getE() { + return null; + } + + public int getF() { + return 0; + } + + public void setF(int x) { + } + + public void setG(boolean x) { + } + + public int opA(int p1, int p2) { + return 0; + } + + public void opB(float x) { + } + + public int getH() { + return 0; + } + + public void setH(int x) { + } + } + + public static class StandardMXSub extends StandardMBean implements TestMXBean { + @Description("0-arg constructor description") + public StandardMXSub() { + super(TestMXBean.class, true); + } + + public StandardMXSub(String why) { + super(TestMXBean.class, true); + } + + @Description("2-arg constructor description") + public StandardMXSub( + @Description("p1 description") + int x, + @Description("p2 description") + String y) { + super(TestMXBean.class, true); + } + + public String getA() { + return null; + } + + public int getB() { + return 0; + } + + public void setB(int x) { + } + + public boolean isC() { + return false; + } + + public void setC(boolean x) { + } + + public void setD(float x) { + } + + public String getE() { + return null; + } + + public int getF() { + return 0; + } + + public void setF(int x) { + } + + public void setG(boolean x) { + } + + public int opA(int p1, int p2) { + return 0; + } + + public void opB(float x) { + } + + public int getH() { + return 0; + } + + public void setH(int x) { + } + } + + @MBean + @Description("MBean description") + public static class AnnotatedMBean { + @Description("0-arg constructor description") + public AnnotatedMBean() {} + + public AnnotatedMBean(String why) {} + + @Description("2-arg constructor description") + public AnnotatedMBean( + @Description("p1 description") + int x, + @Description("p2 description") + String y) {} + + @ManagedAttribute + @Description("A description") + public String getA() { + return null; + } + + @ManagedAttribute + @Description("B description") + public int getB() { + return 0; + } + + @ManagedAttribute + public void setB(int x) { + } + + @ManagedAttribute + public boolean isC() { + return false; + } + + @ManagedAttribute + @Description("C description") + public void setC(boolean x) { + } + + @ManagedAttribute + @Description("D description") + public void setD(float x) { + } + + @ManagedAttribute + public String getE() { + return null; + } + + @ManagedAttribute + public int getF() { + return 0; + } + + @ManagedAttribute + public void setF(int x) { + } + + @ManagedAttribute + public void setG(boolean x) { + } + + @ManagedAttribute + @Description("H description") + public int getH() { + return 0; + } + + @ManagedAttribute + @Description("H description") + public void setH(int x) { + } + + @ManagedOperation + @Description("opA description") + public int opA( + @Description("p1 description") int p1, + @Description("p2 description") int p2) { + return 0; + } + + @ManagedOperation + public void opB(float x) { + } + } + + @MXBean + @Description("MBean description") + public static class AnnotatedMXBean { + @Description("0-arg constructor description") + public AnnotatedMXBean() {} + + public AnnotatedMXBean(String why) {} + + @Description("2-arg constructor description") + public AnnotatedMXBean( + @Description("p1 description") + int x, + @Description("p2 description") + String y) {} + + @ManagedAttribute + @Description("A description") + public String getA() { + return null; + } + + @ManagedAttribute + @Description("B description") + public int getB() { + return 0; + } + + @ManagedAttribute + public void setB(int x) { + } + + @ManagedAttribute + public boolean isC() { + return false; + } + + @ManagedAttribute + @Description("C description") + public void setC(boolean x) { + } + + @ManagedAttribute + @Description("D description") + public void setD(float x) { + } + + @ManagedAttribute + public String getE() { + return null; + } + + @ManagedAttribute + public int getF() { + return 0; + } + + @ManagedAttribute + public void setF(int x) { + } + + @ManagedAttribute + public void setG(boolean x) { + } + + @ManagedAttribute + @Description("H description") + public int getH() { + return 0; + } + + @ManagedAttribute + @Description("H description") + public void setH(int x) { + } + + @ManagedOperation + @Description("opA description") + public int opA( + @Description("p1 description") int p1, + @Description("p2 description") int p2) { + return 0; + } + + @ManagedOperation + public void opB(float x) { + } + } + + // Negative tests follow. + + // Inconsistent descriptions + public static interface BadInterface { + @Description("foo") + public String getFoo(); + @Description("bar") + public void setFoo(String x); + } + + public static interface BadMBean extends BadInterface {} + + public static class Bad implements BadMBean { + public String getFoo() { + return null; + } + + public void setFoo(String x) { + } + } + + public static interface BadMXBean extends BadInterface {} + + public static class BadMXBeanImpl implements BadMXBean { + public String getFoo() { + return null; + } + + public void setFoo(String x) { + } + } + + private static interface Defaults { + public String defaultAttributeDescription(String name); + public String defaultOperationDescription(String name); + public String defaultParameterDescription(int index); + } + + private static class StandardDefaults implements Defaults { + public String defaultAttributeDescription(String name) { + return "Attribute exposed for management"; + } + + public String defaultOperationDescription(String name) { + return "Operation exposed for management"; + } + + public String defaultParameterDescription(int index) { + return ""; + } + } + private static final Defaults standardDefaults = new StandardDefaults(); + + private static class MXBeanDefaults implements Defaults { + public String defaultAttributeDescription(String name) { + return name; + } + + public String defaultOperationDescription(String name) { + return name; + } + + public String defaultParameterDescription(int index) { + return "p" + index; + } + } + private static final Defaults mxbeanDefaults = new MXBeanDefaults(); + + private static class TestCase { + final String name; + final Object mbean; + final Defaults defaults; + TestCase(String name, Object mbean, Defaults defaults) { + this.name = name; + this.mbean = mbean; + this.defaults = defaults; + } + } + + private static class ExceptionTest { + final String name; + final Object mbean; + ExceptionTest(String name, Object mbean) { + this.name = name; + this.mbean = mbean; + } + } + + private static final TestCase[] tests = { + new TestCase("Standard MBean", new Test(), standardDefaults), + new TestCase("Standard MBean subclass", new TestSub(), standardDefaults), + new TestCase("StandardMBean delegating", + new StandardMBean(new Test(), TestMBean.class, false), + standardDefaults), + new TestCase("StandardMBean delegating to subclass", + new StandardMBean(new TestSub(), TestMBean.class, false), + standardDefaults), + new TestCase("StandardMBean subclass", new StandardSub(), standardDefaults), + + new TestCase("MXBean", new TestMXBeanImpl(), mxbeanDefaults), + new TestCase("StandardMBean MXBean delegating", + new StandardMBean(new TestMXBeanImpl(), TestMXBean.class, true), + mxbeanDefaults), + new TestCase("StandardMBean MXBean subclass", + new StandardMXSub(), mxbeanDefaults), + + new TestCase("@MBean", new AnnotatedMBean(), standardDefaults), + new TestCase("@MXBean", new AnnotatedMXBean(), mxbeanDefaults), + new TestCase("StandardMBean @MBean delegating", + new StandardMBean(new AnnotatedMBean(), null, false), + standardDefaults), + new TestCase("StandardMBean @MXBean delegating", + new StandardMBean(new AnnotatedMXBean(), null, true), + mxbeanDefaults), + }; + + private static final ExceptionTest[] exceptionTests = { + new ExceptionTest("Standard MBean with inconsistent get/set", new Bad()), + new ExceptionTest("MXBean with inconsistent get/set", new BadMXBeanImpl()), + }; + + public static void main(String[] args) throws Exception { + System.out.println("=== Testing correct MBeans ==="); + for (TestCase test : tests) { + System.out.println("Testing " + test.name + "..."); + mbs.registerMBean(test.mbean, name); + boolean expectConstructors = + (test.mbean.getClass() != StandardMBean.class); + check(mbs.getMBeanInfo(name), test.defaults, expectConstructors); + mbs.unregisterMBean(name); + } + System.out.println(); + + System.out.println("=== Testing incorrect MBeans ==="); + for (ExceptionTest test : exceptionTests) { + System.out.println("Testing " + test.name); + try { + mbs.registerMBean(test.mbean, name); + fail("Registration succeeded but should not have"); + mbs.unregisterMBean(name); + } catch (NotCompliantMBeanException e) { + // OK + } catch (Exception e) { + fail("Registration failed with wrong exception: " + + "expected NotCompliantMBeanException, got " + + e.getClass().getName()); + } + } + System.out.println(); + + if (failure == null) + System.out.println("TEST PASSED"); + else + throw new Exception("TEST FAILED: " + failure); + } + + private static void check( + MBeanInfo mbi, Defaults defaults, boolean expectConstructors) + throws Exception { + assertEquals("MBean description", mbi.getDescription()); + + // These attributes have descriptions + for (String attr : new String[] {"A", "B", "C", "D", "H"}) { + MBeanAttributeInfo mbai = getAttributeInfo(mbi, attr); + assertEquals(attr + " description", mbai.getDescription()); + } + + // These attributes don't have descriptions + for (String attr : new String[] {"E", "F", "G"}) { + // If we ever change the default description, we'll need to change + // this test accordingly. + MBeanAttributeInfo mbai = getAttributeInfo(mbi, attr); + assertEquals( + defaults.defaultAttributeDescription(attr), mbai.getDescription()); + } + + // This operation has a description, as do its parameters + MBeanOperationInfo opA = getOperationInfo(mbi, "opA"); + assertEquals("opA description", opA.getDescription()); + checkSignature(opA.getSignature()); + + // This operation has the default description, as does its parameter + MBeanOperationInfo opB = getOperationInfo(mbi, "opB"); + assertEquals(defaults.defaultOperationDescription("opB"), opB.getDescription()); + MBeanParameterInfo opB0 = opB.getSignature()[0]; + assertEquals(defaults.defaultParameterDescription(0), opB0.getDescription()); + + if (expectConstructors) { + // The 0-arg and 2-arg constructors have descriptions + MBeanConstructorInfo con0 = getConstructorInfo(mbi, 0); + assertEquals("0-arg constructor description", con0.getDescription()); + MBeanConstructorInfo con2 = getConstructorInfo(mbi, 2); + assertEquals("2-arg constructor description", con2.getDescription()); + checkSignature(con2.getSignature()); + + // The 1-arg constructor does not have a description. + // The default description for constructors and their + // parameters is the same for all types of MBean. + MBeanConstructorInfo con1 = getConstructorInfo(mbi, 1); + assertEquals("Public constructor of the MBean", con1.getDescription()); + assertEquals("", con1.getSignature()[0].getDescription()); + } + } + + private static void checkSignature(MBeanParameterInfo[] params) { + for (int i = 0; i < params.length; i++) { + MBeanParameterInfo mbpi = params[i]; + assertEquals("p" + (i+1) + " description", mbpi.getDescription()); + } + } + + private static MBeanAttributeInfo getAttributeInfo(MBeanInfo mbi, String attr) + throws Exception { + return getFeatureInfo(mbi.getAttributes(), attr); + } + + private static MBeanOperationInfo getOperationInfo(MBeanInfo mbi, String op) + throws Exception { + return getFeatureInfo(mbi.getOperations(), op); + } + + private static MBeanConstructorInfo getConstructorInfo(MBeanInfo mbi, int nparams) + throws Exception { + for (MBeanConstructorInfo mbci : mbi.getConstructors()) { + if (mbci.getSignature().length == nparams) + return mbci; + } + throw new Exception("Constructor not found: " + nparams); + } + + private static T getFeatureInfo( + T[] features, String name) throws Exception { + for (T feature : features) { + if (feature.getName().equals(name)) + return feature; + } + throw new Exception("Feature not found: " + name); + } + + private static void assertEquals(Object expected, Object actual) { + if (!expected.equals(actual)) + fail("Expected " + string(expected) + ", got " + string(actual)); + } + + private static String string(Object x) { + if (x instanceof String) + return quote((String) x); + else + return String.valueOf(x); + } + + private static String quote(String s) { + return '"' + s.replace("\\", "\\\\").replace("\"", "\\\"") + '"'; + } + + private static void fail(String why) { + StackTraceElement[] stack = new Throwable().getStackTrace(); + int n = 0; + for (StackTraceElement elmt : stack) { + String method = elmt.getMethodName(); + if (method.equals("fail") || method.equals("assertEquals") || + method.equals("checkSignature")) + continue; + n = elmt.getLineNumber(); + break; + } + System.out.println("FAILED: " + why + " (line " + n + ")"); + failure = why; + } +} diff --git a/jdk/test/javax/management/Introspector/ParameterNameTest.java b/jdk/test/javax/management/Introspector/ParameterNameTest.java new file mode 100644 index 00000000000..fada6cccb17 --- /dev/null +++ b/jdk/test/javax/management/Introspector/ParameterNameTest.java @@ -0,0 +1,116 @@ +/* + * 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 %M% %I% + * @bug 6323980 + * @summary Test that parameter names can be specified with @Name. + * @author Eamonn McManus + */ + +import javax.management.MBean; +import javax.management.MBeanInfo; +import javax.management.MBeanOperationInfo; +import javax.management.MBeanParameterInfo; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.MXBean; +import javax.management.ObjectName; + +import annot.Name; +import javax.management.ManagedOperation; + +public class ParameterNameTest { + public static interface NoddyMBean { + public int add(int x, @Name("y") int y); + } + + public static class Noddy implements NoddyMBean { + public int add(int x, int y) { + return x + y; + } + } + + public static interface NoddyMXBean { + public int add(int x, @Name("y") int y); + } + + public static class NoddyImpl implements NoddyMXBean { + public int add(int x, int y) { + return x + y; + } + } + + @MBean + public static class NoddyAnnot { + @ManagedOperation + public int add(int x, @Name("y") int y) { + return x + y; + } + } + + @MXBean + public static class NoddyAnnotMX { + @ManagedOperation + public int add(int x, @Name("y") int y) { + return x + y; + } + } + + private static final Object[] mbeans = { + new Noddy(), new NoddyImpl(), new NoddyAnnot(), new NoddyAnnotMX(), + }; + + public static void main(String[] args) throws Exception { + MBeanServer mbs = MBeanServerFactory.newMBeanServer(); + ObjectName name = new ObjectName("a:b=c"); + for (Object mbean : mbeans) { + System.out.println("Testing " + mbean.getClass().getName()); + mbs.registerMBean(mbean, name); + MBeanInfo mbi = mbs.getMBeanInfo(name); + MBeanOperationInfo[] mbois = mbi.getOperations(); + assertEquals(1, mbois.length); + MBeanParameterInfo[] mbpis = mbois[0].getSignature(); + assertEquals(2, mbpis.length); + boolean mx = Boolean.parseBoolean( + (String) mbi.getDescriptor().getFieldValue("mxbean")); + assertEquals(mx ? "p0" : "p1", mbpis[0].getName()); + assertEquals("y", mbpis[1].getName()); + mbs.unregisterMBean(name); + } + System.out.println("TEST PASSED"); + } + + private static void assertEquals(Object expect, Object actual) + throws Exception { + boolean eq; + if (expect == null) + eq = (actual == null); + else + eq = expect.equals(actual); + if (!eq) { + throw new Exception( + "TEST FAILED: expected " + expect + ", found " + actual); + } + } +} diff --git a/jdk/test/javax/management/Introspector/ResourceInjectionTest.java b/jdk/test/javax/management/Introspector/ResourceInjectionTest.java new file mode 100644 index 00000000000..ad45ccc029f --- /dev/null +++ b/jdk/test/javax/management/Introspector/ResourceInjectionTest.java @@ -0,0 +1,656 @@ +/* + * 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 %M% %I% + * @bug 6323980 + * @summary Test resource injection via @Resource + * @author Eamonn McManus + * @run main/othervm -ea ResourceInjectionTest + */ + +import java.io.File; +import java.io.PrintWriter; +import java.io.Serializable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; +import javax.annotation.Resource; +import javax.management.Attribute; +import javax.management.AttributeList; +import javax.management.AttributeNotFoundException; +import javax.management.DynamicMBean; +import javax.management.InstanceNotFoundException; +import javax.management.MBean; +import javax.management.MBeanException; +import javax.management.MBeanInfo; +import javax.management.MBeanRegistrationException; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.MXBean; +import javax.management.MalformedObjectNameException; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; +import javax.management.NotCompliantMBeanException; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationListener; +import javax.management.ObjectName; +import javax.management.ReflectionException; +import javax.management.SendNotification; +import javax.management.StandardEmitterMBean; +import javax.management.StandardMBean; +import javax.management.openmbean.MXBeanMappingFactory; + +public class ResourceInjectionTest { + private static MBeanServer mbs; + private static final ObjectName objectName; + static { + try { + objectName = new ObjectName("test:type=Test"); + } catch (MalformedObjectNameException e) { + throw new RuntimeException(e); + } + } + + /* This is somewhat nasty. In the current state of affairs, a + * StandardEmitterMBean can only get the + * MBeanServer to rewrite the source of a Notification from + * the originating object's reference to its ObjectName IF + * StandardEmitterMBean.getResource() returns a reference to the + * wrapped object. By default it doesn't, and you need to specify + * the option below to make it do so. We may hope that this is + * obscure enough for users to run into it rarely if ever. + */ + private static final StandardMBean.Options withWrappedVisible; + private static final StandardMBean.Options withWrappedVisibleMX; + static { + withWrappedVisible = new StandardMBean.Options(); + withWrappedVisible.setWrappedObjectVisible(true); + withWrappedVisibleMX = withWrappedVisible.clone(); + withWrappedVisibleMX.setMXBeanMappingFactory(MXBeanMappingFactory.DEFAULT); + } + + @Retention(RetentionPolicy.RUNTIME) + private static @interface ExpectException { + Class value(); + } + + public static void main(String[] args) throws Exception { + if (!ResourceInjectionTest.class.desiredAssertionStatus()) + throw new Exception("Test must be run with -ea"); + + File policyFile = File.createTempFile("jmxperms", ".policy"); + policyFile.deleteOnExit(); + PrintWriter pw = new PrintWriter(policyFile); + pw.println("grant {"); + pw.println(" permission javax.management.MBeanPermission \"*\", \"*\";"); + pw.println(" permission javax.management.MBeanServerPermission \"*\";"); + pw.println(" permission javax.management.MBeanTrustPermission \"*\";"); + pw.println("};"); + pw.close(); + + System.setProperty("java.security.policy", policyFile.getAbsolutePath()); + System.setSecurityManager(new SecurityManager()); + + String failure = null; + + for (Method m : ResourceInjectionTest.class.getDeclaredMethods()) { + if (Modifier.isStatic(m.getModifiers()) && + m.getName().startsWith("test") && + m.getParameterTypes().length == 0) { + ExpectException expexc = m.getAnnotation(ExpectException.class); + mbs = MBeanServerFactory.newMBeanServer(); + try { + m.invoke(null); + if (expexc != null) { + failure = + m.getName() + " did not got expected exception " + + expexc.value().getName(); + System.out.println(failure); + } else + System.out.println(m.getName() + " OK"); + } catch (InvocationTargetException ite) { + Throwable t = ite.getCause(); + String prob = null; + if (expexc != null) { + if (expexc.value().isInstance(t)) { + System.out.println(m.getName() + " OK (got expected " + + expexc.value().getName() + ")"); + } else + prob = "got wrong exception"; + } else + prob = "got exception"; + if (prob != null) { + failure = m.getName() + ": " + prob + " " + + t.getClass().getName(); + System.out.println(failure); + t.printStackTrace(System.out); + } + } + } + } + if (failure == null) + System.out.println("TEST PASSED"); + else + throw new Exception("TEST FAILED: " + failure); + } + + private static interface Send { + public void send(); + } + + // Test @Resource in MBean defined by annotations + + @MBean + public static class Annotated { + @Resource + private volatile MBeanServer mbeanServer; + @Resource + private volatile ObjectName myName; + + @ManagedAttribute + public ObjectName getMyName() { + return myName; + } + + @ManagedOperation + public void unregisterSelf() + throws InstanceNotFoundException, MBeanRegistrationException { + mbeanServer.unregisterMBean(myName); + } + } + + private static void testAnnotated() throws Exception { + testMBean(new Annotated()); + } + + private static void testAnnotatedWrapped() throws Exception { + testMBean(new StandardMBean(new Annotated(), null)); + } + + @MBean + public static class AnnotatedSend extends Annotated implements Send { + @Resource + private volatile SendNotification sender; + + @ManagedOperation + public void send() { + sender.sendNotification(new Notification("type", this, 0L)); + } + } + + private static void testAnnotatedSend() throws Exception { + testMBean(new AnnotatedSend()); + } + + private static void testAnnotatedSendWrapped() throws Exception { + testMBean(new StandardEmitterMBean( + new AnnotatedSend(), null, withWrappedVisible, null)); + } + + // Test @Resource in MXBean defined by annotations + + @MXBean + public static class AnnotatedMX { + @Resource + private volatile MBeanServer mbeanServer; + @Resource + private volatile ObjectName myName; + + @ManagedAttribute + public ObjectName getMyName() { + return myName; + } + + @ManagedOperation + public void unregisterSelf() + throws InstanceNotFoundException, MBeanRegistrationException { + mbeanServer.unregisterMBean(myName); + } + } + + private static void testAnnotatedMX() throws Exception { + testMBean(new AnnotatedMX()); + } + + private static void testAnnotatedMXWrapped() throws Exception { + testMBean(new StandardMBean(new AnnotatedMX(), null, true)); + } + + public static class AnnotatedMXSend extends AnnotatedMX implements Send { + @Resource + private volatile SendNotification sender; + + @ManagedOperation + public void send() { + sender.sendNotification(new Notification("type", this, 0L)); + } + } + + private static void testAnnotatedMXSend() throws Exception { + testMBean(new AnnotatedMXSend()); + } + + private static void testAnnotatedMXSendWrapped() throws Exception { + testMBean(new StandardEmitterMBean( + new AnnotatedMXSend(), null, withWrappedVisibleMX, null)); + } + + // Test @Resource in Standard MBean + + public static interface SimpleStandardMBean { + public ObjectName getMyName(); + public void unregisterSelf() throws Exception; + } + + public static class SimpleStandard implements SimpleStandardMBean { + @Resource(type = MBeanServer.class) + private volatile Object mbeanServer; + @Resource(type = ObjectName.class) + private volatile Object myName; + + public ObjectName getMyName() { + return (ObjectName) myName; + } + + public void unregisterSelf() throws Exception { + ((MBeanServer) mbeanServer).unregisterMBean(getMyName()); + } + } + + private static void testStandard() throws Exception { + testMBean(new SimpleStandard()); + } + + private static void testStandardWrapped() throws Exception { + testMBean(new StandardMBean(new SimpleStandard(), SimpleStandardMBean.class)); + } + + public static interface SimpleStandardSendMBean extends SimpleStandardMBean { + public void send(); + } + + public static class SimpleStandardSend + extends SimpleStandard implements SimpleStandardSendMBean { + @Resource(type = SendNotification.class) + private volatile Object sender; + + public void send() { + ((SendNotification) sender).sendNotification( + new Notification("type", this, 0L)); + } + } + + private static void testStandardSend() throws Exception { + testMBean(new SimpleStandardSend()); + } + + private static void testStandardSendWrapped() throws Exception { + testMBean(new StandardEmitterMBean( + new SimpleStandardSend(), SimpleStandardSendMBean.class, + withWrappedVisible, null)); + } + + // Test @Resource in MXBean + + public static interface SimpleMXBean { + public ObjectName getMyName(); + public void unregisterSelf() throws Exception; + } + + public static class SimpleMX implements SimpleMXBean { + @Resource(type = MBeanServer.class) + private volatile Object mbeanServer; + @Resource(type = ObjectName.class) + private volatile Object myName; + + public ObjectName getMyName() { + return (ObjectName) myName; + } + + public void unregisterSelf() throws Exception { + ((MBeanServer) mbeanServer).unregisterMBean(getMyName()); + } + } + + private static void testMX() throws Exception { + testMBean(new SimpleMX()); + } + + private static void testMXWrapped() throws Exception { + testMBean(new StandardMBean(new SimpleMX(), SimpleMXBean.class, true)); + } + + public static interface SimpleMXBeanSend extends SimpleMXBean { + public void send(); + } + + public MBeanServer getMbs() { + return mbs; + } + + public static class SimpleMXSend extends SimpleMX implements SimpleMXBeanSend { + @Resource(type = SendNotification.class) + private volatile Object sender; + + public void send() { + ((SendNotification) sender).sendNotification( + new Notification("type", this, 0L)); + } + } + + private static void testMXSend() throws Exception { + testMBean(new SimpleMXSend()); + } + + private static void testMXSendWrapped() throws Exception { + testMBean(new StandardEmitterMBean( + new SimpleMXSend(), SimpleMXBeanSend.class, + withWrappedVisibleMX, null)); + } + + // Test @Resource in Dynamic MBean + + private static class SimpleDynamic implements DynamicMBean { + private MBeanServer mbeanServer; + private ObjectName myName; + + @Resource + private synchronized void setMBeanServer(MBeanServer mbs) { + mbeanServer = mbs; + } + + @Resource(type = ObjectName.class) + private synchronized void setObjectName(Serializable name) { + myName = (ObjectName) name; + } + + public synchronized Object getAttribute(String attribute) + throws AttributeNotFoundException { + if (attribute.equals("MyName")) + return myName; + throw new AttributeNotFoundException(attribute); + } + + public void setAttribute(Attribute attribute) + throws AttributeNotFoundException { + throw new AttributeNotFoundException(attribute.getName()); + } + + public synchronized AttributeList getAttributes(String[] attributes) { + AttributeList list = new AttributeList(); + for (String name : attributes) { + if (name.equals("MyName")) + list.add(new Attribute("MyName", myName)); + } + return list; + } + + public AttributeList setAttributes(AttributeList attributes) { + return new AttributeList(); + } + + public synchronized Object invoke( + String actionName, Object[] params, String[] signature) + throws MBeanException, ReflectionException { + if (actionName.equals("unregisterSelf") && + (params == null || params.length == 0) && + (signature == null || signature.length == 0)) { + try { + mbeanServer.unregisterMBean(myName); + return null; + } catch (Exception x) { + throw new MBeanException(x); + } + } else { + Exception x = new NoSuchMethodException( + actionName + Arrays.toString(signature)); + throw new MBeanException(x); + } + } + + public MBeanInfo getMBeanInfo() { + DynamicMBean mbean = new StandardMBean( + new SimpleStandard(), SimpleStandardMBean.class, false); + return mbean.getMBeanInfo(); + } + } + + private static void testDynamic() throws Exception { + testMBean(new SimpleDynamic()); + } + + private static class SimpleDynamicSend extends SimpleDynamic { + private SendNotification sender; + + @Resource + private synchronized void setSender(SendNotification sender) { + this.sender = sender; + } + + @Override + public synchronized Object invoke( + String actionName, Object[] params, String[] signature) + throws MBeanException, ReflectionException { + if (actionName.equals("send")) { + sender.sendNotification(new Notification("type", this, 0L)); + return null; + } else + return super.invoke(actionName, params, signature); + } + } + + private static void testDynamicSend() throws Exception { + testMBean(new SimpleDynamicSend()); + } + + // Test that @Resource classes don't have to be public + // They can even be defined within methods! + // But you can't have any @ManagedAttributes or @ManagedOperations + // in such MBeans so their utility is limited. + + private static void testNonPublic() throws Exception { + @MBean + class NonPublic { + @Resource + ObjectName myName; + } + assert !Modifier.isPublic(NonPublic.class.getModifiers()); + NonPublic mbean = new NonPublic(); + mbs.registerMBean(mbean, objectName); + assert objectName.equals(mbean.myName); + } + + // Test inheritance and multiple injections of the same value + + private static class ManyResources extends AnnotatedSend { + @Resource + private volatile ObjectName myName; // same name as in parent! + @Resource(type=ObjectName.class) + private volatile Object myOtherName; + private volatile ObjectName myThirdName; + private volatile ObjectName myFourthName; + private volatile int methodCalls; + @Resource + private volatile SendNotification send1; + @Resource(type = SendNotification.class) + private volatile Object send2; + + @Resource + void setMyName(ObjectName name) { + myThirdName = name; + methodCalls++; + } + + @Resource(type=ObjectName.class) + private void setMyNameAgain(ObjectName name) { + myFourthName = name; + methodCalls++; + } + + void check() { + assert objectName.equals(myName) : myName; + for (ObjectName name : new ObjectName[] { + (ObjectName)myOtherName, myThirdName, myFourthName + }) { + assert myName == name : name; + } + assert methodCalls == 2 : methodCalls; + assert send1 != null && send2 == send1; + } + } + + private static void testManyResources() throws Exception { + ManyResources mr = new ManyResources(); + testMBean(mr); + mr.check(); + } + + // Test that method override doesn't lead to multiple calls of the same method + + private static class ManyResourcesSub extends ManyResources { + private boolean called; + + @Override + @Resource + void setMyName(ObjectName name) { + super.setMyName(name); + called = true; + } + + void check2() { + assert called; + } + } + + private static void testOverride() throws Exception { + ManyResourcesSub mrs = new ManyResourcesSub(); + testMBean(mrs); + mrs.check(); + mrs.check2(); + } + + // Test that @Resource is illegal on static fields + + @MBean + public static class StaticResource { + @Resource + private static ObjectName name; + } + + @ExpectException(NotCompliantMBeanException.class) + private static void testStaticResource() throws Exception { + testMBean(new StaticResource()); + } + + // Test that @Resource is illegal on static methods + + @MBean + public static class StaticResourceMethod { + @Resource + private static void setObjectName(ObjectName name) {} + } + + @ExpectException(NotCompliantMBeanException.class) + private static void testStaticResourceMethod() throws Exception { + testMBean(new StaticResourceMethod()); + } + + // Test that @Resource is illegal on methods that don't return void + + @MBean + public static class NonVoidMethod { + @Resource + private String setObjectName(ObjectName name) { + return "oops"; + } + } + + @ExpectException(NotCompliantMBeanException.class) + private static void testNonVoidMethod() throws Exception { + testMBean(new NonVoidMethod()); + } + + // Test that @Resource is illegal on methods with no arguments + + @MBean + public static class NoArgMethod { + @Resource(type=ObjectName.class) + private void setObjectName() {} + } + + @ExpectException(NotCompliantMBeanException.class) + private static void testNoArgMethod() throws Exception { + testMBean(new NoArgMethod()); + } + + // Test that @Resource is illegal on methods with more than one argument + + @MBean + public static class MultiArgMethod { + @Resource + private void setObjectName(ObjectName name, String what) {} + } + + @ExpectException(NotCompliantMBeanException.class) + private static void testMultiArgMethod() throws Exception { + testMBean(new MultiArgMethod()); + } + + private static class CountListener implements NotificationListener { + volatile int count; + public void handleNotification(Notification notification, Object handback) { + count++; + } + } + + private static void testMBean(Object mbean) throws Exception { + mbs.registerMBean(mbean, objectName); + + final ObjectName name = (ObjectName) mbs.getAttribute(objectName, "MyName"); + assert objectName.equals(name) : name; + + if (mbean instanceof Send || mbean instanceof NotificationEmitter) { + assert mbs.isInstanceOf(name, NotificationEmitter.class.getName()); + CountListener countL = new CountListener(); + mbs.addNotificationListener(name, countL, null, null); + NotificationListener checkSource = new NotificationListener() { + public void handleNotification(Notification n, Object h) { + assert n.getSource().equals(name) : n.getSource(); + } + }; + mbs.addNotificationListener(name, checkSource, null, null); + mbs.invoke(objectName, "send", null, null); + assert countL.count == 1; + mbs.removeNotificationListener(name, checkSource); + mbs.removeNotificationListener(name, countL, null, null); + } + + mbs.invoke(objectName, "unregisterSelf", null, null); + assert !mbs.isRegistered(objectName); + } +} diff --git a/jdk/test/javax/management/Introspector/annot/Name.java b/jdk/test/javax/management/Introspector/annot/Name.java new file mode 100644 index 00000000000..790e641552e --- /dev/null +++ b/jdk/test/javax/management/Introspector/annot/Name.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package annot; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface Name { + String value(); +} diff --git a/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java new file mode 100644 index 00000000000..cd88a161b02 --- /dev/null +++ b/jdk/test/javax/management/mxbean/ComparatorExceptionTest.java @@ -0,0 +1,90 @@ +/* + * 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 6601652 + * @summary Test exception when SortedMap or SortedSet has non-null Comparator + * @author Eamonn McManus + */ + +import java.util.SortedMap; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; + +public class ComparatorExceptionTest { + public static interface TestMXBean { + public SortedSet getSortedSet(); + public SortedMap getSortedMap(); + } + + public static class TestImpl implements TestMXBean { + public SortedSet getSortedSet() { + return new TreeSet(String.CASE_INSENSITIVE_ORDER); + } + + public SortedMap getSortedMap() { + return new TreeMap(String.CASE_INSENSITIVE_ORDER); + } + } + + private static String failure; + + private static void fail(String why) { + failure = "FAILED: " + why; + System.out.println(failure); + } + + public static void main(String[] args) throws Exception { + MBeanServer mbs = MBeanServerFactory.newMBeanServer(); + ObjectName name = new ObjectName("a:b=c"); + mbs.registerMBean(new TestImpl(), name); + + for (String attr : new String[] {"SortedSet", "SortedMap"}) { + try { + Object value = mbs.getAttribute(name, attr); + fail("get " + attr + " did not throw exception"); + } catch (Exception e) { + Throwable t = e; + while (!(t instanceof IllegalArgumentException)) { + if (t == null) + break; + t = t.getCause(); + } + if (t != null) + System.out.println("Correct exception for " + attr); + else { + fail("get " + attr + " got wrong exception"); + e.printStackTrace(System.out); + } + } + } + + if (failure != null) + throw new Exception(failure); + } +} diff --git a/jdk/test/javax/management/mxbean/CustomTypeTest.java b/jdk/test/javax/management/mxbean/CustomTypeTest.java new file mode 100644 index 00000000000..ccf192ab531 --- /dev/null +++ b/jdk/test/javax/management/mxbean/CustomTypeTest.java @@ -0,0 +1,590 @@ +/* + * 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. + * + * 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 %M% %I% + * @bug 6562936 + * @run compile customtypes/package-info.java + * @run main CustomTypeTest + */ + +import java.io.InvalidObjectException; +import java.lang.management.ManagementFactory; +import java.lang.reflect.Array; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import javax.management.JMX; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.management.StandardMBean; +import javax.management.Descriptor; +import javax.management.MBeanServerInvocationHandler; +import javax.management.NotCompliantMBeanException; +import javax.management.openmbean.ArrayType; +import javax.management.openmbean.CompositeData; +import javax.management.openmbean.CompositeDataSupport; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingClass; +import javax.management.openmbean.MXBeanMappingFactory; +import javax.management.openmbean.MXBeanMappingFactoryClass; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.OpenType; +import javax.management.openmbean.SimpleType; +import javax.management.openmbean.TabularData; + +import static javax.management.JMX.MBeanOptions; + +import customtypes.*; + +public class CustomTypeTest { + @MXBeanMappingClass(LinkedListMapping.class) + public static class LinkedList { + private final String name; + private final LinkedList next; + + public LinkedList(String name, LinkedList next) { + this.name = name; + this.next = next; + } + + public String getName() { + return name; + } + + public LinkedList getNext() { + return next; + } + + public String toString() { + if (next == null) + return "(" + name + ")"; + else + return "(" + name + " " + next + ")"; + } + + public boolean equals(Object x) { + if (!(x instanceof LinkedList)) + return false; + LinkedList other = (LinkedList) x; + return (this.name.equals(other.name) && + (this.next == null ? other.next == null : + this.next.equals(other.next))); + } + } + + public static class LinkedListMapping extends MXBeanMapping { + public LinkedListMapping(Type type) throws OpenDataException { + super(LinkedList.class, ArrayType.getArrayType(SimpleType.STRING)); + if (type != LinkedList.class) { + throw new OpenDataException("Mapping only valid for " + + LinkedList.class); + } + } + + public Object fromOpenValue(Object openValue) throws InvalidObjectException { + String[] array = (String[]) openValue; + LinkedList list = null; + for (int i = array.length - 1; i >= 0; i--) + list = new LinkedList(array[i], list); + return list; + } + + public Object toOpenValue(Object javaValue) throws OpenDataException { + ArrayList array = new ArrayList(); + for (LinkedList list = (LinkedList) javaValue; list != null; + list = list.getNext()) + array.add(list.getName()); + return array.toArray(new String[0]); + } + } + + public static interface LinkedListMXBean { + public LinkedList getLinkedList(); + } + + public static class LinkedListImpl implements LinkedListMXBean { + public LinkedList getLinkedList() { + return new LinkedList("car", new LinkedList("cdr", null)); + } + } + + public static class ObjectMXBeanMapping extends MXBeanMapping { + private static final CompositeType wildcardType; + + static { + try { + wildcardType = + new CompositeType(Object.class.getName(), + "Wildcard type for Object", + new String[0], // itemNames + new String[0], // itemDescriptions + new OpenType[0]); // itemTypes + } catch (OpenDataException e) { + throw new RuntimeException(e); + } + } + + public ObjectMXBeanMapping() { + super(Object.class, wildcardType); + } + + public Object fromOpenValue(Object openValue) throws InvalidObjectException { + if (!(openValue instanceof CompositeData)) { + throw new InvalidObjectException("Not a CompositeData: " + + openValue.getClass()); + } + CompositeData cd = (CompositeData) openValue; + if (!cd.containsKey("value")) { + throw new InvalidObjectException("CompositeData does not " + + "contain a \"value\" item: " + cd); + } + Object x = cd.get("value"); + if (!(x instanceof CompositeData || x instanceof TabularData || + x instanceof Object[])) + return x; + + String typeName = (String) cd.get("type"); + if (typeName == null) { + throw new InvalidObjectException("CompositeData does not " + + "contain a \"type\" item: " + cd); + } + Class c; + try { + c = Class.forName(typeName); + } catch (ClassNotFoundException e) { + InvalidObjectException ioe = + new InvalidObjectException("Could not find type"); + ioe.initCause(e); + throw ioe; + } + MXBeanMapping mapping; + try { + mapping = objectMappingFactory.mappingForType(c, objectMappingFactory); + } catch (OpenDataException e) { + InvalidObjectException ioe = + new InvalidObjectException("Could not map object's " + + "type " + c.getName()); + ioe.initCause(e); + throw ioe; + } + return mapping.fromOpenValue(x); + } + + public Object toOpenValue(Object javaValue) throws OpenDataException { + OpenType openType; + Object openValue; + String typeName; + if (javaValue == null) { + openType = SimpleType.VOID; + openValue = null; + typeName = null; + } else { + Class c = javaValue.getClass(); + if (c.equals(Object.class)) + throw new OpenDataException("Cannot map Object to an open value"); + MXBeanMapping mapping = + objectMappingFactory.mappingForType(c, objectMappingFactory); + openType = mapping.getOpenType(); + openValue = mapping.toOpenValue(javaValue); + typeName = c.getName(); + } + CompositeType ct = new CompositeType( + (javaValue == null) ? "null" : openType.getClassName(), + "Open Mapping for Object", + new String[] {"type", "value"}, + new String[] {"type", "value"}, + new OpenType[] {SimpleType.STRING, openType}); + return new CompositeDataSupport( + ct, + new String[] {"type", "value"}, + new Object[] {typeName, openValue}); + } + } + + public static class ObjectMappingFactory extends MXBeanMappingFactory { + private static MXBeanMapping objectMapping = + new ObjectMXBeanMapping(); + + @Override + public MXBeanMapping mappingForType(Type t, MXBeanMappingFactory f) + throws OpenDataException { + if (t.equals(Object.class)) + return objectMapping; + else + return MXBeanMappingFactory.DEFAULT.mappingForType(t, f); + } + } + + private static MXBeanMappingFactory objectMappingFactory = + new ObjectMappingFactory(); + + public static interface ObjectMXBean { + public Object getObject(); + public Object[] getObjects(); + public List getObjectList(); + public Object[][] getMoreObjects(); + } + + public static class ObjectImpl implements ObjectMXBean { + public Object getObject() { + return 123; + } + + private static Object[] objects = { + "foo", 3, 3.14f, 3.14, 3L, new Date(), ObjectName.WILDCARD, + new byte[3], new char[3], new int[3][3], + new LinkedListImpl().getLinkedList(), + }; + + public Object[] getObjects() { + return objects; + } + + public List getObjectList() { + return Arrays.asList(getObjects()); + } + + public Object[][] getMoreObjects() { + return new Object[][] {{getObjects()}}; + } + } + + @MXBeanMappingFactoryClass(ObjectMappingFactory.class) + public static interface AnnotatedObjectMXBean extends ObjectMXBean {} + + public static class AnnotatedObjectImpl extends ObjectImpl + implements AnnotatedObjectMXBean {} + + public static class BrokenMappingFactory extends MXBeanMappingFactory { + public MXBeanMapping mappingForType(Type t, MXBeanMappingFactory f) + throws OpenDataException { + throw new OpenDataException(t.toString()); + } + } + + public static class ReallyBrokenMappingFactory extends BrokenMappingFactory { + public ReallyBrokenMappingFactory() { + throw new RuntimeException("Oops"); + } + } + + @MXBeanMappingFactoryClass(BrokenMappingFactory.class) + public static interface BrokenMXBean { + public int getX(); + } + + public static class BrokenImpl implements BrokenMXBean { + public int getX() {return 0;} + } + + @MXBeanMappingFactoryClass(ReallyBrokenMappingFactory.class) + public static interface ReallyBrokenMXBean { + public int getX(); + } + + public static class ReallyBrokenImpl implements ReallyBrokenMXBean { + public int getX() {return 0;} + } + + public static class BrokenMapping extends MXBeanMapping { + public BrokenMapping(Type t) { + super(t, SimpleType.STRING); + throw new RuntimeException("Oops"); + } + + public Object fromOpenValue(Object openValue) throws InvalidObjectException { + throw new AssertionError(); + } + + public Object toOpenValue(Object javaValue) throws OpenDataException { + throw new AssertionError(); + } + } + + @MXBeanMappingClass(BrokenMapping.class) + public static class BrokenType {} + + public static interface BrokenTypeMXBean { + BrokenType getBroken(); + } + + public static class BrokenTypeImpl implements BrokenTypeMXBean { + public BrokenType getBroken() { + throw new AssertionError(); + } + } + + public static void main(String[] args) throws Exception { + MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); + + System.out.println("Test @MXBeanMappingClass"); + ObjectName linkedName = new ObjectName("d:type=LinkedList"); + LinkedListMXBean linkedListMXBean = new LinkedListImpl(); + LinkedList list1 = linkedListMXBean.getLinkedList(); + mbs.registerMBean(linkedListMXBean, linkedName); + LinkedListMXBean linkedProxy = + JMX.newMXBeanProxy(mbs, linkedName, LinkedListMXBean.class); + MBeanServerInvocationHandler mbsih = (MBeanServerInvocationHandler) + Proxy.getInvocationHandler(linkedProxy); + if (!mbsih.isMXBean()) + fail("not MXBean proxy"); + LinkedList list2 = linkedProxy.getLinkedList(); + if (list1 == list2) + fail("lists identical!"); + // They should have gone through the mapping and back, + // and the mapping doesn't do anything that would allow it + // to restore the identical object. + if (!list1.equals(list2)) + fail("lists different: " + list1 + " vs " + list2); + System.out.println("...success"); + + System.out.println("Test StandardMBean with MXBeanMappingFactory"); + ObjectMXBean wildcardMBean = new ObjectImpl(); + MBeanOptions options = new MBeanOptions(); + options.setMXBeanMappingFactory(objectMappingFactory); + if (!options.isMXBean()) + fail("Setting MXBeanMappingFactory should imply MXBean"); + StandardMBean wildcardStandardMBean = + new StandardMBean(wildcardMBean, ObjectMXBean.class, options); + testWildcardMBean(mbs, wildcardMBean, wildcardStandardMBean, + options, ObjectMXBean.class); + + System.out.println("Test @MXBeanMappingFactoryClass on interface"); + ObjectMXBean annotatedWildcardMBean = new AnnotatedObjectImpl(); + testWildcardMBean(mbs, annotatedWildcardMBean, annotatedWildcardMBean, + null, AnnotatedObjectMXBean.class); + + System.out.println("Test @MXBeanMappingFactoryClass on package"); + CustomMXBean custom = zeroProxy(CustomMXBean.class); + ObjectName customName = new ObjectName("d:type=Custom"); + mbs.registerMBean(custom, customName); + Object x = mbs.getAttribute(customName, "X"); + if (!(x instanceof String)) + fail("Should be String: " + x + " (a " + x.getClass().getName() + ")"); + CustomMXBean customProxy = + JMX.newMXBeanProxy(mbs, customName, CustomMXBean.class); + x = customProxy.getX(); + if (!(x instanceof Integer) || (Integer) x != 0) + fail("Wrong return from proxy: " + x + " (a " + x.getClass().getName() + ")"); + + System.out.println("Test MXBeanMappingFactory exception"); + try { + mbs.registerMBean(new BrokenImpl(), new ObjectName("d:type=Broken")); + fail("Register did not throw exception"); + } catch (NotCompliantMBeanException e) { + System.out.println("...OK: threw: " + e); + } + + System.out.println("Test MXBeanMappingFactory constructor exception"); + try { + mbs.registerMBean(new ReallyBrokenImpl(), new ObjectName("d:type=Broken")); + fail("Register did not throw exception"); + } catch (IllegalArgumentException e) { + System.out.println("...OK: threw: " + e); + } + + System.out.println("Test MXBeanMappingFactory exception with StandardMBean"); + MXBeanMappingFactory brokenF = new BrokenMappingFactory(); + MBeanOptions brokenO = new MBeanOptions(); + brokenO.setMXBeanMappingFactory(brokenF); + try { + new StandardMBean(wildcardMBean, ObjectMXBean.class, brokenO); + fail("StandardMBean with broken factory did not throw exception"); + } catch (IllegalArgumentException e) { + if (!(e.getCause() instanceof NotCompliantMBeanException)) { + fail("StandardMBean with broken factory threw wrong exception: " + + e.getCause()); + } + } + + System.out.println("Test MXBeanMappingClass exception"); + try { + mbs.registerMBean(new BrokenTypeImpl(), new ObjectName("d:type=Broken")); + fail("Broken MXBeanMappingClass did not throw exception"); + } catch (NotCompliantMBeanException e) { + System.out.println("...OK: threw: " + e); + } + + if (failure == null) + System.out.println("TEST PASSED"); + else + throw new Exception("TEST FAILED: " + failure); + } + + private static void testWildcardMBean(MBeanServer mbs, ObjectMXBean impl, + Object mbean, + MBeanOptions proxyOptions, + Class intf) + throws Exception { + ObjectName wildcardName = new ObjectName("d:type=Object"); + mbs.registerMBean(mbean, wildcardName); + try { + testWildcardMBean2(mbs, impl, wildcardName, proxyOptions, intf); + } finally { + mbs.unregisterMBean(wildcardName); + } + } + + private static void testWildcardMBean2(MBeanServer mbs, ObjectMXBean impl, + ObjectName wildcardName, + MBeanOptions proxyOptions, + Class intf) + throws Exception { + if (proxyOptions == null) { + proxyOptions = new MBeanOptions(); + MXBeanMappingFactory f = MXBeanMappingFactory.forInterface(intf); + proxyOptions.setMXBeanMappingFactory(f); + } + Descriptor d = mbs.getMBeanInfo(wildcardName).getDescriptor(); + String factoryName = (String) + d.getFieldValue(JMX.MXBEAN_MAPPING_FACTORY_CLASS_FIELD); + if (!ObjectMappingFactory.class.getName().equals(factoryName)) { + fail("Descriptor has wrong MXBeanMappingFactory: " + factoryName + + " should be " + ObjectMappingFactory.class.getName()); + } + ObjectMXBean wildcardProxy = + JMX.newMBeanProxy(mbs, wildcardName, intf, proxyOptions); + MBeanServerInvocationHandler mbsih = (MBeanServerInvocationHandler) + Proxy.getInvocationHandler(wildcardProxy); + MBeanOptions opts = mbsih.getMBeanOptions(); + if (!opts.equals(proxyOptions)) { + fail("Proxy options differ from request: " + opts + " vs " + + proxyOptions); + } + Method[] wildcardMethods = ObjectMXBean.class.getMethods(); + for (Method m : wildcardMethods) { + System.out.println("..." + m.getName()); + Object orig = m.invoke(impl); + Object copy = m.invoke(wildcardProxy); + if (!deepEquals(orig, copy)) { + fail("objects differ: " + deepToString(orig) + " vs " + + deepToString(copy)); + } + } + } + + private static T zeroProxy(Class intf) { + return intf.cast(Proxy.newProxyInstance(intf.getClassLoader(), + new Class[] {intf}, + new ZeroInvocationHandler())); + } + + private static class ZeroInvocationHandler implements InvocationHandler { + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + return 0; + } + } + + private static boolean deepEquals(Object x, Object y) { + if (x == y) + return true; + if (x == null || y == null) + return false; + + if (x instanceof Collection) { + if (!(y instanceof Collection)) + return false; + Collection xcoll = (Collection) x; + Collection ycoll = (Collection) y; + if (xcoll.size() != ycoll.size()) + return false; + Iterator xit = xcoll.iterator(); + Iterator yit = ycoll.iterator(); + while (xit.hasNext()) { + if (!deepEquals(xit.next(), yit.next())) + return false; + } + return true; + } + + Class xclass = x.getClass(); + Class yclass = y.getClass(); + if (xclass.isArray()) { + if (!yclass.isArray()) + return false; + if (!xclass.getComponentType().equals(yclass.getComponentType())) + return false; + int len = Array.getLength(x); + if (Array.getLength(y) != len) + return false; + for (int i = 0; i < len; i++) { + if (!deepEquals(Array.get(x, i), Array.get(y, i))) + return false; + } + return true; + } + +// return x.equals(y); + if (x.equals(y)) + return true; + System.out.println("Not equal: <" + x + "> and <" + y + ">"); + return false; + } + + private static String deepToString(Object x) { + if (x == null) + return "null"; + + if (x instanceof Collection) { + Collection xcoll = (Collection) x; + StringBuilder sb = new StringBuilder("["); + for (Object e : xcoll) { + if (sb.length() > 1) + sb.append(", "); + sb.append(deepToString(e)); + } + sb.append("]"); + return sb.toString(); + } + + if (x instanceof Object[]) { + Object[] xarr = (Object[]) x; + return deepToString(Arrays.asList(xarr)); + } + + if (x.getClass().isArray()) { // primitive array + String s = Arrays.deepToString(new Object[] {x}); + return s.substring(1, s.length() - 1); + } + + return x.toString(); + } + + private static void fail(String msg) { + System.out.println("TEST FAILED: " + msg); + if (msg.length() > 100) + msg = msg.substring(0, 100) + "..."; + failure = msg; + } + + private static String failure; +} diff --git a/jdk/test/javax/management/mxbean/JMXServiceURLTest.java b/jdk/test/javax/management/mxbean/JMXServiceURLTest.java index dc796037c35..12646cf7cd3 100644 --- a/jdk/test/javax/management/mxbean/JMXServiceURLTest.java +++ b/jdk/test/javax/management/mxbean/JMXServiceURLTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/javax/management/mxbean/MXBeanTest.java b/jdk/test/javax/management/mxbean/MXBeanTest.java index 9abcf57e450..9415b39faef 100644 --- a/jdk/test/javax/management/mxbean/MXBeanTest.java +++ b/jdk/test/javax/management/mxbean/MXBeanTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6175517 6278707 6318827 6305746 6392303 + * @bug 6175517 6278707 6318827 6305746 6392303 6600709 * @summary General MXBean test. * @author Eamonn McManus * @run clean MXBeanTest MerlinMXBean TigerMXBean @@ -40,7 +40,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; -import javax.management.Attribute; +import java.util.Map; +import java.util.SortedMap; import javax.management.JMX; import javax.management.MBeanAttributeInfo; import javax.management.MBeanInfo; @@ -55,10 +56,6 @@ import javax.management.StandardMBean; import javax.management.openmbean.ArrayType; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeDataInvocationHandler; -import javax.management.openmbean.OpenMBeanAttributeInfo; -import javax.management.openmbean.OpenMBeanInfo; -import javax.management.openmbean.OpenMBeanOperationInfo; -import javax.management.openmbean.OpenMBeanParameterInfo; import javax.management.openmbean.OpenType; import javax.management.openmbean.SimpleType; import javax.management.openmbean.TabularData; @@ -81,10 +78,8 @@ public class MXBeanTest { if (failures == 0) System.out.println("Test passed"); - else { - System.out.println("TEST FAILURES: " + failures); - System.exit(1); - } + else + throw new Exception("TEST FAILURES: " + failures); } private static int failures = 0; @@ -561,6 +556,11 @@ public class MXBeanTest { return false; return deepEqual(o1, o2, namedMXBeans); } + if (o1 instanceof Map) { + if (!(o2 instanceof Map)) + return false; + return equalMap((Map) o1, (Map) o2, namedMXBeans); + } if (o1 instanceof CompositeData && o2 instanceof CompositeData) { return compositeDataEqual((CompositeData) o1, (CompositeData) o2, namedMXBeans); @@ -600,6 +600,21 @@ public class MXBeanTest { return true; } + private static boolean equalMap(Map m1, Map m2, + NamedMXBeans namedMXBeans) { + if (m1.size() != m2.size()) + return false; + if ((m1 instanceof SortedMap) != (m2 instanceof SortedMap)) + return false; + for (Object k1 : m1.keySet()) { + if (!m2.containsKey(k1)) + return false; + if (!equal(m1.get(k1), m2.get(k1), namedMXBeans)) + return false; + } + return true; + } + // This is needed to work around a bug (5095277) // in CompositeDataSupport.equals private static boolean compositeDataEqual(CompositeData cd1, @@ -655,7 +670,7 @@ public class MXBeanTest { /* I wanted to call this method toString(Object), but oddly enough this meant that I couldn't call it from the inner class MXBeanImplInvocationHandler, because the inherited Object.toString() - prevented that. Surprising behaviour. */ + prevented that. */ static String string(Object o) { if (o == null) return "null"; diff --git a/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java new file mode 100644 index 00000000000..53cc9bb3b3d --- /dev/null +++ b/jdk/test/javax/management/mxbean/SameObjectTwoNamesTest.java @@ -0,0 +1,76 @@ +/* + * 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 SameObjectTwoNamesTest.java + * @bug 6283873 + * @summary Check that registering the same MXBean under two different + * names produces an exception + * @author Alexander Shusherov + * @author Eamonn McManus + * @run main SameObjectTwoNamesTest + * @run main/othervm -Djmx.mxbean.multiname=true SameObjectTwoNamesTest + */ + +import javax.management.InstanceAlreadyExistsException; +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; + +public class SameObjectTwoNamesTest { + + public static void main(String[] args) throws Exception { + boolean expectException = + (System.getProperty("jmx.mxbean.multiname") == null); + try { + ObjectName objectName1 = new ObjectName("test:index=1"); + ObjectName objectName2 = new ObjectName("test:index=2"); + MBeanServer mbs = MBeanServerFactory.createMBeanServer(); + MXBC_SimpleClass01 mxBeanObject = new MXBC_SimpleClass01(); + + mbs.registerMBean(mxBeanObject, objectName1); + + mbs.registerMBean(mxBeanObject, objectName2); + + if (expectException) { + throw new Exception("TEST FAILED: " + + "InstanceAlreadyExistsException was not thrown"); + } else + System.out.println("Correctly got no exception with compat property"); + } catch (InstanceAlreadyExistsException e) { + if (expectException) { + System.out.println("Got expected InstanceAlreadyExistsException:"); + e.printStackTrace(System.out); + } else { + throw new Exception( + "TEST FAILED: Got exception even though compat property set", e); + } + } + System.out.println("TEST PASSED"); + } + + public interface MXBC_Simple01MXBean {} + + public static class MXBC_SimpleClass01 implements MXBC_Simple01MXBean {} + +} diff --git a/jdk/test/javax/management/mxbean/customtypes/CustomLongMXBean.java b/jdk/test/javax/management/mxbean/customtypes/CustomLongMXBean.java new file mode 100644 index 00000000000..5c1e4aef60a --- /dev/null +++ b/jdk/test/javax/management/mxbean/customtypes/CustomLongMXBean.java @@ -0,0 +1,31 @@ +/* + * 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. + * + * 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. + */ + +// CustomLongMXBean.java - see CustomTypeTest + +package customtypes; + +import javax.management.openmbean.MXBeanMappingFactoryClass; + +@MXBeanMappingFactoryClass(IntegerIsLongFactory.class) +public interface CustomLongMXBean extends CustomMXBean {} diff --git a/jdk/test/javax/management/mxbean/customtypes/CustomMXBean.java b/jdk/test/javax/management/mxbean/customtypes/CustomMXBean.java new file mode 100644 index 00000000000..0664827ca7b --- /dev/null +++ b/jdk/test/javax/management/mxbean/customtypes/CustomMXBean.java @@ -0,0 +1,30 @@ +/* + * 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. + * + * 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. + */ + +// CustomMXBean.java - see CustomTypeTest + +package customtypes; + +public interface CustomMXBean { + public Integer getX(); +} diff --git a/jdk/test/javax/management/mxbean/customtypes/IntegerIsLongFactory.java b/jdk/test/javax/management/mxbean/customtypes/IntegerIsLongFactory.java new file mode 100644 index 00000000000..e05d0d7b65b --- /dev/null +++ b/jdk/test/javax/management/mxbean/customtypes/IntegerIsLongFactory.java @@ -0,0 +1,74 @@ +/* + * 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. + * + * 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. + */ + +// IntegerIsLongFactory.java - see CustomTypeTest + +package customtypes; + +import java.io.InvalidObjectException; +import java.lang.reflect.Type; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingFactory; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.SimpleType; + +public class IntegerIsLongFactory implements MXBeanMappingFactory { + public MXBeanMapping forType(Type t, MXBeanMappingFactory f) + throws OpenDataException { + if (t == Integer.class) + return IntegerIsLongMapping; + else + return MXBeanMappingFactory.DEFAULT.forType(t, f); + } + + private static final MXBeanMapping IntegerIsLongMapping = + new IntegerIsLongMapping(); + + private static class IntegerIsLongMapping extends MXBeanMapping { + IntegerIsLongMapping() { + super(Integer.class, SimpleType.STRING); + } + + public Object fromOpenValue(Object openValue) + throws InvalidObjectException { + try { + return (Long) openValue; + } catch (Exception e) { + InvalidObjectException ioe = new InvalidObjectException("oops"); + ioe.initCause(e); + throw ioe; + } + } + + public Object toOpenValue(Object javaValue) throws OpenDataException { + try { + Integer i = (Integer) javaValue; + return new Long((int) i); + } catch (Exception e) { + OpenDataException ode = new OpenDataException("oops"); + ode.initCause(e); + throw ode; + } + } + } +} diff --git a/jdk/test/javax/management/mxbean/customtypes/IntegerIsStringFactory.java b/jdk/test/javax/management/mxbean/customtypes/IntegerIsStringFactory.java new file mode 100644 index 00000000000..c044bd3af8e --- /dev/null +++ b/jdk/test/javax/management/mxbean/customtypes/IntegerIsStringFactory.java @@ -0,0 +1,76 @@ +/* + * 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. + * + * 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. + */ + +// IntegerIsStringFactory.java - see CustomTypeTest + +package customtypes; + +import java.io.InvalidObjectException; +import java.lang.reflect.Type; +import javax.management.openmbean.MXBeanMapping; +import javax.management.openmbean.MXBeanMappingFactory; +import javax.management.openmbean.OpenDataException; +import javax.management.openmbean.SimpleType; + +public class IntegerIsStringFactory extends MXBeanMappingFactory { + @Override + public MXBeanMapping mappingForType(Type t, MXBeanMappingFactory f) + throws OpenDataException { + if (t == Integer.class) + return integerIsStringMapping; + else + return MXBeanMappingFactory.DEFAULT.mappingForType(t, f); + } + + private static final MXBeanMapping integerIsStringMapping = + new IntegerIsStringMapping(); + + private static class IntegerIsStringMapping extends MXBeanMapping { + IntegerIsStringMapping() { + super(Integer.class, SimpleType.STRING); + } + + public Object fromOpenValue(Object openValue) + throws InvalidObjectException { + try { + String s = (String) openValue; + return Integer.parseInt(s); + } catch (Exception e) { + InvalidObjectException ioe = new InvalidObjectException("oops"); + ioe.initCause(e); + throw ioe; + } + } + + public Object toOpenValue(Object javaValue) throws OpenDataException { + try { + Integer i = (Integer) javaValue; + return i.toString(); + } catch (Exception e) { + OpenDataException ode = new OpenDataException("oops"); + ode.initCause(e); + throw ode; + } + } + } +} diff --git a/jdk/test/javax/management/mxbean/customtypes/package-info.java b/jdk/test/javax/management/mxbean/customtypes/package-info.java new file mode 100644 index 00000000000..c9e213dcb29 --- /dev/null +++ b/jdk/test/javax/management/mxbean/customtypes/package-info.java @@ -0,0 +1,27 @@ +/* + * 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. + * + * 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-info.java - test package annotations for custom types + +@javax.management.openmbean.MXBeanMappingFactoryClass(IntegerIsStringFactory.class) +package customtypes; diff --git a/jdk/test/javax/management/query/QueryExpStringTest.java b/jdk/test/javax/management/query/QueryExpStringTest.java index be6a515b8fb..98d4ba9f61b 100644 --- a/jdk/test/javax/management/query/QueryExpStringTest.java +++ b/jdk/test/javax/management/query/QueryExpStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-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 @@ -121,14 +121,14 @@ public class QueryExpStringTest { eq, "(12345678) = (2.5)", between, "(12345678) between (2.5) and (2.5)", match, "attr like 'simpleString'", - initial, "attr like 'simpleString%'", - initialStar, "attr like '\\*%'", - initialPercent, "attr like '\\%%'", - any, "attr like '%simpleString%'", - anyStar, "attr like '%\\*%'", - anyPercent, "attr like '%\\%%'", - ffinal, "attr like '%simpleString'", - finalMagic, "attr like '%\\?\\*\\[\\\\'", + initial, "attr like 'simpleString*'", + initialStar, "attr like '\\**'", + initialPercent, "attr like '%*'", + any, "attr like '*simpleString*'", + anyStar, "attr like '*\\**'", + anyPercent, "attr like '*%*'", + ffinal, "attr like '*simpleString'", + finalMagic, "attr like '*\\?\\*\\[\\\\'", in, "12345678 in (12345678, 2.5)", and, "((12345678) > (2.5)) and ((12345678) < (2.5))", or, "((12345678) > (2.5)) or ((12345678) < (2.5))", @@ -207,7 +207,6 @@ public class QueryExpStringTest { exp + " like " + pat); } StringValueExp spat = (StringValueExp) pat; - spat = Query.value(translateMatch(spat.getValue())); return Query.match((AttributeValueExp) exp, spat); } @@ -226,28 +225,6 @@ public class QueryExpStringTest { throw new Exception("Expected in or like after expression"); } - private static String translateMatch(String s) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < s.length(); i++) { // logic not correct for wide chars - char c = s.charAt(i); - switch (c) { - case '\\': - sb.append(c).append(s.charAt(++i)); break; - case '%': - sb.append('*'); break; - case '_': - sb.append('?'); break; - case '*': - sb.append("\\*"); break; - case '?': - sb.append("\\?"); break; - default: - sb.append(c); break; - } - } - return sb.toString(); - } - private static QueryExp parseQueryAfterParen(String[] ss) throws Exception { /* This is very ugly. We might have "(q1) and (q2)" here, or diff --git a/jdk/test/javax/management/query/QueryNotifFilterTest.java b/jdk/test/javax/management/query/QueryNotifFilterTest.java index b22bf1baa5f..2f3dcaa314c 100644 --- a/jdk/test/javax/management/query/QueryNotifFilterTest.java +++ b/jdk/test/javax/management/query/QueryNotifFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/javax/management/query/QueryParseTest.java b/jdk/test/javax/management/query/QueryParseTest.java index a6004b5c150..62b64bf710e 100644 --- a/jdk/test/javax/management/query/QueryParseTest.java +++ b/jdk/test/javax/management/query/QueryParseTest.java @@ -347,30 +347,30 @@ public class QueryParseTest { // LIKE - "A like 'b%m'", + "A like 'b*m'", expectTrue("blim"), expectTrue("bm"), expectFalse(""), expectFalse("blimmo"), expectFalse("mmm"), - "A not like 'b%m'", + "A not like 'b*m'", expectFalse("blim"), expectFalse("bm"), expectTrue(""), expectTrue("blimmo"), expectTrue("mmm"), - "A like 'b_m'", + "A like 'b?m'", expectTrue("bim"), expectFalse("blim"), - "A like '%can''t%'", + "A like '*can''t*'", expectTrue("can't"), expectTrue("I'm sorry Dave, I'm afraid I can't do that"), expectFalse("cant"), expectFalse("can''t"), - "A like '\\%%\\%'", - expectTrue("%blim%"), expectTrue("%%"), - expectFalse("blim"), expectFalse("%asdf"), expectFalse("asdf%"), + "A like '\\**\\*'", + expectTrue("*blim*"), expectTrue("**"), + expectFalse("blim"), expectFalse("*asdf"), expectFalse("asdf*"), - "A LIKE '*%?_'", - expectTrue("*blim?!"), expectTrue("*?_"), - expectFalse("blim"), expectFalse("blim?"), - expectFalse("?*"), expectFalse("??"), expectFalse(""), expectFalse("?"), + "A LIKE '%*_?'", + expectTrue("%blim_?"), expectTrue("%_?"), expectTrue("%blim_!"), + expectFalse("blim"), expectFalse("blim_"), + expectFalse("_%"), expectFalse("??"), expectFalse(""), expectFalse("?"), Query.toString( Query.initialSubString(Query.attr("A"), Query.value("*?%_"))), @@ -483,7 +483,7 @@ public class QueryParseTest { // note the little {} at the end which means this is a subclass // and therefore QualifiedAttributeValue should return false. - MBeanServerDelegate.class.getName() + "#SpecificationName LIKE '%'", + MBeanServerDelegate.class.getName() + "#SpecificationName LIKE '*'", new Wrapped(new MBeanServerDelegate(), true), new Tester(new String[] {"SpecificationName"}, new Object[] {"JMX"}, false), @@ -497,7 +497,7 @@ public class QueryParseTest { "A.class.name = 'java.lang.String'", expectTrue("blim"), expectFalse(95), expectFalse((Object) null), - "A.canonicalName like 'JMImpl%:%'", + "A.canonicalName like 'JMImpl*:*'", expectTrue(MBeanServerDelegate.DELEGATE_NAME), expectFalse(ObjectName.WILDCARD), @@ -544,12 +544,15 @@ public class QueryParseTest { "a in b, c", "a in 23", "a in (2, 3", "a in (2, 3x)", "a like \"foo\"", "a like b", "a like 23", "like \"foo\"", "like b", "like 23", "like 'a:b'", - "5 like 'a'", "'a' like '%'", + "5 like 'a'", "'a' like '*'", "a not= b", "a not = b", "a not b", "a not b c", "a = +b", "a = +'b'", "a = +true", "a = -b", "a = -'b'", "a#5 = b", "a#'b' = c", "a instanceof b", "a instanceof 17", "a instanceof", - "a like 'oops\\'", "a like '[oops'", + // "a like 'oops\\'", "a like '[oops'", + // We don't check the above because Query.match doesn't. If LIKE + // rejected bad patterns then there would be some QueryExp values + // that could not be converted to a string and back. // Check that -Long.MIN_VALUE is an illegal constant. This is one more // than Long.MAX_VALUE and, like the Java language, we only allow it diff --git a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java index 936601b8cd8..eaefc9318d0 100644 --- a/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java +++ b/jdk/test/javax/management/relation/RelationNotificationSeqNoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-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 diff --git a/jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java b/jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java index ba9db820451..afb29bf7878 100644 --- a/jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java +++ b/jdk/test/javax/swing/JFileChooser/4252173/bug4252173.java @@ -1,5 +1,5 @@ /* - * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * 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 diff --git a/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java b/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java new file mode 100644 index 00000000000..2388137a3af --- /dev/null +++ b/jdk/test/javax/swing/JPopupMenu/6694823/bug6694823.java @@ -0,0 +1,122 @@ +/* + * Copyright 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. + * + * 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 6694823 + * @summary Checks that popup menu cannot be partially hidden + * by the task bar in applets. + * @author Mikhail Lapshin + * @run main bug6694823 + */ + +import javax.swing.*; +import java.awt.*; +import sun.awt.SunToolkit; + +public class bug6694823 { + private static JFrame frame; + private static JPopupMenu popup; + private static SunToolkit toolkit; + private static Insets screenInsets; + + public static void main(String[] args) throws Exception { + toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + createGui(); + } + }); + + // Get screen insets + screenInsets = toolkit.getScreenInsets(frame.getGraphicsConfiguration()); + if (screenInsets.bottom == 0) { + // This test is only for configurations with taskbar on the bottom + return; + } + + // Show popup as if from a standalone application + // The popup should be able to overlap the task bar + showPopup(false); + + // Emulate applet security restrictions + toolkit.realSync(); + System.setSecurityManager(new SecurityManager()); + + // Show popup as if from an applet + // The popup shouldn't overlap the task bar. It should be shifted up. + showPopup(true); + + toolkit.realSync(); + System.out.println("Test passed!"); + frame.dispose(); + } + + private static void createGui() { + frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + frame.setUndecorated(true); + + popup = new JPopupMenu("Menu"); + for (int i = 0; i < 7; i++) { + popup.add(new JMenuItem("MenuItem")); + } + JPanel panel = new JPanel(); + panel.setComponentPopupMenu(popup); + frame.add(panel); + + frame.setSize(200, 200); + } + + private static void showPopup(final boolean shouldBeShifted) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + // Place frame just above the task bar + Dimension screenSize = toolkit.getScreenSize(); + frame.setLocation(screenSize.width / 2, + screenSize.height - frame.getHeight() - screenInsets.bottom); + frame.setVisible(true); + + // Place popup over the task bar + Point frameLoc = frame.getLocationOnScreen(); + int x = 0; + int y = frame.getHeight() + - popup.getPreferredSize().height + screenInsets.bottom; + popup.show(frame, x, y); + + if (shouldBeShifted) { + if (popup.getLocationOnScreen() + .equals(new Point(frameLoc.x, frameLoc.y + y))) { + throw new RuntimeException("Popup is not shifted"); + } + } else { + if (!popup.getLocationOnScreen() + .equals(new Point(frameLoc.x, frameLoc.y + y))) { + throw new RuntimeException("Popup is unexpectedly shifted"); + } + } + popup.setVisible(false); + } + }); + } +} diff --git a/jdk/test/javax/swing/JSlider/4987336/box.gif b/jdk/test/javax/swing/JSlider/4987336/box.gif new file mode 100644 index 00000000000..69d8cdf9d42 Binary files /dev/null and b/jdk/test/javax/swing/JSlider/4987336/box.gif differ diff --git a/jdk/test/javax/swing/JSlider/4987336/bug4987336.html b/jdk/test/javax/swing/JSlider/4987336/bug4987336.html new file mode 100644 index 00000000000..b5c9a191f56 --- /dev/null +++ b/jdk/test/javax/swing/JSlider/4987336/bug4987336.html @@ -0,0 +1,9 @@ + + + +There are four Sliders. Each of them has a label with animated gif (a cup of coffee) +and a label with static image. + +Check that for every LAF animation works for all Sliders. + + diff --git a/jdk/test/javax/swing/JSlider/4987336/bug4987336.java b/jdk/test/javax/swing/JSlider/4987336/bug4987336.java new file mode 100644 index 00000000000..fdceec3b02a --- /dev/null +++ b/jdk/test/javax/swing/JSlider/4987336/bug4987336.java @@ -0,0 +1,120 @@ +/* + * 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. + * + * 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 4987336 + @summary JSlider doesn't show label's animated icon. + @author Pavel Porvatov + @run applet/manual=done bug4987336.html +*/ + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Hashtable; + +public class bug4987336 extends JApplet { + private static final String IMAGE_RES = "box.gif"; + + private static final String ANIM_IMAGE_RES = "cupanim.gif"; + + public void init() { + JPanel pnLafs = new JPanel(); + pnLafs.setLayout(new BoxLayout(pnLafs, BoxLayout.Y_AXIS)); + + ButtonGroup group = new ButtonGroup(); + + pnLafs.setBorder(new TitledBorder("Available Lafs")); + + for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) { + LafRadioButton comp = new LafRadioButton(lafInfo); + + pnLafs.add(comp); + group.add(comp); + } + + JPanel pnContent = new JPanel(); + + pnContent.setLayout(new BoxLayout(pnContent, BoxLayout.Y_AXIS)); + + pnContent.add(pnLafs); + pnContent.add(createSlider(true, IMAGE_RES, IMAGE_RES, ANIM_IMAGE_RES, ANIM_IMAGE_RES)); + pnContent.add(createSlider(false, IMAGE_RES, IMAGE_RES, ANIM_IMAGE_RES, ANIM_IMAGE_RES)); + pnContent.add(createSlider(true, ANIM_IMAGE_RES, null, IMAGE_RES, IMAGE_RES)); + pnContent.add(createSlider(false, ANIM_IMAGE_RES, null, IMAGE_RES, IMAGE_RES)); + + getContentPane().add(new JScrollPane(pnContent)); + } + + private static JSlider createSlider(boolean enabled, + String firstEnabledImage, String firstDisabledImage, + String secondEnabledImage, String secondDisabledImage) { + Hashtable dictionary = new Hashtable(); + + dictionary.put(0, createLabel(firstEnabledImage, firstDisabledImage)); + dictionary.put(1, createLabel(secondEnabledImage, secondDisabledImage)); + + JSlider result = new JSlider(0, 1); + + result.setLabelTable(dictionary); + result.setPaintLabels(true); + result.setEnabled(enabled); + + return result; + } + + private static JLabel createLabel(String enabledImage, String disabledImage) { + ImageIcon enabledIcon = enabledImage == null ? null : + new ImageIcon(bug4987336.class.getResource(enabledImage)); + + ImageIcon disabledIcon = disabledImage == null ? null : + new ImageIcon(bug4987336.class.getResource(disabledImage)); + + JLabel result = new JLabel(enabledImage == null && disabledImage == null ? "No image" : "Image", + enabledIcon, SwingConstants.LEFT); + + result.setDisabledIcon(disabledIcon); + + return result; + } + + private class LafRadioButton extends JRadioButton { + public LafRadioButton(final UIManager.LookAndFeelInfo lafInfo) { + super(lafInfo.getName(), lafInfo.getName().equals(UIManager.getLookAndFeel().getName())); + + addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + try { + UIManager.setLookAndFeel(lafInfo.getClassName()); + + SwingUtilities.updateComponentTreeUI(bug4987336.this); + } catch (Exception ex) { + // Ignore such errors + System.out.println("Cannot set LAF " + lafInfo.getName()); + } + } + }); + } + } +} diff --git a/jdk/test/javax/swing/JSlider/4987336/cupanim.gif b/jdk/test/javax/swing/JSlider/4987336/cupanim.gif new file mode 100644 index 00000000000..934d093c580 Binary files /dev/null and b/jdk/test/javax/swing/JSlider/4987336/cupanim.gif differ diff --git a/jdk/test/sun/java2d/DirectX/AccelPaintsTest/AccelPaintsTest.java b/jdk/test/sun/java2d/DirectX/AccelPaintsTest/AccelPaintsTest.java new file mode 100644 index 00000000000..f58ee5a9ea9 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/AccelPaintsTest/AccelPaintsTest.java @@ -0,0 +1,180 @@ +/* + * 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. + * + * 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 6659345 + * @summary Tests that various paints work correctly when preceeded by a + * textured operaiton. + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm AccelPaintsTest + * @run main/othervm -Dsun.java2d.opengl=True AccelPaintsTest + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.LinearGradientPaint; +import java.awt.MultipleGradientPaint.CycleMethod; +import java.awt.Paint; +import java.awt.RadialGradientPaint; +import java.awt.Rectangle; +import java.awt.Shape; +import java.awt.TexturePaint; +import java.awt.Transparency; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import javax.imageio.ImageIO; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class AccelPaintsTest extends JPanel { + BufferedImage bi = + new BufferedImage(80, 100, BufferedImage.TYPE_INT_ARGB_PRE); + + RadialGradientPaint rgp = + new RadialGradientPaint(100, 100, 100, new float[] {0f, 0.2f, 0.6f, 1f}, + new Color[] { Color.red, + Color.yellow, + Color.blue, + Color.green}, + CycleMethod.REFLECT); + LinearGradientPaint lgp = + new LinearGradientPaint(30, 30, 120, 130, new float[] {0f, 0.2f, 0.6f, 1f}, + new Color[] {Color.red, + Color.yellow, + Color.blue, + Color.green}); + GradientPaint gp = + new GradientPaint(30, 30, Color.red, 120, 130, Color.yellow, true); + + TexturePaint tp = + new TexturePaint(bi, new Rectangle2D.Float(30, 30, 120, 130)); + + + public AccelPaintsTest() { + Graphics g = bi.getGraphics(); + g.setColor(Color.blue); + g.fillRect(0, 0, bi.getWidth(), bi.getHeight()); + + setPreferredSize(new Dimension(250, 4*120)); + } + + private void renderWithPaint(Graphics2D g2d, Paint p) { + g2d.drawImage(bi, 130, 30, null); + + g2d.setPaint(p); + g2d.fillRect(30, 30, 80, 100); + } + + private void render(Graphics2D g2d) { + renderWithPaint(g2d, rgp); + g2d.translate(0, 100); + + renderWithPaint(g2d, lgp); + g2d.translate(0, 100); + + renderWithPaint(g2d, gp); + g2d.translate(0, 100); + + renderWithPaint(g2d, tp); + g2d.translate(0, 100); + } + + private void test() { + GraphicsConfiguration gc = + GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice().getDefaultConfiguration(); + if (gc.getColorModel().getPixelSize() < 16) { + System.out.println("<16 bit depth detected, test passed"); + return; + } + + VolatileImage vi = + gc.createCompatibleVolatileImage(250, 4*120, Transparency.OPAQUE); + BufferedImage res; + do { + vi.validate(gc); + Graphics2D g2d = vi.createGraphics(); + g2d.setColor(Color.white); + g2d.fillRect(0, 0, vi.getWidth(), vi.getHeight()); + + render(g2d); + + res = vi.getSnapshot(); + } while (vi.contentsLost()); + + for (int y = 0; y < bi.getHeight(); y++) { + for (int x = 0; x < bi.getWidth(); x++) { + if (res.getRGB(x, y) == Color.black.getRGB()) { + System.err.printf("Test FAILED: found black at %d,%d\n", + x, y); + try { + String fileName = "AccelPaintsTest.png"; + ImageIO.write(res, "png", new File(fileName)); + System.err.println("Dumped rendering to " + fileName); + } catch (IOException e) {} + throw new RuntimeException("Test FAILED: found black"); + } + } + } + } + + protected void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D)g; + + render(g2d); + } + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException + { + + if (args.length > 0 && args[0].equals("-show")) { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + JFrame f = new JFrame("RadialGradientTest"); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + AccelPaintsTest t = new AccelPaintsTest(); + f.add(t); + f.pack(); + f.setVisible(true); + } + }); + } else { + AccelPaintsTest t = new AccelPaintsTest(); + t.test(); + System.out.println("Test Passed."); + } + } +} diff --git a/jdk/test/sun/java2d/DirectX/AcceleratedScaleTest/AcceleratedScaleTest.java b/jdk/test/sun/java2d/DirectX/AcceleratedScaleTest/AcceleratedScaleTest.java new file mode 100644 index 00000000000..654d03ed722 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/AcceleratedScaleTest/AcceleratedScaleTest.java @@ -0,0 +1,135 @@ +/* + * Copyright 2006-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. + * + * 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.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/** + * @test + * @bug 6429665 + * @bug 6588884 + * @summary Tests that the transform is correctly handled + * @author Dmitri.Trembovetski area=Graphics + * @run main AcceleratedScaleTest + * @run main/othervm -Dsun.java2d.d3d=true AcceleratedScaleTest + * @run main/othervm -Dsun.java2d.opengl=true AcceleratedScaleTest + */ +public class AcceleratedScaleTest { + private static final int IMAGE_SIZE = 200; + private static VolatileImage destVI; + + private static void initVI(GraphicsConfiguration gc) { + int res; + if (destVI == null) { + res = VolatileImage.IMAGE_INCOMPATIBLE; + } else { + res = destVI.validate(gc); + } + if (res == VolatileImage.IMAGE_INCOMPATIBLE) { + if (destVI != null) destVI.flush(); + destVI = gc.createCompatibleVolatileImage(IMAGE_SIZE, IMAGE_SIZE); + destVI.validate(gc); + res = VolatileImage.IMAGE_RESTORED; + } + if (res == VolatileImage.IMAGE_RESTORED) { + Graphics vig = destVI.getGraphics(); + vig.setColor(Color.red); + vig.fillRect(0, 0, destVI.getWidth(), destVI.getHeight()); + vig.dispose(); + } + } + + public static void main(String[] args) { + Frame f = new Frame(); + f.pack(); + GraphicsConfiguration gc = f.getGraphicsConfiguration(); + if (gc.getColorModel().getPixelSize() < 16) { + System.out.printf("Bit depth: %d . Test considered passed.", + gc.getColorModel().getPixelSize()); + f.dispose(); + return; + } + + BufferedImage bi = + new BufferedImage(IMAGE_SIZE/4, IMAGE_SIZE/4, + BufferedImage.TYPE_INT_RGB); + Graphics2D g = (Graphics2D)bi.getGraphics(); + g.setColor(Color.red); + g.fillRect(0, 0, bi.getWidth(), bi.getHeight()); + BufferedImage snapshot; + do { + initVI(gc); + g = (Graphics2D)destVI.getGraphics(); + // "accelerate" BufferedImage + for (int i = 0; i < 5; i++) { + g.drawImage(bi, 0, 0, null); + } + g.setColor(Color.white); + g.fillRect(0, 0, destVI.getWidth(), destVI.getHeight()); + + // this will force the use of Transform primitive instead of + // Scale (the latter doesn't do bilinear filtering required by + // VALUE_RENDER_QUALITY, which triggers the bug in D3D pipeline + g.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g.drawImage(bi, 0, 0, destVI.getWidth(), destVI.getHeight(), null); + g.fillRect(0, 0, destVI.getWidth(), destVI.getHeight()); + + g.drawImage(bi, 0, 0, destVI.getWidth(), destVI.getHeight(), null); + + snapshot = destVI.getSnapshot(); + } while (destVI.contentsLost()); + + f.dispose(); + int whitePixel = Color.white.getRGB(); + for (int y = 0; y < snapshot.getHeight(); y++) { + for (int x = 0; x < snapshot.getWidth(); x++) { + if (snapshot.getRGB(x, y) == whitePixel) { + System.out.printf("Found untouched pixel at %dx%d\n", x, y); + System.out.println("Dumping the dest. image to " + + "AcceleratedScaleTest_dst.png"); + try { + ImageIO.write(snapshot, "png", + new File("AcceleratedScaleTest_dst.png")); + } catch (IOException ex) { + ex.printStackTrace(); + } + throw new RuntimeException("Test failed."); + } + } + } + System.out.println("Test Passed."); + } + +} diff --git a/jdk/test/sun/java2d/DirectX/IAEforEmptyFrameTest/IAEforEmptyFrameTest.java b/jdk/test/sun/java2d/DirectX/IAEforEmptyFrameTest/IAEforEmptyFrameTest.java new file mode 100644 index 00000000000..ffe9eb2de68 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/IAEforEmptyFrameTest/IAEforEmptyFrameTest.java @@ -0,0 +1,50 @@ +/* + * 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. + * + * 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 6668439 + * @summary Verifies that no exceptions are thrown when frame is resized to 0x0 + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm IAEforEmptyFrameTest + * @run main/othervm -Dsun.java2d.d3d=false IAEforEmptyFrameTest + */ +import javax.swing.JFrame; + +public class IAEforEmptyFrameTest { + public static void main(String[] args) { + JFrame f = null; + try { + f = new JFrame("IAEforEmptyFrameTest"); + f.setUndecorated(true); + f.setBounds(100, 100, 320, 240); + f.setVisible(true); + try { Thread.sleep(1000); } catch (Exception z) {} + f.setBounds(0, 0, 0, 0); + try { Thread.sleep(1000); } catch (Exception z) {} + f.dispose(); + } finally { + f.dispose(); + }; + } +} diff --git a/jdk/test/sun/java2d/DirectX/InfiniteValidationLoopTest/InfiniteValidationLoopTest.java b/jdk/test/sun/java2d/DirectX/InfiniteValidationLoopTest/InfiniteValidationLoopTest.java new file mode 100644 index 00000000000..a520a388056 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/InfiniteValidationLoopTest/InfiniteValidationLoopTest.java @@ -0,0 +1,116 @@ +/* + * 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. + * + * 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 6648018 + * @summary Tests that we don't run into infinite validation loop when copying + a VolatileImage to the screen + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm InfiniteValidationLoopTest + * @run main/othervm -Dsun.java2d.d3d=false InfiniteValidationLoopTest + */ +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsConfiguration; +import static java.awt.image.VolatileImage.*; +import java.awt.image.VolatileImage; +import java.util.concurrent.CountDownLatch; + +public class InfiniteValidationLoopTest extends Frame { + private static volatile boolean failed = false; + private static final int LOOP_THRESHOLD = 50; + private static volatile CountDownLatch latch; + private VolatileImage vi; + + public InfiniteValidationLoopTest() { + super("InfiniteValidationLoopTest"); + } + + @Override + public void paint(Graphics g) { + try { + runTest(g); + } finally { + latch.countDown(); + } + } + + private void runTest(Graphics g) { + int status = IMAGE_OK; + int count1 = 0; + do { + GraphicsConfiguration gc = getGraphicsConfiguration(); + int count2 = 0; + while (vi == null || (status = vi.validate(gc)) != IMAGE_OK) { + if (++count2 > LOOP_THRESHOLD) { + System.err.println("Infinite loop detected: count2="+count2); + failed = true; + return; + } + if (vi == null || status == IMAGE_INCOMPATIBLE) { + if (vi != null) { vi.flush(); vi = null; } + vi = gc.createCompatibleVolatileImage(100, 100); + continue; + } + if (status == IMAGE_RESTORED) { + Graphics gg = vi.getGraphics(); + gg.setColor(Color.green); + gg.fillRect(0, 0, vi.getWidth(), vi.getHeight()); + break; + } + } + g.drawImage(vi, getInsets().left, getInsets().top, null); + if (++count1 > LOOP_THRESHOLD) { + System.err.println("Infinite loop detected: count1="+count1); + failed = true; + return; + } + } while (vi.contentsLost()); + } + + public static void main(String[] args) { + latch = new CountDownLatch(1); + InfiniteValidationLoopTest t1 = new InfiniteValidationLoopTest(); + t1.pack(); + t1.setSize(200, 200); + t1.setVisible(true); + try { latch.await(); } catch (InterruptedException ex) {} + t1.dispose(); + + latch = new CountDownLatch(1); + t1 = new InfiniteValidationLoopTest(); + t1.pack(); + t1.setSize(50, 50); + t1.setVisible(true); + try { latch.await(); } catch (InterruptedException ex) {} + t1.dispose(); + + if (failed) { + throw new + RuntimeException("Failed: infinite validattion loop detected"); + } + System.out.println("Test PASSED"); + } +} diff --git a/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java b/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java new file mode 100644 index 00000000000..65439f90961 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/OnScreenRenderingResizeTest/OnScreenRenderingResizeTest.java @@ -0,0 +1,209 @@ +/* + * 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. + * + * 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 6664068 6666931 + * @summary Tests that resizing a window to which a tight loop is rendering + * doesn't produce artifacts or crashes + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm OnScreenRenderingResizeTest + * @run main/othervm -Dsun.java2d.d3d=false OnScreenRenderingResizeTest + */ + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class OnScreenRenderingResizeTest { + + private static volatile boolean done = false; + private static volatile boolean nocheck = false; + + private static final int FRAME_W = 256; + private static final int FRAME_H = 256; + private static final int IMAGE_W = 128; + private static final int IMAGE_H = 128; + private static long RUN_TIME = 1000*20; + + private static final Color renderColor = Color.green; + private static final Color bgColor = Color.white; + + public static void main(String[] args) { + + for (String arg : args) { + if ("-inf".equals(arg)) { + System.err.println("Test will run indefinitely"); + RUN_TIME = Long.MAX_VALUE; + } else if ("-nocheck".equals(arg)) { + System.err.println("Test will not check rendering results"); + nocheck = true; + } else { + System.err.println("Usage: OnScreenRenderingResizeTest [-inf][-nocheck]"); + } + } + + BufferedImage output = + new BufferedImage(IMAGE_W, IMAGE_H, BufferedImage.TYPE_INT_RGB); + output.setAccelerationPriority(0.0f); + Graphics g = output.getGraphics(); + g.setColor(renderColor); + g.fillRect(0, 0, output.getWidth(), output.getHeight()); + + final Frame frame = new Frame("OnScreenRenderingResizeTest") { + public void paint(Graphics g) {} + public void update(Graphics g) {} + }; + frame.setBackground(bgColor); + frame.pack(); + frame.setSize(FRAME_W, FRAME_H); + frame.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + done = true; + } + }); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + frame.setVisible(true); + } + }); + // wait for Vista's effects to complete + Thread.sleep(2000); + } catch (Exception ex) { + ex.printStackTrace(); + } + + GraphicsConfiguration gc = frame.getGraphicsConfiguration(); + int maxW = gc.getBounds().width /2; + int maxH = gc.getBounds().height/2; + int minW = frame.getWidth(); + int minH = frame.getHeight(); + int incW = 10, incH = 10, cnt = 0; + Robot robot = null; + if (!nocheck && gc.getColorModel().getPixelSize() > 8) { + try { + robot = new Robot(); + } catch (AWTException ex) { + System.err.println("Robot creation failed, continuing."); + } + } else { + System.err.println("No screen rendering checks."); + } + + VolatileImage vi = gc.createCompatibleVolatileImage(512, 512); + vi.validate(gc); + + long timeStarted = System.currentTimeMillis(); + while (!done && (System.currentTimeMillis() - timeStarted) < RUN_TIME) { + + if (++cnt > 100) { + int w = frame.getWidth() + incW; + int h = frame.getHeight() + incH; + if (w < minW || w > maxW ) { + incW = -incW; + } + if (h < minH || h > maxH ) { + incH = -incH; + } + frame.setSize(w, h); + cnt = 0; + } + + // try to put the device into non-default state, for example, + // this operation below will set the transform + vi.validate(gc); + Graphics2D vig = (Graphics2D)vi.getGraphics(); + vig.rotate(30.0f, vi.getWidth()/2, vi.getHeight()/2); + vig.drawImage(output, 0, 0, + vi.getWidth(), vi.getHeight(), null); + + Insets in = frame.getInsets(); + frame.getGraphics().drawImage(output, in.left, in.top, null); + if (cnt == 90 && robot != null) { + // area where we blitted to should be either white or green + Point p = frame.getLocationOnScreen(); + p.move(in.left+10, in.top+10); + BufferedImage bi = + robot.createScreenCapture( + new Rectangle(p.x, p.y, IMAGE_W/2, IMAGE_H/2)); + int accepted1[] = { Color.white.getRGB(), Color.green.getRGB()}; + checkBI(bi, accepted1); + + // the are where we didn't render should stay white + p = frame.getLocationOnScreen(); + p.move(in.left, in.top+IMAGE_H+5); + bi = robot.createScreenCapture( + new Rectangle(p.x, p.y, + frame.getWidth()-in.left-in.right, + frame.getHeight()-in.top-in.bottom-5-IMAGE_H)); + int accepted2[] = { Color.white.getRGB() }; + checkBI(bi, accepted1); + } + + Thread.yield(); + } + frame.dispose(); + System.out.println("Test Passed"); + } + + private static void checkBI(BufferedImage bi, int accepted[]) { + for (int x = 0; x < bi.getWidth(); x++) { + for (int y = 0; y < bi.getHeight(); y++) { + int pix = bi.getRGB(x, y); + boolean found = false; + for (int acc : accepted) { + if (pix == acc) { + found = true; + break; + } + } + if (!found) { + try { + String name = "OnScreenRenderingResizeTest.png"; + ImageIO.write(bi, "png", new File(name)); + System.out.println("Screen shot file: " + name); + } catch (IOException ex) {} + + throw new + RuntimeException("Test failed at " + x + "-" + y + + " rgb=0x" + Integer.toHexString(pix)); + } + } + } + } +} diff --git a/jdk/test/sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java b/jdk/test/sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java new file mode 100644 index 00000000000..658f42ac939 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/OverriddenInsetsTest/OverriddenInsetsTest.java @@ -0,0 +1,150 @@ +/* + * 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. + * + * 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 6694230 + * @summary Tests that components overriding getInsets paint correctly + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm OverriddenInsetsTest + * @run main/othervm -Dsun.java2d.opengl=True OverriddenInsetsTest + */ + +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.concurrent.CountDownLatch; +import javax.imageio.ImageIO; + +public class OverriddenInsetsTest { + + public static final Insets INSETS1 = new Insets(25,25,0,0); + public static final Insets INSETS2 = new Insets(100,100,0,0); + static final CountDownLatch lock = new CountDownLatch(1); + static boolean failed = false; + + public static void main(String[] args) { + + if (GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice().getDefaultConfiguration(). + getColorModel().getPixelSize() < 16) + { + System.out.println("<16 bit mode detected, test passed"); + } + + final Frame f = new Frame("OverriddenInsetsTest"); + f.setSize(260,260); + + f.addWindowListener(new WindowAdapter() { + public void windowClosing(WindowEvent e) { + f.setVisible(false); + System.exit(0); + } + }); + + f.setBackground(Color.gray); + Panel p1 = new Panel() { + public Insets getInsets() { + return INSETS1; + } + }; + p1.setLayout(null); + p1.setSize(250, 250); + + Panel p = new Panel(){ + @Override + public Insets getInsets() { + return INSETS2; + } + + public void paint(Graphics g) { + // make sure Vista is done with its effects + try { + Thread.sleep(2000); + } catch (InterruptedException ex) {} + g.setColor(Color.red); + g.drawRect(0,0,getWidth()-1,getHeight()-1 ); + g.setColor(Color.blue); + g.fillRect(0,0,getWidth()/2,getHeight()/2); + + Point p = getLocationOnScreen(); + try { + Robot r = new Robot(); + BufferedImage bi = + r.createScreenCapture(new + Rectangle(p.x, p.y, getWidth()/2, getHeight()/2)); + for (int y = 0; y < bi.getHeight(); y++) { + for (int x = 0; x < bi.getWidth(); x++) { + if (bi.getRGB(x, y) != Color.blue.getRGB()) { + failed = true; + System.err.printf("Test failed at %d %d c=%x\n", + x, y, bi.getRGB(x, y)); + String name = "OverriddenInsetsTest_res.png"; + try { + ImageIO.write(bi, "png", new File(name)); + System.out.println("Dumped res to: "+name); + } catch (IOException e) {} + return; + } + } + } + } catch (Exception e) { + failed = true; + } finally { + lock.countDown(); + } + } + }; + p.setSize(200, 200); + + p1.add(p); + p.setLocation(50, 50); + f.add(p1); + f.setVisible(true); + + try { + lock.await(); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + if (args.length <= 0 || !"-show".equals(args[0])) { + f.dispose(); + } + + if (failed) { + throw new RuntimeException("Test FAILED."); + } + System.out.println("Test PASSED"); + } +} diff --git a/jdk/test/sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java b/jdk/test/sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java new file mode 100644 index 00000000000..e5f44ab0d46 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/RenderingToCachedGraphicsTest/RenderingToCachedGraphicsTest.java @@ -0,0 +1,174 @@ +/* + * 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. + * + * 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 6648018 6652662 + * @summary Verifies that rendering to a cached onscreen Graphics works + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm RenderingToCachedGraphicsTest + * @run main/othervm -Dsun.java2d.d3d=false RenderingToCachedGraphicsTest + */ +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsEnvironment; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.image.BufferStrategy; +import java.awt.image.BufferedImage; +import static java.awt.image.VolatileImage.*; +import java.awt.image.VolatileImage; +import java.io.File; +import java.util.concurrent.CountDownLatch; +import javax.imageio.ImageIO; + +public class RenderingToCachedGraphicsTest extends Frame { + private static volatile boolean failed = false; + private static volatile CountDownLatch latch; + private Graphics cachedGraphics; + private Canvas renderCanvas; + + public RenderingToCachedGraphicsTest() { + super("Test starts in 2 seconds"); + renderCanvas = new Canvas() { + @Override + public void paint(Graphics g) { + if (getWidth() < 100 || getHeight() < 100) { + repaint(); + return; + } + // wait for a bit so that Vista's Window manager's animation + // effects on window's appearance are completed (6652662) + try { Thread.sleep(2000); } catch (InterruptedException ex) {} + + try { + runTest(); + } catch (Throwable t) { + failed = true; + } finally { + latch.countDown(); + } + } + @Override + public void update(Graphics g) {} + }; + + add("Center", renderCanvas); + } + + private void runTest() { + // this will cause screen update manager to dump the accelerated surface + // for this canvas + renderCanvas.createBufferStrategy(2); + BufferStrategy bs = renderCanvas.getBufferStrategy(); + do { + Graphics bsg = bs.getDrawGraphics(); + bsg.setColor(Color.blue); + bsg.fillRect(0, 0, + renderCanvas.getWidth(), renderCanvas.getHeight()); + } while (bs.contentsLost() || bs.contentsRestored()); + + // grab the "unaccelerated" onscreen surface + cachedGraphics = renderCanvas.getGraphics(); + cachedGraphics.setColor(Color.red); + cachedGraphics.fillRect(0, 0, getWidth(), getHeight()); + + bs.dispose(); + bs = null; + // now the update manager should be able to accelerate onscreen + // rendering to it again + + cachedGraphics.setColor(Color.green); + // this causes restoration of the new accelerated onscreen surface + // (it is created in "lost" state) + cachedGraphics.fillRect(0, 0, + renderCanvas.getWidth(), + renderCanvas.getHeight()); + Toolkit.getDefaultToolkit().sync(); + // and now we should be able to render to it + cachedGraphics.fillRect(0, 0, + renderCanvas.getWidth(), + renderCanvas.getHeight()); + Toolkit.getDefaultToolkit().sync(); + + Robot robot = null; + try { + robot = new Robot(); + } catch (Exception e) { + e.printStackTrace(); + failed = true; + return; + } + + Point p = renderCanvas.getLocationOnScreen(); + Rectangle r = new Rectangle(p.x, p.y, + renderCanvas.getWidth(), + renderCanvas.getHeight()); + BufferedImage bi = robot.createScreenCapture(r); + for (int y = 0; y < bi.getHeight(); y++) { + for (int x = 0; x < bi.getWidth(); x++) { + if (bi.getRGB(x, y) != Color.green.getRGB()) { + System.err.println("Colors mismatch!"); + String name = "RenderingToCachedGraphicsTest.png"; + try { + ImageIO.write(bi, "png", new File(name)); + System.err.println("Dumped grabbed image to: "+name); + } catch (Exception e) {} + failed = true; + return; + } + } + } + } + + public static void main(String[] args) { + int depth = GraphicsEnvironment.getLocalGraphicsEnvironment(). + getDefaultScreenDevice().getDefaultConfiguration(). + getColorModel().getPixelSize(); + if (depth < 16) { + System.out.println("Test PASSED (depth < 16bit)"); + return; + } + + latch = new CountDownLatch(1); + RenderingToCachedGraphicsTest t1 = new RenderingToCachedGraphicsTest(); + t1.pack(); + t1.setSize(300, 300); + t1.setVisible(true); + + try { latch.await(); } catch (InterruptedException ex) {} + t1.dispose(); + + if (failed) { + throw new + RuntimeException("Failed: rendering didn't show up"); + } + System.out.println("Test PASSED"); + } +} diff --git a/jdk/test/sun/java2d/DirectX/StrikeDisposalCrashTest/StrikeDisposalCrashTest.java b/jdk/test/sun/java2d/DirectX/StrikeDisposalCrashTest/StrikeDisposalCrashTest.java new file mode 100644 index 00000000000..6d0e0794105 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/StrikeDisposalCrashTest/StrikeDisposalCrashTest.java @@ -0,0 +1,109 @@ +/* + * 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. + * + * 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 6705443 + * @summary tests that we don't crash during exit if font strikes were disposed + * during the lifetime of the application + * + * @run main/othervm -Dsun.java2d.font.reftype=weak StrikeDisposalCrashTest + * @run main/othervm -Dsun.java2d.font.reftype=weak -Dsun.java2d.noddraw=true StrikeDisposalCrashTest + * @run main/othervm -Dsun.java2d.font.reftype=weak -Dsun.java2d.opengl=True StrikeDisposalCrashTest + */ + +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.RenderingHints; +import java.awt.Toolkit; +import java.awt.image.VolatileImage; + +public class StrikeDisposalCrashTest { + + public static void main(String[] args) { + System.setProperty("sun.java2d.font.reftype", "weak"); + + GraphicsDevice gd[] = + GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); + + Frame frames[] = new Frame[gd.length]; + for (int i = 0; i < frames.length; i++) { + GraphicsConfiguration gc = gd[i].getDefaultConfiguration(); + Frame f = new Frame("Frame on "+gc, gc); + f.setSize(100, 100); + f.setLocation(gc.getBounds().x, gc.getBounds().y); + f.pack(); + frames[i] = f; + } + + Font f1 = new Font("Dialog", Font.PLAIN, 10); + Font f2 = new Font("Dialog", Font.ITALIC, 12); + + for (int i = 0; i < frames.length/2; i++) { + // making sure the glyphs are cached in the accel. cache on + // one frame, then the other + renderText(frames[i], f1); + renderText(frames[frames.length -1 - i], f1); + + // and now the other way around, with different glyphs + renderText(frames[frames.length -1 - i], f2); + renderText(frames[i], f2); + } + + // try to force strike disposal (note that we have to use + // -Dsun.java2d.font.reftype=weak to facilitate the disposal) + + System.gc(); + System.runFinalization(); + System.gc(); + System.runFinalization(); + + for (Frame f : frames) { + f.dispose(); + } + + System.err.println("Exiting. If the test crashed after this it FAILED"); + } + + private static final String text = + "The quick brown fox jumps over the lazy dog 1234567890"; + private static void renderText(Frame frame, Font f1) { + VolatileImage vi = frame.createVolatileImage(256, 32); + vi.validate(frame.getGraphicsConfiguration()); + + Graphics2D g = vi.createGraphics(); + g.setFont(f1); + g.drawString(text, 0, vi.getHeight()/2); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + g.drawString(text, 0, vi.getHeight()/2); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); + g.drawString(text, 0, vi.getHeight()/2); + Toolkit.getDefaultToolkit().sync(); + } +} diff --git a/jdk/test/sun/java2d/DirectX/SwingOnScreenScrollingTest/SwingOnScreenScrollingTest.java b/jdk/test/sun/java2d/DirectX/SwingOnScreenScrollingTest/SwingOnScreenScrollingTest.java new file mode 100644 index 00000000000..5f2d5cb056d --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/SwingOnScreenScrollingTest/SwingOnScreenScrollingTest.java @@ -0,0 +1,146 @@ +/* + * 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. + * + * 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 6630702 + * @summary Tests that scrolling after paint() is performed correctly. + * This is really only applicable to Vista + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm SwingOnScreenScrollingTest + * run main/othervm -Dsun.java2d.opengl=True SwingOnScreenScrollingTest + */ + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.Graphics; +import java.awt.GraphicsEnvironment; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.lang.reflect.InvocationTargetException; +import javax.imageio.ImageIO; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JScrollPane; + +public class SwingOnScreenScrollingTest extends JPanel { + + static JScrollPane pane; + static SwingOnScreenScrollingTest test; + + public SwingOnScreenScrollingTest() { + } + + public static void main(String[] args) { + int size = GraphicsEnvironment. + getLocalGraphicsEnvironment(). + getDefaultScreenDevice(). + getDefaultConfiguration().getColorModel().getPixelSize(); + if (size < 16) { + System.err.println("<16 bit display mode detected. Test PASSED"); + return; + } + + final JFrame f = new JFrame("SwingOnScreenScrollingTest"); + try { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + test = new SwingOnScreenScrollingTest(); + pane = new JScrollPane(test); + f.add(pane); + f.pack(); + f.setSize(100, 200); + f.setVisible(true); + } + }); + } catch (InvocationTargetException ex) { + ex.printStackTrace(); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + try { + Thread.sleep(500); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + EventQueue.invokeLater(new Runnable() { + public void run() { + BufferedImage bi; + bi = new BufferedImage(100, 300, + BufferedImage.TYPE_INT_RGB); + Graphics gg = bi.getGraphics(); + test.paint(gg); + for (int y = 80; y < 200; y +=10) { + test.scrollRectToVisible(new Rectangle(0, y, 100, 100)); + try { + Thread.sleep(200); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + Point p = pane.getViewport().getLocationOnScreen(); + Robot r = null; + try { + r = new Robot(); + } catch (AWTException ex) { + throw new RuntimeException(ex); + } + bi = r.createScreenCapture(new Rectangle(p.x+5, p.y+5, 30, 30)); + for (int y = 0; y < bi.getHeight(); y++) { + for (int x = 0; x < bi.getHeight(); x++) { + int rgb = bi.getRGB(x, y); + if (bi.getRGB(x, y) != Color.red.getRGB()) { + System.err.printf("Test Failed at (%d,%d) c=0x%x\n", + x, y, rgb); + try { + String name = + "SwingOnScreenScrollingTest_out.png"; + ImageIO.write(bi, "png", new File(name)); + System.err.println("Wrote grabbed image to "+ + name); + } catch (Throwable ex) {} + throw new RuntimeException("Test failed"); + } + } + } + System.out.println("Test PASSED."); + f.dispose(); + } + }); + } + + protected void paintComponent(Graphics g) { + g.setColor(Color.green); + g.fillRect(0, 0, getWidth(), 100); + g.setColor(Color.red); + g.fillRect(0, 100, getWidth(), getHeight()-100); + } + + public Dimension getPreferredSize() { + return new Dimension(100, 300); + } +} diff --git a/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java b/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java new file mode 100644 index 00000000000..3929a59c869 --- /dev/null +++ b/jdk/test/sun/java2d/DirectX/TransformedPaintTest/TransformedPaintTest.java @@ -0,0 +1,219 @@ +/* + * 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. + * + * 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 6689025 + * @summary Tests that transformed Paints are rendered correctly + * @author Dmitri.Trembovetski@sun.com: area=Graphics + * @run main/othervm TransformedPaintTest + * @run main/othervm -Dsun.java2d.opengl=True TransformedPaintTest + */ + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.GradientPaint; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.LinearGradientPaint; +import java.awt.MultipleGradientPaint.CycleMethod; +import java.awt.Paint; +import java.awt.RadialGradientPaint; +import java.awt.TexturePaint; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.awt.image.VolatileImage; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import javax.imageio.ImageIO; +import javax.swing.JFrame; +import javax.swing.JPanel; + +public class TransformedPaintTest { + + private static enum PaintType { + COLOR, + GRADIENT, + LINEAR_GRADIENT, + RADIAL_GRADIENT, + TEXTURE + }; + + private static final int CELL_SIZE = 100; + private static final int R_WIDTH = 3 * CELL_SIZE; + private static final int R_HEIGHT = PaintType.values().length * CELL_SIZE; + + private Paint createPaint(PaintType type, int startx, int starty, + int w, int h) + { + // make sure that the blue color doesn't show up when filling a + // w by h rect + w++; h++; + + int endx = startx + w; + int endy = starty + h; + Rectangle2D.Float r = new Rectangle2D.Float(startx, starty, w, h); + switch (type) { + case COLOR: return Color.red; + case GRADIENT: return + new GradientPaint(startx, starty, Color.red, + endx, endy, Color.green); + case LINEAR_GRADIENT: return + new LinearGradientPaint(startx, starty, endx, endy, + new float[] { 0.0f, 0.999f, 1.0f }, + new Color[] { Color.red, Color.green, Color.blue }); + case RADIAL_GRADIENT: return + new RadialGradientPaint(startx, starty, + (float)Math.sqrt(w * w + h * h), + new float[] { 0.0f, 0.999f, 1.0f }, + new Color[] { Color.red, Color.green, Color.blue }, + CycleMethod.NO_CYCLE); + case TEXTURE: { + BufferedImage bi = + new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); + Graphics2D g = (Graphics2D) bi.getGraphics(); + g.setPaint(createPaint(PaintType.LINEAR_GRADIENT, 0, 0, w, h)); + g.fillRect(0, 0, w, h); + return new TexturePaint(bi, r); + } + } + return Color.green; + } + + private void renderLine(PaintType type, Graphics2D g, + int startx, int starty, int w, int h) + { + Paint p = createPaint(type, startx, starty, w, h); + g.setPaint(p); + + // first, no transform + g.fillRect(startx, starty, w, h); + + // translation only + g.translate(w, 0); + g.fillRect(startx, starty, w, h); + g.translate(-w, 0); + + // complex transform + g.translate(startx + w*2, starty); + g.rotate(Math.toRadians(90), w/2, h/2); + g.translate(-startx, -starty); + g.fillRect(startx, starty, w, h); + } + + private void render(Graphics2D g, int w, int h) { + int paintTypes = PaintType.values().length; + int ystep = h / paintTypes; + int y = 0; + + for (PaintType type : PaintType.values()) { + renderLine(type, (Graphics2D)g.create(), + 0, y, h / paintTypes, h / paintTypes); + y += ystep; + } + } + + private void checkBI(BufferedImage bi) { + for (int y = 0; y < bi.getHeight(); y++) { + for (int x = 0; x < bi.getWidth(); x++) { + if (bi.getRGB(x, y) == Color.blue.getRGB()) { + try { + String fileName = "TransformedPaintTest_res.png"; + ImageIO.write(bi, "png", new File(fileName)); + System.err.println("Dumped image to: " + fileName); + } catch (IOException ex) {} + throw new RuntimeException("Test failed, blue color found"); + } + } + } + } + + private void runTest() { + GraphicsConfiguration gc = GraphicsEnvironment. + getLocalGraphicsEnvironment().getDefaultScreenDevice(). + getDefaultConfiguration(); + + if (gc.getColorModel().getPixelSize() < 16) { + System.out.println("8-bit desktop depth found, test passed"); + return; + } + + VolatileImage vi = gc.createCompatibleVolatileImage(R_WIDTH, R_HEIGHT); + BufferedImage bi = null; + do { + vi.validate(gc); + Graphics2D g = vi.createGraphics(); + render(g, vi.getWidth(), vi.getHeight()); + bi = vi.getSnapshot(); + } while (vi.contentsLost()); + + checkBI(bi); + System.out.println("Test PASSED."); + } + + private static void showFrame(final TransformedPaintTest t) { + JFrame f = new JFrame("TransformedPaintTest"); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + final BufferedImage bi = + new BufferedImage(R_WIDTH, R_HEIGHT, BufferedImage.TYPE_INT_RGB); + JPanel p = new JPanel() { + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2d = (Graphics2D) g; + t.render(g2d, R_WIDTH, R_HEIGHT); + t.render(bi.createGraphics(), R_WIDTH, R_HEIGHT); + g2d.drawImage(bi, R_WIDTH + 5, 0, null); + + g.setColor(Color.black); + g.drawString("Rendered to Back Buffer", 10, 20); + g.drawString("Rendered to BufferedImage", R_WIDTH + 15, 20); + } + }; + p.setPreferredSize(new Dimension(2 * R_WIDTH + 5, R_HEIGHT)); + f.add(p); + f.pack(); + f.setVisible(true); + } + + public static void main(String[] args) throws + InterruptedException, InvocationTargetException + { + boolean show = (args.length > 0 && "-show".equals(args[0])); + + final TransformedPaintTest t = new TransformedPaintTest(); + if (show) { + EventQueue.invokeAndWait(new Runnable() { + public void run() { + showFrame(t); + } + }); + } else { + t.runTest(); + } + } +} diff --git a/jdk/test/sun/java2d/GdiRendering/InsetClipping.java b/jdk/test/sun/java2d/GdiRendering/InsetClipping.java new file mode 100644 index 00000000000..fbaf71956dd --- /dev/null +++ b/jdk/test/sun/java2d/GdiRendering/InsetClipping.java @@ -0,0 +1,112 @@ +/* + * Copyright 2003-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. + * + * 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 4873505 6588884 + * @author cheth + * @summary verifies that drawImage behaves the bounds of a complex + * clip shape. This was a problem with our GDI renderer on Windows, where + * we would ignore the window insets. + * @run main InsetClipping +*/ + +/** + * This test works by setting up a clip area that equals the visible area + * of the Frame. When we perform any rendering operation to that window, + * we should not see the results of the operation because they should be + * clipped out. We create an Image with one color (red) and use a + * different background fill color (blue). We fill the area with the + * background color, then set the clip, then draw the image; if we detect + * the image color at pixel (0, 0) then we did not clip correctly and the + * test fails. + */ + +import java.awt.*; +import java.awt.geom.*; +import java.awt.image.*; + + +public class InsetClipping extends Frame { + BufferedImage image; + Area area; + static boolean painted = false; + static Color imageColor = Color.red; + static Color fillColor = Color.blue; + + public InsetClipping() { + + image = new BufferedImage( 300, 300,BufferedImage.TYPE_INT_RGB); + Graphics g2 = image.createGraphics(); + g2.setColor(imageColor); + g2.fillRect(0,0, 300,300); + } + + public void paint(Graphics g) { + Insets insets = getInsets(); + area = new Area( new Rectangle(0,0, getWidth(), getHeight())); + area.subtract(new Area(new Rectangle(insets.left, insets.top, + getWidth() - insets.right, + getHeight() - insets.bottom))); + g.setColor(fillColor); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setClip(area); + g.drawImage(image, 0, 0, null); + painted = true; + } + + public static void main(String args[]) { + InsetClipping clipTest = new InsetClipping(); + clipTest.setSize(300, 300); + clipTest.setVisible(true); + while (!painted) { + try { + Thread.sleep(100); + } catch (Exception e) {} + } + try { + Robot robot = new Robot(); + Point clientLoc = clipTest.getLocationOnScreen(); + Insets insets = clipTest.getInsets(); + clientLoc.x += insets.left; + clientLoc.y += insets.top; + BufferedImage clientPixels = + robot.createScreenCapture(new Rectangle(clientLoc.x, + clientLoc.y, + clientLoc.x + 2, + clientLoc.y + 2)); + try { + Thread.sleep(2000); + } catch (Exception e) {} + int pixelVal = clientPixels.getRGB(0, 0); + clipTest.dispose(); + if ((new Color(pixelVal)).equals(fillColor)) { + System.out.println("Passed"); + } else { + throw new Error("Failed: incorrect color in pixel (0, 0)"); + } + } catch (Exception e) { + System.out.println("Problems creating Robot"); + } + } +} diff --git a/jdk/test/sun/java2d/OpenGL/DrawBufImgOp.java b/jdk/test/sun/java2d/OpenGL/DrawBufImgOp.java new file mode 100644 index 00000000000..321d8c0a5ea --- /dev/null +++ b/jdk/test/sun/java2d/OpenGL/DrawBufImgOp.java @@ -0,0 +1,483 @@ +/* + * 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. + * + * 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 6514990 + * @summary Verifies that calling + * Graphics2D.drawImage(BufferedImage, BufferedImageOp, x, y) to an + * OpenGL-accelerated destination produces the same results when performed + * in software via BufferedImageOp.filter(). + * @run main/othervm -Dsun.java2d.opengl=True DrawBufImgOp -ignore + * @author campbelc + */ + +import java.awt.*; +import java.awt.image.*; +import java.io.File; +import javax.imageio.ImageIO; + +/** + * REMIND: This testcase was originally intended to automatically compare + * the results of the software BufferedImageOp implementations against + * the OGL-accelerated codepaths. However, there are just too many open + * bugs in the mediaLib-based codepaths (see below), which means that + * creating the reference image may cause crashes or exceptions, + * and even if we work around those cases using the "-ignore" flag, + * the visual results of the reference image are often buggy as well + * (so the comparison will fail even though the OGL results are correct). + * Therefore, for now we will run the testcase with the "-ignore" flag + * but without the "-compare" flag, so at least it will be checking for + * any exceptions/crashes in the OGL code. When we fix all of the + * outstanding bugs with the software codepaths, we can remove the + * "-ignore" flag and maybe even restore the "-compare" flag. In the + * meantime, it stil functions well as a manual testcase (with either + * the "-show" or "-dump" options). + */ +public class DrawBufImgOp extends Canvas { + + private static final int TESTW = 600; + private static final int TESTH = 500; + private static boolean done; + + /* + * If true, skips tests that are known to trigger bugs (which in + * turn may cause crashes, exceptions, or other artifacts). + */ + private static boolean ignore; + + // Test both pow2 and non-pow2 sized images + private static final int[] srcSizes = { 32, 17 }; + private static final int[] srcTypes = { + BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_INT_ARGB, + BufferedImage.TYPE_INT_ARGB_PRE, + BufferedImage.TYPE_INT_BGR, + BufferedImage.TYPE_3BYTE_BGR, + BufferedImage.TYPE_4BYTE_ABGR, + BufferedImage.TYPE_USHORT_565_RGB, + BufferedImage.TYPE_BYTE_GRAY, + BufferedImage.TYPE_USHORT_GRAY, + }; + + private static final RescaleOp + rescale1band, rescale3band, rescale4band; + private static final LookupOp + lookup1bandbyte, lookup3bandbyte, lookup4bandbyte; + private static final LookupOp + lookup1bandshort, lookup3bandshort, lookup4bandshort; + private static final ConvolveOp + convolve3x3zero, convolve5x5zero, convolve7x7zero; + private static final ConvolveOp + convolve3x3noop, convolve5x5noop, convolve7x7noop; + + static { + rescale1band = new RescaleOp(0.5f, 10.0f, null); + rescale3band = new RescaleOp( + new float[] { 0.6f, 0.4f, 0.6f }, + new float[] { 10.0f, -3.0f, 5.0f }, + null); + rescale4band = new RescaleOp( + new float[] { 0.6f, 0.4f, 0.6f, 0.9f }, + new float[] { -1.0f, 5.0f, 3.0f, 1.0f }, + null); + + // REMIND: we should probably test non-zero offsets, but that + // would require massaging the source image data to avoid going + // outside the lookup table array bounds + int offset = 0; + { + byte invert[] = new byte[256]; + byte halved[] = new byte[256]; + for (int j = 0; j < 256 ; j++) { + invert[j] = (byte) (255-j); + halved[j] = (byte) (j / 2); + } + ByteLookupTable lut1 = new ByteLookupTable(offset, invert); + lookup1bandbyte = new LookupOp(lut1, null); + ByteLookupTable lut3 = + new ByteLookupTable(offset, + new byte[][] {invert, halved, invert}); + lookup3bandbyte = new LookupOp(lut3, null); + ByteLookupTable lut4 = + new ByteLookupTable(offset, + new byte[][] {invert, halved, invert, halved}); + lookup4bandbyte = new LookupOp(lut4, null); + } + + { + short invert[] = new short[256]; + short halved[] = new short[256]; + for (int j = 0; j < 256 ; j++) { + invert[j] = (short) ((255-j) * 255); + halved[j] = (short) ((j / 2) * 255); + } + ShortLookupTable lut1 = new ShortLookupTable(offset, invert); + lookup1bandshort = new LookupOp(lut1, null); + ShortLookupTable lut3 = + new ShortLookupTable(offset, + new short[][] {invert, halved, invert}); + lookup3bandshort = new LookupOp(lut3, null); + ShortLookupTable lut4 = + new ShortLookupTable(offset, + new short[][] {invert, halved, invert, halved}); + lookup4bandshort = new LookupOp(lut4, null); + } + + // 3x3 blur + float[] data3 = { + 0.1f, 0.1f, 0.1f, + 0.1f, 0.2f, 0.1f, + 0.1f, 0.1f, 0.1f, + }; + Kernel k3 = new Kernel(3, 3, data3); + + // 5x5 edge + float[] data5 = { + -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, 24.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, + }; + Kernel k5 = new Kernel(5, 5, data5); + + // 7x7 blur + float[] data7 = { + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, 0.02f, + }; + Kernel k7 = new Kernel(7, 7, data7); + + convolve3x3zero = new ConvolveOp(k3, ConvolveOp.EDGE_ZERO_FILL, null); + convolve5x5zero = new ConvolveOp(k5, ConvolveOp.EDGE_ZERO_FILL, null); + convolve7x7zero = new ConvolveOp(k7, ConvolveOp.EDGE_ZERO_FILL, null); + + convolve3x3noop = new ConvolveOp(k3, ConvolveOp.EDGE_NO_OP, null); + convolve5x5noop = new ConvolveOp(k5, ConvolveOp.EDGE_NO_OP, null); + convolve7x7noop = new ConvolveOp(k7, ConvolveOp.EDGE_NO_OP, null); + } + + public void paint(Graphics g) { + synchronized (this) { + if (done) { + return; + } + } + + VolatileImage vimg = createVolatileImage(TESTW, TESTH); + vimg.validate(getGraphicsConfiguration()); + + Graphics2D g2d = vimg.createGraphics(); + renderTest(g2d); + g2d.dispose(); + + g.drawImage(vimg, 0, 0, null); + + Toolkit.getDefaultToolkit().sync(); + + synchronized (this) { + done = true; + notifyAll(); + } + } + + /* + * foreach source image size (once with pow2, once with non-pow2) + * + * foreach BufferedImage type + * + * RescaleOp (1 band) + * RescaleOp (3 bands, if src has 3 bands) + * RescaleOp (4 bands, if src has 4 bands) + * + * foreach LookupTable type (once with ByteLUT, once with ShortLUT) + * LookupOp (1 band) + * LookupOp (3 bands, if src has 3 bands) + * LookupOp (4 bands, if src has 4 bands) + * + * foreach edge condition (once with ZERO_FILL, once with EDGE_NO_OP) + * ConvolveOp (3x3) + * ConvolveOp (5x5) + * ConvolveOp (7x7) + */ + private void renderTest(Graphics2D g2d) { + g2d.setColor(Color.white); + g2d.fillRect(0, 0, TESTW, TESTH); + + int yorig = 2; + int xinc = 34; + int yinc = srcSizes[0] + srcSizes[1] + 2 + 2; + + for (int srcType : srcTypes) { + int y = yorig; + + for (int srcSize : srcSizes) { + int x = 2; + System.out.printf("type=%d size=%d\n", srcType, srcSize); + + BufferedImage srcImg = makeSourceImage(srcSize, srcType); + ColorModel srcCM = srcImg.getColorModel(); + + // RescaleOp + g2d.drawImage(srcImg, rescale1band, x, y); + x += xinc; + // REMIND: 3-band RescaleOp.filter() throws IAE for images + // that contain an alpha channel (bug to be filed) + if (srcCM.getNumColorComponents() == 3 && + !(ignore && srcCM.hasAlpha())) + { + g2d.drawImage(srcImg, rescale3band, x, y); + } + x += xinc; + if (srcCM.getNumComponents() == 4) { + g2d.drawImage(srcImg, rescale4band, x, y); + } + x += xinc; + + // LookupOp + // REMIND: Our LUTs are only 256 elements long, so won't + // currently work with USHORT_GRAY data + if (srcType != BufferedImage.TYPE_USHORT_GRAY) { + g2d.drawImage(srcImg, lookup1bandbyte, x, y); + x += xinc; + if (srcCM.getNumColorComponents() == 3) { + g2d.drawImage(srcImg, lookup3bandbyte, x, y); + } + x += xinc; + if (srcCM.getNumComponents() == 4) { + g2d.drawImage(srcImg, lookup4bandbyte, x, y); + } + x += xinc; + + // REMIND: LookupOp.createCompatibleDestImage() throws + // IAE for 3BYTE_BGR/4BYTE_ABGR (bug to be filed) + if (!(ignore && + (srcType == BufferedImage.TYPE_3BYTE_BGR || + srcType == BufferedImage.TYPE_4BYTE_ABGR))) + { + g2d.drawImage(srcImg, lookup1bandshort, x, y); + x += xinc; + // REMIND: 3-band LookupOp.filter() throws IAE for + // images that contain an alpha channel + // (bug to be filed) + if (srcCM.getNumColorComponents() == 3 && + !(ignore && srcCM.hasAlpha())) + { + g2d.drawImage(srcImg, lookup3bandshort, x, y); + } + x += xinc; + if (srcCM.getNumComponents() == 4) { + g2d.drawImage(srcImg, lookup4bandshort, x, y); + } + x += xinc; + } else { + x += 3*xinc; + } + } else { + x += 6*xinc; + } + + // ConvolveOp + // REMIND: ConvolveOp.filter() throws ImagingOpException + // for 3BYTE_BGR (see 4957775) + if (srcType != BufferedImage.TYPE_3BYTE_BGR) { + g2d.drawImage(srcImg, convolve3x3zero, x, y); + x += xinc; + g2d.drawImage(srcImg, convolve5x5zero, x, y); + x += xinc; + g2d.drawImage(srcImg, convolve7x7zero, x, y); + x += xinc; + + g2d.drawImage(srcImg, convolve3x3noop, x, y); + x += xinc; + g2d.drawImage(srcImg, convolve5x5noop, x, y); + x += xinc; + g2d.drawImage(srcImg, convolve7x7noop, x, y); + x += xinc; + } else { + x += 6*xinc; + } + + y += srcSize + 2; + } + + yorig += yinc; + } + } + + private BufferedImage makeSourceImage(int size, int type) { + int s2 = size/2; + BufferedImage img = new BufferedImage(size, size, type); + Graphics2D g2d = img.createGraphics(); + g2d.setComposite(AlphaComposite.Src); + g2d.setColor(Color.orange); + g2d.fillRect(0, 0, size, size); + g2d.setColor(Color.red); + g2d.fillRect(0, 0, s2, s2); + g2d.setColor(Color.green); + g2d.fillRect(s2, 0, s2, s2); + g2d.setColor(Color.blue); + g2d.fillRect(0, s2, s2, s2); + g2d.setColor(new Color(255, 255, 0, 128)); + g2d.fillRect(s2, s2, s2, s2); + g2d.setColor(Color.pink); + g2d.fillOval(s2-3, s2-3, 6, 6); + g2d.dispose(); + return img; + } + + public BufferedImage makeReferenceImage() { + BufferedImage img = new BufferedImage(TESTW, TESTH, + BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = img.createGraphics(); + renderTest(g2d); + g2d.dispose(); + return img; + } + + public Dimension getPreferredSize() { + return new Dimension(TESTW, TESTH); + } + + private static void compareImages(BufferedImage refImg, + BufferedImage testImg, + int tolerance) + { + int x1 = 0; + int y1 = 0; + int x2 = refImg.getWidth(); + int y2 = refImg.getHeight(); + + for (int y = y1; y < y2; y++) { + for (int x = x1; x < x2; x++) { + Color expected = new Color(refImg.getRGB(x, y)); + Color actual = new Color(testImg.getRGB(x, y)); + if (!isSameColor(expected, actual, tolerance)) { + throw new RuntimeException("Test failed at x="+x+" y="+y+ + " (expected="+expected+ + " actual="+actual+ + ")"); + } + } + } + } + + private static boolean isSameColor(Color c1, Color c2, int e) { + int r1 = c1.getRed(); + int g1 = c1.getGreen(); + int b1 = c1.getBlue(); + int r2 = c2.getRed(); + int g2 = c2.getGreen(); + int b2 = c2.getBlue(); + int rmin = Math.max(r2-e, 0); + int gmin = Math.max(g2-e, 0); + int bmin = Math.max(b2-e, 0); + int rmax = Math.min(r2+e, 255); + int gmax = Math.min(g2+e, 255); + int bmax = Math.min(b2+e, 255); + if (r1 >= rmin && r1 <= rmax && + g1 >= gmin && g1 <= gmax && + b1 >= bmin && b1 <= bmax) + { + return true; + } + return false; + } + + public static void main(String[] args) throws Exception { + boolean show = false; + boolean dump = false; + boolean compare = false; + + for (String arg : args) { + if (arg.equals("-show")) { + show = true; + } else if (arg.equals("-dump")) { + dump = true; + } else if (arg.equals("-compare")) { + compare = true; + } else if (arg.equals("-ignore")) { + ignore = true; + } + } + + DrawBufImgOp test = new DrawBufImgOp(); + Frame frame = new Frame(); + frame.add(test); + frame.pack(); + frame.setVisible(true); + + // Wait until the component's been painted + synchronized (test) { + while (!done) { + try { + test.wait(); + } catch (InterruptedException e) { + throw new RuntimeException("Failed: Interrupted"); + } + } + } + + GraphicsConfiguration gc = frame.getGraphicsConfiguration(); + if (gc.getColorModel() instanceof IndexColorModel) { + System.out.println("IndexColorModel detected: " + + "test considered PASSED"); + frame.dispose(); + return; + } + + // Grab the screen region + BufferedImage capture = null; + try { + Robot robot = new Robot(); + Point pt1 = test.getLocationOnScreen(); + Rectangle rect = new Rectangle(pt1.x, pt1.y, TESTW, TESTH); + capture = robot.createScreenCapture(rect); + } catch (Exception e) { + throw new RuntimeException("Problems creating Robot"); + } finally { + if (!show) { + frame.dispose(); + } + } + + // Compare the images (allow for +/- 1 bit differences in color comps) + if (dump || compare) { + BufferedImage ref = test.makeReferenceImage(); + if (dump) { + ImageIO.write(ref, "png", + new File("DrawBufImgOp.ref.png")); + ImageIO.write(capture, "png", + new File("DrawBufImgOp.cap.png")); + } + if (compare) { + test.compareImages(ref, capture, 1); + } + } + } +} diff --git a/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java b/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java new file mode 100644 index 00000000000..5e8831862c8 --- /dev/null +++ b/jdk/test/sun/java2d/SunGraphics2D/DrawImageBilinear.java @@ -0,0 +1,205 @@ +/* + * 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. + * + * 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 5009033 6603000 6666362 + * @summary Verifies that images transformed with bilinear filtering do not + * leave artifacts at the edges. + * @run main/othervm DrawImageBilinear + * @run main/othervm -Dsun.java2d.opengl=True DrawImageBilinear + * @author campbelc + */ + +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.awt.image.IndexColorModel; +import java.awt.image.VolatileImage; + +public class DrawImageBilinear extends Canvas { + + private static final int SIZE = 5; + + private static boolean done; + private BufferedImage bimg1, bimg2; + private VolatileImage vimg; + private static volatile BufferedImage capture; + private static void doCapture(Component test) { + // Grab the screen region + try { + Robot robot = new Robot(); + Point pt1 = test.getLocationOnScreen(); + Rectangle rect = + new Rectangle(pt1.x, pt1.y, test.getWidth(), test.getHeight()); + capture = robot.createScreenCapture(rect); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private void renderPattern(Graphics g) { + g.setColor(Color.red); + g.fillRect(0, 0, SIZE, SIZE); + //g.setColor(Color.green); + //g.drawRect(0, 0, SIZE-1, SIZE-1); + g.dispose(); + } + + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D)g; + + if (bimg1 == null) { + bimg1 = (BufferedImage)createImage(SIZE, SIZE); + bimg1.setAccelerationPriority(0.0f); + renderPattern(bimg1.createGraphics()); + + bimg2 = (BufferedImage)createImage(SIZE, SIZE); + renderPattern(bimg2.createGraphics()); + + vimg = createVolatileImage(SIZE, SIZE); + vimg.validate(getGraphicsConfiguration()); + renderPattern(vimg.createGraphics()); + } + + do { + g2d.setColor(Color.white); + g2d.fillRect(0, 0, getWidth(), getHeight()); + + g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, + RenderingHints.VALUE_INTERPOLATION_BILINEAR); + + // first time will be a sw->surface blit + g2d.drawImage(bimg1, 10, 10, 40, 40, null); + + // second time will be a texture->surface blit + g2d.drawImage(bimg2, 80, 10, 40, 40, null); + g2d.drawImage(bimg2, 80, 10, 40, 40, null); + + // third time will be a pbuffer->surface blit + if (vimg.validate(getGraphicsConfiguration()) != VolatileImage.IMAGE_OK) { + renderPattern(vimg.createGraphics()); + } + g2d.drawImage(vimg, 150, 10, 40, 40, null); + + Toolkit.getDefaultToolkit().sync(); + } while (vimg.contentsLost()); + + synchronized (this) { + if (!done) { + doCapture(this); + done = true; + } + notifyAll(); + } + } + + public Dimension getPreferredSize() { + return new Dimension(200, 100); + } + + private static void testRegion(BufferedImage bi, + Rectangle affectedRegion) + { + int x1 = affectedRegion.x; + int y1 = affectedRegion.y; + int x2 = x1 + affectedRegion.width; + int y2 = y1 + affectedRegion.height; + + for (int y = y1; y < y2; y++) { + for (int x = x1; x < x2; x++) { + int actual = bi.getRGB(x, y); + if ((actual != 0xfffe0000) && (actual != 0xffff0000)) { + throw new RuntimeException("Test failed at x="+x+" y="+y+ + " (expected=0xffff0000"+ + " actual=0x"+ + Integer.toHexString(actual) + + ")"); + } + } + } + } + + public static void main(String[] args) { + boolean show = false; + for (String arg : args) { + if ("-show".equals(arg)) { + show = true; + } + } + + DrawImageBilinear test = new DrawImageBilinear(); + Frame frame = new Frame(); + frame.add(test); + frame.pack(); + frame.setVisible(true); + + // Wait until the component's been painted + synchronized (test) { + while (!done) { + try { + test.wait(); + } catch (InterruptedException e) { + throw new RuntimeException("Failed: Interrupted"); + } + } + } + + GraphicsConfiguration gc = frame.getGraphicsConfiguration(); + if (gc.getColorModel() instanceof IndexColorModel) { + System.out.println("IndexColorModel detected: " + + "test considered PASSED"); + frame.dispose(); + return; + } + + if (!show) { + frame.dispose(); + } + if (capture == null) { + throw new RuntimeException("Failed: capture is null"); + } + + // Test background color + int pixel = capture.getRGB(5, 5); + if (pixel != 0xffffffff) { + throw new RuntimeException("Failed: Incorrect color for " + + "background"); + } + + // Test pixels + testRegion(capture, new Rectangle(10, 10, 40, 40)); + testRegion(capture, new Rectangle(80, 10, 40, 40)); + testRegion(capture, new Rectangle(150, 10, 40, 40)); + } +} diff --git a/jdk/test/sun/java2d/SunGraphics2D/PolyVertTest.java b/jdk/test/sun/java2d/SunGraphics2D/PolyVertTest.java new file mode 100644 index 00000000000..73138973b9e --- /dev/null +++ b/jdk/test/sun/java2d/SunGraphics2D/PolyVertTest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2002-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. + * + * 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 4678208 4771101 6328481 6588884 + * @summary verify the pixelization of degenerate polylines and polygons + * @run main PolyVertTest + * @run main/othervm -Dsun.java2d.d3d=True PolyVertTest -hwonly + * @run main/othervm -Dsun.java2d.opengl=True PolyVertTest -hwonly + */ + +import java.awt.*; +import java.awt.event.*; +import java.awt.geom.*; +import java.awt.image.*; + +public class PolyVertTest { + static int TESTWIDTH; + static int TESTHEIGHT; + static final int REG_TEST_WIDTH = 10; + static final int REG_TEST_HEIGHT = 10; + static final int FULL_TEST_WIDTH = 50; + static final int FULL_TEST_HEIGHT = 200; + + static final int FRINGE = 2; + static final int GREEN = Color.green.getRGB(); + static final int RED = Color.red.getRGB(); + + static BufferedImage refImg; + static BufferedImage errorImg; + static Graphics errorG; + static Component testCanvas; + + static int totalbadpixels; + static int totalfuzzypixels; + static int numbadtests; + static int numfuzzytests; + static int numframes; + static int fuzzystarty; + + static boolean counting; + static boolean showerrors; + static boolean showresults; + static boolean fringe; + static boolean forceerror; + static boolean fulltest = true; + static boolean hwonly; + + static WindowListener windowCloser = new WindowAdapter() { + public void windowClosing(WindowEvent e) { + e.getWindow().hide(); + if (--numframes <= 0) { + System.exit(0); + } + } + }; + + public PolyVertTest() { + /* + setBackground(Color.white); + setForeground(Color.black); + */ + } + + static int polypts[][][] = { + { + // void polygon (no points) + {}, {}, + }, + { + // one point + { 0 }, { 0 }, + }, + { + // two points + { 0, 5 }, { 0, 0 }, + { 0, 0, 6, 1, + 10, 0, 6, 1, + 20, 0, 6, 1 }, + { 0, 0, 6, 1, + 10, 0, 1, 1, 15, 0, 1, 1, + 20, 0, 1, 1, 25, 0, 1, 1 }, + { 10, 0, 1, 1, + 20, 0, 1, 1 }, + }, + { + // open triangle + { 0, 5, 5 }, { 0, 0, 5 }, + + { 0, 0, 6, 1, 5, 1, 1, 5, + + 10, 0, 6, 1, 15, 1, 1, 5, 11, 1, 1, 1, + 12, 2, 1, 1, 13, 3, 1, 1, 14, 4, 1, 1, + + 20, 0, 6, 1, 25, 1, 1, 5, 21, 1, 1, 1, + 22, 2, 1, 1, 23, 3, 1, 1, 24, 4, 1, 1 }, + + { 0, 0, 6, 1, 5, 1, 1, 5, + + 10, 0, 6, 1, 15, 1, 1, 5, 11, 1, 1, 1, + 12, 2, 1, 1, 13, 3, 1, 1, 14, 4, 1, 1, + + 20, 0, 6, 1, 25, 1, 1, 5, 21, 1, 1, 1, + 22, 2, 1, 1, 23, 3, 1, 1, 24, 4, 1, 1 }, + + { 10, 0, 1, 1, + 20, 0, 1, 1 }, + }, + { + // closed triangle + { 0, 5, 5, 0 }, { 0, 0, 5, 0 }, + + { 0, 0, 6, 1, 5, 1, 1, 5, 1, 1, 1, 1, + 2, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1, 1, + + 10, 0, 6, 1, 15, 1, 1, 5, 11, 1, 1, 1, + 12, 2, 1, 1, 13, 3, 1, 1, 14, 4, 1, 1, + + 20, 0, 6, 1, 25, 1, 1, 5, 21, 1, 1, 1, + 22, 2, 1, 1, 23, 3, 1, 1, 24, 4, 1, 1 }, + + { 1, 0, 5, 1, 5, 1, 1, 5, 1, 1, 1, 1, + 2, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1, 1, + + 10, 0, 6, 1, 15, 1, 1, 5, 11, 1, 1, 1, + 12, 2, 1, 1, 13, 3, 1, 1, 14, 4, 1, 1, + + 20, 0, 6, 1, 25, 1, 1, 5, 21, 1, 1, 1, + 22, 2, 1, 1, 23, 3, 1, 1, 24, 4, 1, 1 }, + + { 0, 0, 1, 1, + 10, 0, 1, 1, + 20, 0, 1, 1 }, + }, + { + // empty line + { 0, 0 }, { 0, 0 }, + { 0, 0, 1, 1, + 10, 0, 1, 1, + 20, 0, 1, 1 }, + }, + { + // empty triangle + { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 1, 1, + 10, 0, 1, 1, + 20, 0, 1, 1 }, + }, + }; + + public static void render(Graphics2D g2d) { + g2d.setColor(Color.white); + g2d.fillRect(0, 0, TESTWIDTH, TESTHEIGHT); + g2d.setColor(Color.black); + + if (forceerror) { + g2d.fillRect(2, 2, 2, 2); + g2d.fillRect(15, 5, 1, 1); + } + + if (!fulltest) { + g2d.draw(new Rectangle2D.Double(5, 5, 0, 0)); + return; + } + + g2d.drawLine(10, 10, 10, 10); + g2d.draw(new Line2D.Double(20, 10, 20, 10)); + + g2d.drawRect(10, 20, 0, 0); + g2d.draw(new Rectangle2D.Double(20, 20, 0, 0)); + + g2d.setXORMode(Color.white); + + g2d.drawLine(10, 30, 10, 30); + g2d.draw(new Line2D.Double(20, 30, 20, 30)); + + g2d.drawRect(10, 40, 0, 0); + g2d.draw(new Rectangle2D.Double(20, 40, 0, 0)); + + g2d.setPaintMode(); + + int y = 50; + for (int i = 0; i < polypts.length; i++) { + int data[][] = polypts[i]; + int xpoints[] = data[0]; + int ypoints[] = data[1]; + int npoints = xpoints.length; + g2d.translate(10, y); + g2d.drawPolyline(xpoints, ypoints, npoints); + g2d.translate(10, 0); + g2d.drawPolygon(xpoints, ypoints, npoints); + g2d.translate(10, 0); + g2d.draw(new Polygon(xpoints, ypoints, npoints)); + g2d.translate(-30, -y); + y += 10; + } + g2d.setXORMode(Color.white); + for (int i = 0; i < polypts.length; i++) { + int data[][] = polypts[i]; + int xpoints[] = data[0]; + int ypoints[] = data[1]; + int npoints = xpoints.length; + g2d.translate(10, y); + g2d.drawPolyline(xpoints, ypoints, npoints); + g2d.translate(10, 0); + g2d.drawPolygon(xpoints, ypoints, npoints); + g2d.translate(10, 0); + g2d.draw(new Polygon(xpoints, ypoints, npoints)); + g2d.translate(-30, -y); + y += 10; + } + g2d.setPaintMode(); + } + + public Dimension getPreferredSize() { + return new Dimension(500, 500); + } + + public static void usage(int exitcode) { + System.err.println("usage: java PolyVertTest [